@lovrabet/lovrabet-cli 2.1.9-beta.2 → 2.1.9-beta.4
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/NOTICE +5 -0
- package/README.md +156 -0
- 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/app-config/shared.js +1 -1
- package/lib/commands/artifact/index.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/schema.js +1 -1
- package/lib/commands/service/dynamic.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/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/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/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.js +1 -1
- package/lib/help.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/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/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 +18 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x219e05,_0x57361a){const _0x102199=a38_0x27e2,_0x52845f=_0x219e05();while(!![]){try{const _0x1e423a=-parseInt(_0x102199(0x126))/0x1+parseInt(_0x102199(0x16f))/0x2+parseInt(_0x102199(0x14b))/0x3+-parseInt(_0x102199(0x11b))/0x4+parseInt(_0x102199(0x133))/0x5+parseInt(_0x102199(0x118))/0x6*(-parseInt(_0x102199(0x134))/0x7)+parseInt(_0x102199(0x142))/0x8*(parseInt(_0x102199(0x147))/0x9);if(_0x1e423a===_0x57361a)break;else _0x52845f['push'](_0x52845f['shift']());}catch(_0x347612){_0x52845f['push'](_0x52845f['shift']());}}}(a38_0x1445,0xb5503));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x48b01f,_0x4cfede){const _0x1fa76b=a38_0x27e2,_0x5ddd36=listLocalServiceTrees();let _0x4c7aca;for(const _0xc1ec5d of _0x5ddd36){const _0x2e8093=matchServiceTreeCommand(_0xc1ec5d,_0x48b01f);if(!_0x2e8093)continue;(!_0x4c7aca||_0x2e8093[_0x1fa76b(0x11d)][_0x1fa76b(0x14c)][_0x1fa76b(0x16a)]>_0x4c7aca[_0x1fa76b(0x11d)][_0x1fa76b(0x14c)][_0x1fa76b(0x16a)])&&(_0x4c7aca={'tree':_0xc1ec5d,'command':_0x2e8093[_0x1fa76b(0x11d)],'remainingArgs':_0x2e8093['remainingArgs']});}if(!_0x4c7aca)return undefined;const _0x294474={..._0x4cfede};return applyAppBinding(_0x4c7aca['tree'],_0x4c7aca[_0x1fa76b(0x11d)],_0x294474),{'definition':buildDynamicCommandDefinition(_0x4c7aca[_0x1fa76b(0x143)],_0x4c7aca[_0x1fa76b(0x11d)]),'args':_0x4c7aca[_0x1fa76b(0x15f)],'flags':_0x294474,'tree':_0x4c7aca[_0x1fa76b(0x143)],'command':_0x4c7aca['command']};}function a38_0x1445(){const _0x37aef8=['nickName','trim','6162584ktOSIw','tree','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','find','bff','18uWhIGf','app','read','Run\x20service\x20command\x20','2008530QAophN','fullPath','Preview\x20dynamic\x20service\x20command:\x20','service','\x20\x20\x20\x20sqlCode:\x20','operator','\x22\x20in\x20service\x20command\x20','bffCode','args','kind','\x20\x20\x20\x20kind:\x20\x20\x20\x20','appcode','ctx.','tenantCode','description','required','\x20\x20\x20\x20scriptName:\x20','userName','SERVICE_TREE','userId','remainingArgs','name','push','source','bffId','normalizedManifest','nickname','string','Unknown\x20appRef\x20\x22','\x20\x20[','envName','length','join','mapTo','boolean','type','1069402EXQBRE','\x20\x20\x20\x20datasetCode:\x20','appCode','json','now','sqlCode','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','scriptName','code','map','96042eDmTzt','filter','env','1653884EiepBK','Cannot\x20resolve\x20datatable\x20\x22','command','\x20\x20\x20\x20datatable:\x20','dbtableConfig','cliPath','data','risk','validation','rawFlags','`\x20to\x20inspect\x20the\x20manifest.','1397326hAGNZl','appRef','commands','enum','number','slice','\x20\x20MAP\x20TO','some','context.','\x20<command>\x20[flags]','params','Service\x20command\x20','datasetCode','2564535xGlpag','308tBVXFK','appBindings','datatable','flags','\x20\x20SERVICE\x20TREE\x20TARGET','cliName','target','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','\x20->\x20','Use\x20`','\x20requires\x20target.scriptName.','sql'];a38_0x1445=function(){return _0x37aef8;};return a38_0x1445();}export function generateDynamicServiceHelp(_0x49b820){const _0x3f8063=a38_0x27e2,_0x1af058=listLocalServiceTrees()[_0x3f8063(0x145)](_0x54ec3c=>_0x54ec3c[_0x3f8063(0x14e)][_0x3f8063(0x116)]===_0x49b820);if(!_0x1af058)return undefined;const _0x406c39=[CLI_BIN_NAME+'\x20'+_0x49b820+_0x3f8063(0x12f),'',_0x1af058[_0x3f8063(0x14e)]['name']||_0x49b820,_0x1af058[_0x3f8063(0x14e)][_0x3f8063(0x159)]?'\x20\x20'+_0x1af058[_0x3f8063(0x14e)][_0x3f8063(0x159)]:'','','Commands:',..._0x1af058[_0x3f8063(0x128)][_0x3f8063(0x117)](_0x1565ce=>{const _0x4001f6=_0x3f8063,_0x44730a=_0x1565ce['fullPath'][_0x4001f6(0x12b)](0x1)[_0x4001f6(0x16b)]('\x20'),_0x376a72=_0x1565ce[_0x4001f6(0x122)]===_0x4001f6(0x149)?'':'\x20['+_0x1565ce[_0x4001f6(0x122)]+']';return'\x20\x20'+_0x44730a['padEnd'](0x18)+'\x20'+(_0x1565ce[_0x4001f6(0x159)]||'')+_0x376a72;}),'',_0x3f8063(0x13d)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x49b820+_0x3f8063(0x125)][_0x3f8063(0x119)](Boolean);return _0x406c39['join']('\x0a');}export function listDynamicServiceEntries(){const _0x2a855a=a38_0x27e2;return listLocalServices()[_0x2a855a(0x117)](_0x2c4ab3=>{const _0x29349c=_0x2a855a,_0x3a17ab=_0x2c4ab3[_0x29349c(0x164)];return{'service':_0x3a17ab[_0x29349c(0x14e)][_0x29349c(0x116)],'label':_0x3a17ab[_0x29349c(0x14e)][_0x29349c(0x160)]||_0x3a17ab[_0x29349c(0x14e)][_0x29349c(0x116)],'commands':_0x3a17ab[_0x29349c(0x128)][_0x29349c(0x117)](_0x15fc49=>({'command':dynamicCommandName(_0x15fc49),'description':_0x15fc49[_0x29349c(0x159)]||_0x29349c(0x14a)+_0x15fc49[_0x29349c(0x120)],'tag':riskTag(_0x15fc49['risk'])}))};});}export function getDynamicServiceEntry(_0x46eaed){const _0x16d2e7=a38_0x27e2;return listDynamicServiceEntries()[_0x16d2e7(0x145)](_0x1df146=>_0x1df146[_0x16d2e7(0x14e)]===_0x46eaed);}export function listDynamicServiceDefinitions(_0x417097){const _0x637252=a38_0x27e2;return listLocalServiceTrees()[_0x637252(0x119)](_0x45b69a=>!_0x417097||_0x45b69a[_0x637252(0x14e)][_0x637252(0x116)]===_0x417097)['flatMap'](_0x53e5df=>_0x53e5df[_0x637252(0x128)][_0x637252(0x117)](_0x58983e=>buildDynamicCommandDefinition(_0x53e5df,_0x58983e)));}export function getDynamicServiceDefinitions(_0xca1471){const _0x2403cf=a38_0x27e2,_0x4f8041=listDynamicServiceDefinitions(_0xca1471);return _0x4f8041[_0x2403cf(0x16a)]>0x0?_0x4f8041:undefined;}export function findDynamicServiceDefinition(_0x2b022f,_0x1c0659){const _0x454533=a38_0x27e2;return listDynamicServiceDefinitions(_0x2b022f)['find'](_0x199438=>_0x199438[_0x454533(0x11d)]===_0x1c0659);}export function buildDynamicCommandDefinition(_0x1db319,_0x35dd2a){const _0x5c3a09=a38_0x27e2;return{'service':_0x1db319['service'][_0x5c3a09(0x116)],'command':dynamicCommandName(_0x35dd2a),'description':_0x35dd2a[_0x5c3a09(0x159)]||_0x5c3a09(0x14a)+_0x35dd2a['cliPath'],'risk':_0x35dd2a[_0x5c3a09(0x122)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x35dd2a[_0x5c3a09(0x153)][_0x5c3a09(0x117)](_0x5da729=>({'name':_0x5da729[_0x5c3a09(0x160)],'description':_0x5da729[_0x5c3a09(0x159)]||_0x5da729['name'],'required':_0x5da729['required']})),'flags':_0x35dd2a[_0x5c3a09(0x137)][_0x5c3a09(0x117)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x35dd2a),async 'dryRun'(_0x11b9fc){const _0x5b8b56=_0x5c3a09,_0x42e657=await compilePlan(_0x35dd2a,_0x11b9fc);return{'method':_0x5b8b56(0x15d),'url':_0x35dd2a['cliPath'],'body':{'target':targetPreview(_0x42e657),'params':_0x42e657['params']},'description':_0x5b8b56(0x14d)+_0x35dd2a[_0x5b8b56(0x120)]};},async 'execute'(_0x400aae){const _0x526d57=_0x5c3a09,_0x268018=await compilePlan(_0x35dd2a,_0x400aae),_0x2c7ae6=Date[_0x526d57(0x112)](),_0x44a5dc=await executePlan(_0x268018,_0x35dd2a,_0x400aae),_0x483593=Date[_0x526d57(0x112)]()-_0x2c7ae6;return{'ok':!![],'data':{'service':_0x1db319[_0x526d57(0x14e)],'command':_0x35dd2a[_0x526d57(0x120)],'target':targetPreview(_0x268018),'result':_0x44a5dc,'elapsed':_0x483593},'message':'Service\x20command\x20'+_0x35dd2a[_0x526d57(0x120)]+'\x20completed\x20in\x20'+_0x483593+'ms'};}};}function dynamicCommandName(_0x175b97){const _0x288a45=a38_0x27e2;return _0x175b97[_0x288a45(0x14c)][_0x288a45(0x12b)](0x1)[_0x288a45(0x16b)]('\x20');}function riskTag(_0x3c1184){const _0x1c42a6=a38_0x27e2;return _0x3c1184===_0x1c42a6(0x149)?'':_0x1c42a6(0x168)+_0x3c1184+']';}function flagToCommandFlag(_0x43f435){const _0x52a561=a38_0x27e2;return{'name':_0x43f435[_0x52a561(0x139)],'type':_0x43f435['type']===_0x52a561(0x111)?_0x52a561(0x166):_0x43f435[_0x52a561(0x16e)],'description':_0x43f435[_0x52a561(0x159)]||_0x43f435[_0x52a561(0x160)],'required':_0x43f435[_0x52a561(0x15a)],'default':isPrimitiveFlagDefault(_0x43f435['default'])?_0x43f435['default']:undefined,'enum':_0x43f435[_0x52a561(0x129)]};}async function compilePlan(_0x3562bb,_0x433a94){const _0x12c104=a38_0x27e2;return compileServiceTreeCommand(_0x3562bb,{'flags':_0x433a94[_0x12c104(0x124)],'args':_0x433a94[_0x12c104(0x153)],'context':await buildServiceContext(_0x3562bb,_0x433a94)});}async function buildServiceContext(_0x48b3b4,_0x1f2488){const _0x458c8e=a38_0x27e2,_0x44f843={'appCode':_0x1f2488[_0x458c8e(0x110)],'env':_0x1f2488[_0x458c8e(0x169)],'envName':_0x1f2488[_0x458c8e(0x169)]};if(!usesRuntimeContext(_0x48b3b4))return _0x44f843;const _0x27f12b=await getLoginUserInfo(),_0x25eee0=pickFirst(_0x27f12b[_0x458c8e(0x15e)],_0x27f12b['id']);return{..._0x44f843,'user':_0x27f12b,'userId':_0x25eee0,'id':_0x27f12b['id'],'username':pickFirst(_0x27f12b['username'],_0x27f12b[_0x458c8e(0x15c)],_0x27f12b['loginName']),'userName':_0x27f12b[_0x458c8e(0x15c)],'nickname':pickFirst(_0x27f12b[_0x458c8e(0x165)],_0x27f12b[_0x458c8e(0x140)]),'nickName':_0x27f12b['nickName'],'tenantCode':_0x27f12b[_0x458c8e(0x158)],'employeeId':_0x27f12b['employeeId']};}function usesRuntimeContext(_0x820926){const _0x4883ae=a38_0x27e2;return _0x820926[_0x4883ae(0x16c)][_0x4883ae(0x12d)](_0x1974dd=>typeof _0x1974dd[_0x4883ae(0x162)]==='string'&&(_0x1974dd['source']['startsWith'](_0x4883ae(0x12e))||_0x1974dd[_0x4883ae(0x162)]['startsWith'](_0x4883ae(0x157))));}function pickFirst(..._0x2cb268){return _0x2cb268['find'](_0x56f1c9=>_0x56f1c9!==undefined&&_0x56f1c9!==null);}async function executePlan(_0x5e298a,_0x3bdf5b,_0x4f8795){const _0x10580f=a38_0x27e2;if(_0x5e298a[_0x10580f(0x154)]===_0x10580f(0x121)){const _0x3f8459=await resolveDatasetCode(_0x5e298a,_0x3bdf5b,_0x4f8795);return executeData(_0x3f8459,_0x5e298a[_0x10580f(0x11d)],_0x5e298a[_0x10580f(0x130)]);}if(_0x5e298a[_0x10580f(0x154)]===_0x10580f(0x13f)){if(!_0x5e298a[_0x10580f(0x113)])throw CliErrors['validation']('Service\x20command\x20'+_0x3bdf5b[_0x10580f(0x120)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x5e298a[_0x10580f(0x113)],normalizeScalarParams(_0x5e298a[_0x10580f(0x130)]));}if(_0x5e298a[_0x10580f(0x154)]===_0x10580f(0x146)){const _0x132a81=_0x5e298a['scriptName']||_0x5e298a[_0x10580f(0x152)]||(_0x5e298a[_0x10580f(0x163)]==null?'':String(_0x5e298a[_0x10580f(0x163)]));if(!_0x132a81)throw CliErrors[_0x10580f(0x123)](_0x10580f(0x131)+_0x3bdf5b['cliPath']+_0x10580f(0x13e));return executeSdkBff(_0x132a81,_0x5e298a[_0x10580f(0x130)]);}throw CliErrors[_0x10580f(0x123)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x5e298a[_0x10580f(0x154)]);}async function resolveDatasetCode(_0x3fac6a,_0x193187,_0x1203f0){const _0x3957f4=a38_0x27e2;if(_0x3fac6a['datasetCode'])return _0x3fac6a['datasetCode'];if(!_0x3fac6a[_0x3957f4(0x136)])throw CliErrors[_0x3957f4(0x123)](_0x3957f4(0x131)+_0x193187[_0x3957f4(0x120)]+_0x3957f4(0x13b));const _0x538fd3=await listDatasets(_0x1203f0[_0x3957f4(0x110)]),_0x16af15=_0x538fd3[_0x3957f4(0x145)](_0x3737e6=>_0x3737e6[_0x3957f4(0x11f)]?.['tableName']===_0x3fac6a[_0x3957f4(0x136)]);if(!_0x16af15?.[_0x3957f4(0x116)])throw CliErrors['validation'](_0x3957f4(0x11c)+_0x3fac6a[_0x3957f4(0x136)]+_0x3957f4(0x144)+_0x1203f0[_0x3957f4(0x110)]+'.',_0x3957f4(0x114));return _0x16af15[_0x3957f4(0x116)];}function applyAppBinding(_0x39ac3e,_0xd6789c,_0x2c6e7d){const _0x397aca=a38_0x27e2,_0x57e3f3=_0xd6789c[_0x397aca(0x13a)][_0x397aca(0x127)];if(!_0x57e3f3)return;const _0x5465a7=_0x39ac3e[_0x397aca(0x135)][_0x57e3f3];if(!_0x5465a7)throw CliErrors[_0x397aca(0x123)](_0x397aca(0x167)+_0x57e3f3+_0x397aca(0x151)+_0xd6789c[_0x397aca(0x120)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x28ffb6=_0x5465a7[_0x397aca(0x156)]||_0x5465a7['appCode'];_0x28ffb6&&!hasText(_0x2c6e7d[_0x397aca(0x156)])&&(_0x2c6e7d[_0x397aca(0x156)]=_0x28ffb6),_0x5465a7[_0x397aca(0x148)]&&!hasText(_0x2c6e7d[_0x397aca(0x148)])&&!hasText(_0x2c6e7d[_0x397aca(0x156)])&&(_0x2c6e7d[_0x397aca(0x148)]=_0x5465a7['app']),_0x5465a7[_0x397aca(0x11a)]&&!hasText(_0x2c6e7d[_0x397aca(0x11a)])&&(_0x2c6e7d[_0x397aca(0x11a)]=_0x5465a7[_0x397aca(0x11a)]);}function renderDynamicCommandHelp(_0x4fb158){const _0x5cb80c=a38_0x27e2,_0x109804=[_0x5cb80c(0x138),_0x5cb80c(0x155)+_0x4fb158['target'][_0x5cb80c(0x154)],'\x20\x20\x20\x20command:\x20'+_0x4fb158[_0x5cb80c(0x13a)][_0x5cb80c(0x11d)]];if(_0x4fb158[_0x5cb80c(0x13a)][_0x5cb80c(0x132)])_0x109804[_0x5cb80c(0x161)](_0x5cb80c(0x10f)+_0x4fb158[_0x5cb80c(0x13a)]['datasetCode']);if(_0x4fb158[_0x5cb80c(0x13a)]['datatable'])_0x109804[_0x5cb80c(0x161)](_0x5cb80c(0x11e)+_0x4fb158['target'][_0x5cb80c(0x136)]);if(_0x4fb158[_0x5cb80c(0x13a)][_0x5cb80c(0x113)])_0x109804['push'](_0x5cb80c(0x14f)+_0x4fb158[_0x5cb80c(0x13a)]['sqlCode']);if(_0x4fb158['target'][_0x5cb80c(0x115)])_0x109804[_0x5cb80c(0x161)](_0x5cb80c(0x15b)+_0x4fb158[_0x5cb80c(0x13a)]['scriptName']);if(_0x4fb158['mapTo'][_0x5cb80c(0x16a)]>0x0){_0x109804[_0x5cb80c(0x161)]('',_0x5cb80c(0x12c));for(const _0x1b457a of _0x4fb158[_0x5cb80c(0x16c)]){_0x109804['push']('\x20\x20\x20\x20'+(_0x1b457a[_0x5cb80c(0x162)]||'const')+_0x5cb80c(0x13c)+_0x1b457a[_0x5cb80c(0x13a)]+(_0x1b457a[_0x5cb80c(0x150)]?'.'+_0x1b457a[_0x5cb80c(0x150)]:''));}}return _0x109804['join']('\x0a');}function targetPreview(_0x581edc){const _0xe1df1c=a38_0x27e2;return{'kind':_0x581edc[_0xe1df1c(0x154)],'command':_0x581edc[_0xe1df1c(0x11d)],'appRef':_0x581edc[_0xe1df1c(0x127)],'datasetCode':_0x581edc[_0xe1df1c(0x132)],'datatable':_0x581edc['datatable'],'sqlCode':_0x581edc[_0xe1df1c(0x113)],'bffCode':_0x581edc[_0xe1df1c(0x152)],'bffId':_0x581edc[_0xe1df1c(0x163)],'scriptName':_0x581edc[_0xe1df1c(0x115)]};}function a38_0x27e2(_0x5f3946,_0x2ce238){_0x5f3946=_0x5f3946-0x10f;const _0x144543=a38_0x1445();let _0x27e231=_0x144543[_0x5f3946];return _0x27e231;}function normalizeScalarParams(_0x6a6ed4){const _0x44a1a1=a38_0x27e2;return Object['fromEntries'](Object['entries'](_0x6a6ed4)[_0x44a1a1(0x119)](([,_0x44f7b5])=>typeof _0x44f7b5==='string'||typeof _0x44f7b5===_0x44a1a1(0x12a)));}function hasText(_0x31e538){const _0x47c7d5=a38_0x27e2;return typeof _0x31e538===_0x47c7d5(0x166)&&_0x31e538[_0x47c7d5(0x141)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x122bd6){const _0x5426eb=a38_0x27e2;return _0x122bd6===undefined||typeof _0x122bd6===_0x5426eb(0x166)||typeof _0x122bd6==='number'||typeof _0x122bd6===_0x5426eb(0x16d);}
|
|
1
|
+
(function(_0x59e6df,_0x430c9a){const _0x1d4837=a38_0x5eda,_0x4b193b=_0x59e6df();while(!![]){try{const _0xf4a589=parseInt(_0x1d4837(0x1e2))/0x1+-parseInt(_0x1d4837(0x1f6))/0x2+parseInt(_0x1d4837(0x1b7))/0x3+-parseInt(_0x1d4837(0x1d0))/0x4*(-parseInt(_0x1d4837(0x1f4))/0x5)+-parseInt(_0x1d4837(0x1ad))/0x6+-parseInt(_0x1d4837(0x1f0))/0x7+-parseInt(_0x1d4837(0x1e4))/0x8;if(_0xf4a589===_0x430c9a)break;else _0x4b193b['push'](_0x4b193b['shift']());}catch(_0x8ac52a){_0x4b193b['push'](_0x4b193b['shift']());}}}(a38_0x5865,0x5fb3d));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x27bce9,_0x31c679){const _0x3aa492=a38_0x5eda,_0x555c4d=listLocalServiceTrees();let _0x4d06b9;for(const _0x4b16d1 of _0x555c4d){const _0x2aa614=matchServiceTreeCommand(_0x4b16d1,_0x27bce9);if(!_0x2aa614)continue;(!_0x4d06b9||_0x2aa614[_0x3aa492(0x206)][_0x3aa492(0x1e9)][_0x3aa492(0x1c5)]>_0x4d06b9[_0x3aa492(0x206)][_0x3aa492(0x1e9)][_0x3aa492(0x1c5)])&&(_0x4d06b9={'tree':_0x4b16d1,'command':_0x2aa614[_0x3aa492(0x206)],'remainingArgs':_0x2aa614['remainingArgs']});}if(!_0x4d06b9)return undefined;const _0x5bf3af={..._0x31c679};return applyAppBinding(_0x4d06b9[_0x3aa492(0x1df)],_0x4d06b9[_0x3aa492(0x206)],_0x5bf3af),{'definition':buildDynamicCommandDefinition(_0x4d06b9[_0x3aa492(0x1df)],_0x4d06b9[_0x3aa492(0x206)]),'args':_0x4d06b9[_0x3aa492(0x1fd)],'flags':_0x5bf3af,'tree':_0x4d06b9[_0x3aa492(0x1df)],'command':_0x4d06b9[_0x3aa492(0x206)]};}export function generateDynamicServiceHelp(_0x2ce5e1){const _0x15571a=a38_0x5eda,_0xeaa59d=listLocalServiceTrees()[_0x15571a(0x1dd)](_0x47aab9=>_0x47aab9[_0x15571a(0x201)][_0x15571a(0x1c1)]===_0x2ce5e1);if(!_0xeaa59d)return undefined;const _0x13e64a=[CLI_BIN_NAME+'\x20'+_0x2ce5e1+_0x15571a(0x1a6),'',_0xeaa59d['service'][_0x15571a(0x1da)]||_0x2ce5e1,_0xeaa59d['service'][_0x15571a(0x1a5)]?'\x20\x20'+_0xeaa59d['service'][_0x15571a(0x1a5)]:'','',_0x15571a(0x1ef),..._0xeaa59d[_0x15571a(0x1ba)][_0x15571a(0x1fe)](_0x50468f=>{const _0x534e07=_0x15571a,_0x35bad6=_0x50468f[_0x534e07(0x1e9)]['slice'](0x1)[_0x534e07(0x1e1)]('\x20'),_0x442aaa=_0x50468f[_0x534e07(0x1ff)]===_0x534e07(0x1c4)?'':'\x20['+_0x50468f['risk']+']';return'\x20\x20'+_0x35bad6[_0x534e07(0x1fa)](0x18)+'\x20'+(_0x50468f[_0x534e07(0x1a5)]||'')+_0x442aaa;}),'',_0x15571a(0x1ae)+CLI_BIN_NAME+_0x15571a(0x1f1)+_0x2ce5e1+_0x15571a(0x1d8)]['filter'](Boolean);return _0x13e64a[_0x15571a(0x1e1)]('\x0a');}export function listDynamicServiceEntries(){const _0x25d808=a38_0x5eda;return listLocalServices()[_0x25d808(0x1fe)](_0x870a61=>{const _0x11be59=_0x25d808,_0x23011f=_0x870a61[_0x11be59(0x1b0)];return{'service':_0x23011f[_0x11be59(0x201)][_0x11be59(0x1c1)],'label':_0x23011f[_0x11be59(0x201)][_0x11be59(0x1da)]||_0x23011f[_0x11be59(0x201)][_0x11be59(0x1c1)],'commands':_0x23011f[_0x11be59(0x1ba)][_0x11be59(0x1fe)](_0x51b464=>({'command':dynamicCommandName(_0x51b464),'description':_0x51b464[_0x11be59(0x1a5)]||_0x11be59(0x1eb)+_0x51b464[_0x11be59(0x1bf)],'tag':riskTag(_0x51b464['risk'])}))};});}export function getDynamicServiceEntry(_0x3a2dc1){const _0x4ae390=a38_0x5eda;return listDynamicServiceEntries()[_0x4ae390(0x1dd)](_0x2849e7=>_0x2849e7[_0x4ae390(0x201)]===_0x3a2dc1);}export function listDynamicServiceDefinitions(_0x156a67){const _0x2b9f2f=a38_0x5eda;return listLocalServiceTrees()[_0x2b9f2f(0x1d6)](_0xc9f989=>!_0x156a67||_0xc9f989['service'][_0x2b9f2f(0x1c1)]===_0x156a67)['flatMap'](_0x7c0e99=>_0x7c0e99[_0x2b9f2f(0x1ba)][_0x2b9f2f(0x1fe)](_0x551b9d=>buildDynamicCommandDefinition(_0x7c0e99,_0x551b9d)));}export function getDynamicServiceDefinitions(_0x4a61ef){const _0x3b991f=a38_0x5eda,_0x306954=listDynamicServiceDefinitions(_0x4a61ef);return _0x306954[_0x3b991f(0x1c5)]>0x0?_0x306954:undefined;}function a38_0x5eda(_0x220538,_0x3ce482){_0x220538=_0x220538-0x1a5;const _0x58650c=a38_0x5865();let _0x5edae0=_0x58650c[_0x220538];return _0x5edae0;}export function findDynamicServiceDefinition(_0x19737d,_0x3aaef5){const _0x52d5b6=a38_0x5eda;return listDynamicServiceDefinitions(_0x19737d)[_0x52d5b6(0x1dd)](_0x27ae9a=>_0x27ae9a[_0x52d5b6(0x206)]===_0x3aaef5);}export function buildDynamicCommandDefinition(_0x188950,_0x4e92ae){const _0x407d1d=a38_0x5eda;return{'service':_0x188950['service']['code'],'command':dynamicCommandName(_0x4e92ae),'description':_0x4e92ae[_0x407d1d(0x1a5)]||_0x407d1d(0x1eb)+_0x4e92ae[_0x407d1d(0x1bf)],'risk':_0x4e92ae[_0x407d1d(0x1ff)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x4e92ae['args'][_0x407d1d(0x1fe)](_0x4d66f7=>({'name':_0x4d66f7[_0x407d1d(0x1da)],'description':_0x4d66f7[_0x407d1d(0x1a5)]||_0x4d66f7['name'],'required':_0x4d66f7[_0x407d1d(0x1e5)]})),'flags':_0x4e92ae[_0x407d1d(0x1d2)][_0x407d1d(0x1fe)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x4e92ae),async 'dryRun'(_0x317f6c){const _0x421346=_0x407d1d,_0xf1fd0f=await compilePlan(_0x4e92ae,_0x317f6c);return{'method':_0x421346(0x1bd),'url':_0x4e92ae['cliPath'],'body':{'target':targetPreview(_0xf1fd0f),'params':_0xf1fd0f['params']},'description':_0x421346(0x1b2)+_0x4e92ae[_0x421346(0x1bf)]};},async 'execute'(_0x12d3b5){const _0x440f0d=_0x407d1d,_0x2d5826=await compilePlan(_0x4e92ae,_0x12d3b5),_0x489c76=Date[_0x440f0d(0x1a9)](),_0x1e864b=await executePlan(_0x2d5826,_0x4e92ae,_0x12d3b5),_0x46876d=Date[_0x440f0d(0x1a9)]()-_0x489c76;return{'ok':!![],'data':{'service':_0x188950[_0x440f0d(0x201)],'command':_0x4e92ae['cliPath'],'target':targetPreview(_0x2d5826),'result':_0x1e864b,'elapsed':_0x46876d},'message':_0x440f0d(0x1e0)+_0x4e92ae[_0x440f0d(0x1bf)]+'\x20completed\x20in\x20'+_0x46876d+'ms'};}};}function a38_0x5865(){const _0x24a998=['commands','\x20\x20MAP\x20TO','nickname','SERVICE_TREE','validation','cliPath','operator','code','dbtableConfig','datatable','read','length','rawFlags','default','\x20\x20\x20\x20datasetCode:\x20','appcode','\x20\x20\x20\x20','datasetCode','\x20\x20\x20\x20scriptName:\x20','nickName','slice','sql','773180aSjsPi','startsWith','flags','\x20\x20\x20\x20command:\x20','data','\x20\x20\x20\x20datatable:\x20','filter','sqlCode','`\x20to\x20inspect\x20the\x20manifest.','env','name','source','const','find','\x20\x20[','tree','Service\x20command\x20','join','226419jjFGJE','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','7183648TyhwGw','required','userName','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','bffCode','fullPath','tableName','Run\x20service\x20command\x20','string','app','bffId','Commands:','1234597NyJoSI','\x20service\x20detail\x20--service\x20','envName','\x20\x20\x20\x20kind:\x20\x20\x20\x20','20pWddsJ','boolean','275060orpQwg','ctx.','appBindings','appCode','padEnd','Cannot\x20resolve\x20datatable\x20\x22','username','remainingArgs','map','risk','\x20requires\x20target.scriptName.','service','mapTo','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','number','Unknown\x20appRef\x20\x22','command','description','\x20<command>\x20[flags]','appRef','employeeId','now','push','Unsupported\x20service\x20target\x20kind:\x20','\x20\x20SERVICE\x20TREE\x20TARGET','974508wLEcuw','Use\x20`','kind','normalizedManifest','args','Preview\x20dynamic\x20service\x20command:\x20','cliName','params','fromEntries','target','2300019wxiszr','trim','scriptName'];a38_0x5865=function(){return _0x24a998;};return a38_0x5865();}function dynamicCommandName(_0x11448c){const _0x174de7=a38_0x5eda;return _0x11448c[_0x174de7(0x1e9)][_0x174de7(0x1ce)](0x1)['join']('\x20');}function riskTag(_0x4baaba){const _0xd68acc=a38_0x5eda;return _0x4baaba==='read'?'':_0xd68acc(0x1de)+_0x4baaba+']';}function flagToCommandFlag(_0x45844f){const _0x595a18=a38_0x5eda;return{'name':_0x45844f[_0x595a18(0x1b3)],'type':_0x45844f['type']==='json'?_0x595a18(0x1ec):_0x45844f['type'],'description':_0x45844f[_0x595a18(0x1a5)]||_0x45844f[_0x595a18(0x1da)],'required':_0x45844f[_0x595a18(0x1e5)],'default':isPrimitiveFlagDefault(_0x45844f['default'])?_0x45844f[_0x595a18(0x1c7)]:undefined,'enum':_0x45844f['enum']};}async function compilePlan(_0x227f8a,_0x2078fa){const _0x442f28=a38_0x5eda;return compileServiceTreeCommand(_0x227f8a,{'flags':_0x2078fa[_0x442f28(0x1c6)],'args':_0x2078fa[_0x442f28(0x1b1)],'context':await buildServiceContext(_0x227f8a,_0x2078fa)});}async function buildServiceContext(_0x582c80,_0x6e2946){const _0xffd908=a38_0x5eda,_0x3c4f8a={'appCode':_0x6e2946[_0xffd908(0x1f9)],'env':_0x6e2946[_0xffd908(0x1f2)],'envName':_0x6e2946[_0xffd908(0x1f2)]};if(!usesRuntimeContext(_0x582c80))return _0x3c4f8a;const _0x41595a=await getLoginUserInfo(),_0xd957ce=pickFirst(_0x41595a['userId'],_0x41595a['id']);return{..._0x3c4f8a,'user':_0x41595a,'userId':_0xd957ce,'id':_0x41595a['id'],'username':pickFirst(_0x41595a[_0xffd908(0x1fc)],_0x41595a[_0xffd908(0x1e6)],_0x41595a['loginName']),'userName':_0x41595a['userName'],'nickname':pickFirst(_0x41595a[_0xffd908(0x1bc)],_0x41595a[_0xffd908(0x1cd)]),'nickName':_0x41595a['nickName'],'tenantCode':_0x41595a['tenantCode'],'employeeId':_0x41595a[_0xffd908(0x1a8)]};}function usesRuntimeContext(_0x4a13db){const _0x1d9d6a=a38_0x5eda;return _0x4a13db['mapTo']['some'](_0x57045b=>typeof _0x57045b[_0x1d9d6a(0x1db)]===_0x1d9d6a(0x1ec)&&(_0x57045b['source'][_0x1d9d6a(0x1d1)]('context.')||_0x57045b[_0x1d9d6a(0x1db)]['startsWith'](_0x1d9d6a(0x1f7))));}function pickFirst(..._0x4f46ce){const _0x539e87=a38_0x5eda;return _0x4f46ce[_0x539e87(0x1dd)](_0x4af6e1=>_0x4af6e1!==undefined&&_0x4af6e1!==null);}async function executePlan(_0xddd744,_0xe5d436,_0x94411a){const _0x31c7b9=a38_0x5eda;if(_0xddd744[_0x31c7b9(0x1af)]===_0x31c7b9(0x1d4)){const _0x372fc7=await resolveDatasetCode(_0xddd744,_0xe5d436,_0x94411a);return executeData(_0x372fc7,_0xddd744['command'],_0xddd744[_0x31c7b9(0x1b4)]);}if(_0xddd744[_0x31c7b9(0x1af)]===_0x31c7b9(0x1cf)){if(!_0xddd744[_0x31c7b9(0x1d7)])throw CliErrors[_0x31c7b9(0x1be)](_0x31c7b9(0x1e0)+_0xe5d436[_0x31c7b9(0x1bf)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0xddd744[_0x31c7b9(0x1d7)],normalizeScalarParams(_0xddd744['params']));}if(_0xddd744[_0x31c7b9(0x1af)]==='bff'){const _0x17ee5b=_0xddd744[_0x31c7b9(0x1b9)]||_0xddd744[_0x31c7b9(0x1e8)]||(_0xddd744[_0x31c7b9(0x1ee)]==null?'':String(_0xddd744[_0x31c7b9(0x1ee)]));if(!_0x17ee5b)throw CliErrors[_0x31c7b9(0x1be)]('Service\x20command\x20'+_0xe5d436[_0x31c7b9(0x1bf)]+_0x31c7b9(0x200));return executeSdkBff(_0x17ee5b,_0xddd744[_0x31c7b9(0x1b4)]);}throw CliErrors['validation'](_0x31c7b9(0x1ab)+_0xddd744['kind']);}async function resolveDatasetCode(_0x56492a,_0x5172a8,_0x5cde17){const _0x32913c=a38_0x5eda;if(_0x56492a[_0x32913c(0x1cb)])return _0x56492a['datasetCode'];if(!_0x56492a[_0x32913c(0x1c3)])throw CliErrors[_0x32913c(0x1be)](_0x32913c(0x1e0)+_0x5172a8['cliPath']+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x58f6f1=await listDatasets(_0x5cde17[_0x32913c(0x1f9)]),_0x537aa6=_0x58f6f1['find'](_0xbdf19c=>_0xbdf19c[_0x32913c(0x1c2)]?.[_0x32913c(0x1ea)]===_0x56492a[_0x32913c(0x1c3)]);if(!_0x537aa6?.[_0x32913c(0x1c1)])throw CliErrors[_0x32913c(0x1be)](_0x32913c(0x1fb)+_0x56492a[_0x32913c(0x1c3)]+_0x32913c(0x203)+_0x5cde17[_0x32913c(0x1f9)]+'.',_0x32913c(0x1e3));return _0x537aa6[_0x32913c(0x1c1)];}function applyAppBinding(_0x3b88d9,_0x5ee405,_0x4ca703){const _0x14be27=a38_0x5eda,_0xfa81fe=_0x5ee405[_0x14be27(0x1b6)][_0x14be27(0x1a7)];if(!_0xfa81fe)return;const _0x58f241=_0x3b88d9[_0x14be27(0x1f8)][_0xfa81fe];if(!_0x58f241)throw CliErrors['validation'](_0x14be27(0x205)+_0xfa81fe+'\x22\x20in\x20service\x20command\x20'+_0x5ee405[_0x14be27(0x1bf)]+'.',_0x14be27(0x1e7));const _0x415de3=_0x58f241['appcode']||_0x58f241[_0x14be27(0x1f9)];_0x415de3&&!hasText(_0x4ca703[_0x14be27(0x1c9)])&&(_0x4ca703[_0x14be27(0x1c9)]=_0x415de3),_0x58f241[_0x14be27(0x1ed)]&&!hasText(_0x4ca703[_0x14be27(0x1ed)])&&!hasText(_0x4ca703[_0x14be27(0x1c9)])&&(_0x4ca703[_0x14be27(0x1ed)]=_0x58f241['app']),_0x58f241[_0x14be27(0x1d9)]&&!hasText(_0x4ca703['env'])&&(_0x4ca703['env']=_0x58f241['env']);}function renderDynamicCommandHelp(_0x4e5ed5){const _0x184e17=a38_0x5eda,_0x1b9f75=[_0x184e17(0x1ac),_0x184e17(0x1f3)+_0x4e5ed5[_0x184e17(0x1b6)][_0x184e17(0x1af)],_0x184e17(0x1d3)+_0x4e5ed5['target']['command']];if(_0x4e5ed5[_0x184e17(0x1b6)]['datasetCode'])_0x1b9f75['push'](_0x184e17(0x1c8)+_0x4e5ed5[_0x184e17(0x1b6)][_0x184e17(0x1cb)]);if(_0x4e5ed5['target'][_0x184e17(0x1c3)])_0x1b9f75['push'](_0x184e17(0x1d5)+_0x4e5ed5[_0x184e17(0x1b6)][_0x184e17(0x1c3)]);if(_0x4e5ed5['target']['sqlCode'])_0x1b9f75[_0x184e17(0x1aa)]('\x20\x20\x20\x20sqlCode:\x20'+_0x4e5ed5['target'][_0x184e17(0x1d7)]);if(_0x4e5ed5[_0x184e17(0x1b6)][_0x184e17(0x1b9)])_0x1b9f75[_0x184e17(0x1aa)](_0x184e17(0x1cc)+_0x4e5ed5['target'][_0x184e17(0x1b9)]);if(_0x4e5ed5[_0x184e17(0x202)]['length']>0x0){_0x1b9f75[_0x184e17(0x1aa)]('',_0x184e17(0x1bb));for(const _0x13e290 of _0x4e5ed5[_0x184e17(0x202)]){_0x1b9f75['push'](_0x184e17(0x1ca)+(_0x13e290['source']||_0x184e17(0x1dc))+'\x20->\x20'+_0x13e290[_0x184e17(0x1b6)]+(_0x13e290[_0x184e17(0x1c0)]?'.'+_0x13e290[_0x184e17(0x1c0)]:''));}}return _0x1b9f75[_0x184e17(0x1e1)]('\x0a');}function targetPreview(_0x183b12){const _0x5e54eb=a38_0x5eda;return{'kind':_0x183b12[_0x5e54eb(0x1af)],'command':_0x183b12[_0x5e54eb(0x206)],'appRef':_0x183b12['appRef'],'datasetCode':_0x183b12[_0x5e54eb(0x1cb)],'datatable':_0x183b12[_0x5e54eb(0x1c3)],'sqlCode':_0x183b12[_0x5e54eb(0x1d7)],'bffCode':_0x183b12[_0x5e54eb(0x1e8)],'bffId':_0x183b12[_0x5e54eb(0x1ee)],'scriptName':_0x183b12[_0x5e54eb(0x1b9)]};}function normalizeScalarParams(_0x1d29c7){const _0x447cab=a38_0x5eda;return Object[_0x447cab(0x1b5)](Object['entries'](_0x1d29c7)[_0x447cab(0x1d6)](([,_0x13796e])=>typeof _0x13796e===_0x447cab(0x1ec)||typeof _0x13796e===_0x447cab(0x204)));}function hasText(_0xff834d){const _0x520895=a38_0x5eda;return typeof _0xff834d===_0x520895(0x1ec)&&_0xff834d[_0x520895(0x1b8)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x9ddc1){const _0x54df84=a38_0x5eda;return _0x9ddc1===undefined||typeof _0x9ddc1===_0x54df84(0x1ec)||typeof _0x9ddc1===_0x54df84(0x204)||typeof _0x9ddc1===_0x54df84(0x1f5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0xad46d8=a39_0x16c7;function a39_0x16c7(_0xe96e22,_0xe881e3){_0xe96e22=_0xe96e22-0x1d7;const _0x273264=a39_0x2732();let _0x16c73c=_0x273264[_0xe96e22];return _0x16c73c;}(function(_0x206b1c,_0x136a73){const _0x6787ac=a39_0x16c7,_0x44d54d=_0x206b1c();while(!![]){try{const _0x3478ed=parseInt(_0x6787ac(0x217))/0x1+-parseInt(_0x6787ac(0x203))/0x2*(parseInt(_0x6787ac(0x1dc))/0x3)+parseInt(_0x6787ac(0x208))/0x4+parseInt(_0x6787ac(0x1ef))/0x5*(parseInt(_0x6787ac(0x213))/0x6)+-parseInt(_0x6787ac(0x1e4))/0x7+parseInt(_0x6787ac(0x20a))/0x8+-parseInt(_0x6787ac(0x1db))/0x9*(parseInt(_0x6787ac(0x211))/0xa);if(_0x3478ed===_0x136a73)break;else _0x44d54d['push'](_0x44d54d['shift']());}catch(_0x4a9fc1){_0x44d54d['push'](_0x44d54d['shift']());}}}(a39_0x2732,0xdce6f));function a39_0x2732(){const _0x35d5cb=['remove','\x20service\x20','\x20service(s).','read','filePath','errors','flags','Local\x20service\x20code,\x20for\x20example\x20crm','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','kind','risk','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','map','file','normalizedManifest','17912YuvQje','Imported\x20','warnings','serviceCode','registry','3050944rqyyFG','description','10690840iJkcaR','cliName','imported','str','service','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','target','180batUay','serviceCount','1997658gbEVQK','registryServiceCode','entry','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','1367482PJXsqI','commands','lower\x20kebab-case\x20service\x20code','type','Imported','registryPath','required','source','report','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','write','770841YsCVmd','342JiOonc','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','detail','list','manifests','entries','version','updated','11646649MkgpCb','string','WRITE','Service\x20registry\x20validation\x20passed.','cliPath','importedAt','hash','\x20service(s),\x20updated\x20','replaced','length','Service\x20manifest\x20validation\x20passed.','25vZtuBo','validate','Exported\x20service\x20','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest'];a39_0x2732=function(){return _0x35d5cb;};return a39_0x2732();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0xad46d8(0x201),'type':a39_0xad46d8(0x1e5),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0xad46d8(0x20e),'type':'string','required':!![],'description':a39_0xad46d8(0x1fb),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0xad46d8(0x219)}};function summarizeService(_0x3f6b76){const _0x372784=a39_0xad46d8;return{'serviceCode':_0x3f6b76[_0x372784(0x206)],'name':_0x3f6b76['normalizedManifest'][_0x372784(0x20e)]['name'],'version':_0x3f6b76[_0x372784(0x1e2)],'importedAt':_0x3f6b76[_0x372784(0x1e9)],'source':_0x3f6b76[_0x372784(0x1d7)],'commandCount':_0x3f6b76['normalizedManifest'][_0x372784(0x218)][_0x372784(0x1ed)],'commands':_0x3f6b76[_0x372784(0x202)][_0x372784(0x218)][_0x372784(0x200)](_0x97ff72=>({'path':_0x97ff72[_0x372784(0x1e8)],'description':_0x97ff72[_0x372784(0x209)],'risk':_0x97ff72[_0x372784(0x1fe)],'target':_0x97ff72[_0x372784(0x210)],'flags':_0x97ff72[_0x372784(0x1fa)][_0x372784(0x200)](_0x289a79=>({'name':_0x289a79['name'],'cliName':_0x289a79[_0x372784(0x20b)],'type':_0x289a79[_0x372784(0x21a)],'required':_0x289a79[_0x372784(0x21d)]===!![]}))}))};}function summarizeLoadedManifest(_0x2e8b33){const _0x30d2d2=a39_0xad46d8;return{'service':_0x2e8b33[_0x30d2d2(0x202)]?.['service'],'version':_0x2e8b33[_0x30d2d2(0x202)]?.['version'],'commandCount':_0x2e8b33[_0x30d2d2(0x202)]?.[_0x30d2d2(0x218)][_0x30d2d2(0x1ed)]??0x0,'commands':_0x2e8b33['normalizedManifest']?.['commands'][_0x30d2d2(0x200)](_0x4580c1=>({'path':_0x4580c1[_0x30d2d2(0x1e8)],'risk':_0x4580c1[_0x30d2d2(0x1fe)],'target':_0x4580c1['target']}))??[],'registryIndex':_0x2e8b33['registryIndex'],'registryServiceCode':_0x2e8b33[_0x30d2d2(0x214)],'errors':_0x2e8b33[_0x30d2d2(0x1d8)][_0x30d2d2(0x1f9)],'warnings':_0x2e8b33[_0x30d2d2(0x1d8)][_0x30d2d2(0x205)]};}export const serviceDefinitions=[{'service':a39_0xad46d8(0x20e),'command':a39_0xad46d8(0x1f0),'description':a39_0xad46d8(0x1f3),'risk':a39_0xad46d8(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x510de1){const _0x4131b1=a39_0xad46d8,_0xe573e=loadServiceManifestFromFile(_0x510de1[_0x4131b1(0x20d)](_0x4131b1(0x201)));if(!_0xe573e[_0x4131b1(0x1d8)]['ok'])return{'ok':![],'data':{'file':_0xe573e['filePath'],'hash':_0xe573e['hash'],'kind':_0xe573e[_0x4131b1(0x1fd)],'serviceCount':_0xe573e[_0x4131b1(0x1e0)][_0x4131b1(0x1ed)],'services':_0xe573e[_0x4131b1(0x1e0)][_0x4131b1(0x200)](summarizeLoadedManifest),'errors':_0xe573e[_0x4131b1(0x1d8)][_0x4131b1(0x1f9)],'warnings':_0xe573e['report'][_0x4131b1(0x205)]},'message':formatValidationFailure(_0xe573e[_0x4131b1(0x1d8)])};if(_0xe573e[_0x4131b1(0x1fd)]===_0x4131b1(0x207)||_0xe573e['manifests'][_0x4131b1(0x1ed)]!==0x1)return{'ok':!![],'data':{'file':_0xe573e['filePath'],'hash':_0xe573e[_0x4131b1(0x1ea)],'kind':_0xe573e[_0x4131b1(0x1fd)],'serviceCount':_0xe573e[_0x4131b1(0x1e0)]['length'],'commandCount':_0xe573e[_0x4131b1(0x1e0)]['reduce']((_0x929786,_0x5a5c52)=>_0x929786+(_0x5a5c52['normalizedManifest']?.[_0x4131b1(0x218)][_0x4131b1(0x1ed)]??0x0),0x0),'services':_0xe573e[_0x4131b1(0x1e0)]['map'](summarizeLoadedManifest),'warnings':_0xe573e['report'][_0x4131b1(0x205)]},'message':_0x4131b1(0x1e7)};return{'ok':!![],'data':{'file':_0xe573e[_0x4131b1(0x1f8)],'hash':_0xe573e[_0x4131b1(0x1ea)],'kind':_0xe573e[_0x4131b1(0x1fd)],'service':_0xe573e[_0x4131b1(0x202)]?.[_0x4131b1(0x20e)],'version':_0xe573e[_0x4131b1(0x202)]?.[_0x4131b1(0x1e2)],'commandCount':_0xe573e['normalizedManifest']?.['commands']['length']??0x0,'commands':_0xe573e[_0x4131b1(0x202)]?.['commands'][_0x4131b1(0x200)](_0x24e2fe=>({'path':_0x24e2fe[_0x4131b1(0x1e8)],'risk':_0x24e2fe[_0x4131b1(0x1fe)],'target':_0x24e2fe[_0x4131b1(0x210)]})),'warnings':_0xe573e['report'][_0x4131b1(0x205)]},'message':_0x4131b1(0x1ee)};}},{'service':a39_0xad46d8(0x20e),'command':'import','description':a39_0xad46d8(0x20f),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1300e4){const _0x361b11=a39_0xad46d8,_0x3f0afb=loadServiceManifestFromFile(_0x1300e4[_0x361b11(0x20d)](_0x361b11(0x201)));return{'method':_0x361b11(0x1e6),'url':getServiceRegistryPath(),'body':{'file':_0x3f0afb[_0x361b11(0x1f8)],'hash':_0x3f0afb[_0x361b11(0x1ea)],'kind':_0x3f0afb['kind'],'ok':_0x3f0afb[_0x361b11(0x1d8)]['ok'],'service':_0x3f0afb[_0x361b11(0x202)]?.[_0x361b11(0x20e)],'version':_0x3f0afb['normalizedManifest']?.[_0x361b11(0x1e2)],'serviceCount':_0x3f0afb[_0x361b11(0x1e0)][_0x361b11(0x1ed)],'services':_0x3f0afb['manifests'][_0x361b11(0x200)](_0x223ff5=>({'service':_0x223ff5[_0x361b11(0x202)]?.[_0x361b11(0x20e)],'version':_0x223ff5['normalizedManifest']?.[_0x361b11(0x1e2)],'commandCount':_0x223ff5[_0x361b11(0x202)]?.[_0x361b11(0x218)][_0x361b11(0x1ed)]??0x0,'errors':_0x223ff5[_0x361b11(0x1d8)][_0x361b11(0x1f9)]})),'errors':_0x3f0afb[_0x361b11(0x1d8)][_0x361b11(0x1f9)],'commandCount':_0x3f0afb[_0x361b11(0x202)]?.[_0x361b11(0x218)]['length']??0x0},'description':_0x361b11(0x216)};},async 'execute'(_0x330fde){const _0x259171=a39_0xad46d8,_0x1ea04f=importServiceManifest(_0x330fde[_0x259171(0x20d)]('file'));if(_0x1ea04f[_0x259171(0x1e1)][_0x259171(0x1ed)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x1ea04f[_0x259171(0x21c)],'imported':_0x1ea04f['imported'],'updated':_0x1ea04f[_0x259171(0x1e3)],'serviceCount':_0x1ea04f[_0x259171(0x212)],'services':_0x1ea04f['entries'][_0x259171(0x200)](summarizeService)},'message':_0x259171(0x204)+_0x1ea04f[_0x259171(0x20c)]+_0x259171(0x1eb)+_0x1ea04f[_0x259171(0x1e3)]+_0x259171(0x1f6)};return{'ok':!![],'data':{'registryPath':_0x1ea04f['registryPath'],'replaced':_0x1ea04f[_0x259171(0x1ec)],'imported':_0x1ea04f['imported'],'updated':_0x1ea04f[_0x259171(0x1e3)],'serviceCount':_0x1ea04f['serviceCount'],'service':summarizeService(_0x1ea04f[_0x259171(0x215)])},'message':(_0x1ea04f[_0x259171(0x1ec)]?'Updated':_0x259171(0x21b))+_0x259171(0x1f5)+_0x1ea04f[_0x259171(0x215)][_0x259171(0x206)]+'.'};}},{'service':a39_0xad46d8(0x20e),'command':'export','description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0xad46d8(0x1da),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x303ed8){const _0x3b43af=a39_0xad46d8,_0x566947=getLocalServiceEntry(_0x303ed8[_0x3b43af(0x20d)](_0x3b43af(0x20e)));return{'method':_0x3b43af(0x1e6),'url':_0x303ed8[_0x3b43af(0x20d)](_0x3b43af(0x201)),'body':{'service':_0x303ed8[_0x3b43af(0x20d)]('service'),'found':Boolean(_0x566947),'version':_0x566947?.[_0x3b43af(0x1e2)],'source':_0x566947?.[_0x3b43af(0x1d7)]},'description':_0x3b43af(0x1dd)};},async 'execute'(_0x49cf52){const _0x3787fa=a39_0xad46d8,_0x3fc48b=exportServiceManifest(_0x49cf52['str']('service'),_0x49cf52[_0x3787fa(0x20d)](_0x3787fa(0x201)));return{'ok':!![],'data':{'registryPath':_0x3fc48b[_0x3787fa(0x21c)],'file':_0x3fc48b[_0x3787fa(0x1f8)],'service':summarizeService(_0x3fc48b[_0x3787fa(0x215)])},'message':_0x3787fa(0x1f1)+_0x3fc48b[_0x3787fa(0x215)][_0x3787fa(0x206)]+'.'};}},{'service':a39_0xad46d8(0x20e),'command':a39_0xad46d8(0x1df),'description':a39_0xad46d8(0x1d9),'risk':a39_0xad46d8(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x2e19fd=a39_0xad46d8,_0x59b05e=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x59b05e[_0x2e19fd(0x1ed)],'services':_0x59b05e[_0x2e19fd(0x200)](summarizeService)}};}},{'service':a39_0xad46d8(0x20e),'command':a39_0xad46d8(0x1f4),'description':a39_0xad46d8(0x1f2),'risk':a39_0xad46d8(0x1da),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x29f6cb){const _0x447a4a=a39_0xad46d8,_0x7b4a63=getLocalServiceEntry(_0x29f6cb[_0x447a4a(0x20d)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x29f6cb['str'](_0x447a4a(0x20e)),'found':Boolean(_0x7b4a63),'version':_0x7b4a63?.[_0x447a4a(0x1e2)],'source':_0x7b4a63?.[_0x447a4a(0x1d7)]},'description':_0x447a4a(0x1fc)};},async 'execute'(_0x4bf4a9){const _0x3c0abb=a39_0xad46d8,_0x4b3835=removeServiceManifest(_0x4bf4a9[_0x3c0abb(0x20d)](_0x3c0abb(0x20e)));return{'ok':!![],'data':{'registryPath':_0x4b3835[_0x3c0abb(0x21c)],'serviceCount':_0x4b3835[_0x3c0abb(0x212)],'service':summarizeService(_0x4b3835[_0x3c0abb(0x215)])},'message':'Removed\x20service\x20'+_0x4b3835[_0x3c0abb(0x215)][_0x3c0abb(0x206)]+'.'};}},{'service':a39_0xad46d8(0x20e),'command':a39_0xad46d8(0x1de),'description':a39_0xad46d8(0x1ff),'risk':a39_0xad46d8(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x35db8c){const _0x22d311=a39_0xad46d8,_0x2ae042=getLocalServiceEntry(_0x35db8c[_0x22d311(0x20d)](_0x22d311(0x20e)));if(!_0x2ae042)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x35db8c[_0x22d311(0x20d)](_0x22d311(0x20e))},'message':'Local\x20service\x20not\x20found:\x20'+_0x35db8c[_0x22d311(0x20d)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2ae042),'manifest':_0x2ae042['manifest'],'normalizedManifest':_0x2ae042[_0x22d311(0x202)]}};}}];
|
|
1
|
+
function a39_0x25a9(){const _0x1ea1e3=['registryIndex','target','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','223911MQOCmO','421388OpNcaw','errors','read','4ivMRri','write','registry','152bRFHPj','\x20service(s).','1963731VgHtYZ','cliName','entries','updated','reduce','source','import','Updated','description','Local\x20service\x20not\x20found:\x20','normalizedManifest','serviceCode','Service\x20manifest\x20validation\x20passed.','manifest','1698798ioMDOF','58070bgjEyS','1177284vAsDTg','hash','4367TMmHKn','\x20service(s),\x20updated\x20','WRITE','name','cliPath','manifests','kind','entry','detail','map','remove','Imported\x20','validate','Exported\x20service\x20','lower\x20kebab-case\x20service\x20code','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','version','342780dvRuMh','file','export','required','Service\x20Tree\x20manifest\x20file\x20path','type','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','replaced','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','str','registryPath','imported','length','Imported','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','string','service','report','5mKKRIe','filePath','commands','serviceCount','flags','warnings','risk','Local\x20service\x20code,\x20for\x20example\x20crm'];a39_0x25a9=function(){return _0x1ea1e3;};return a39_0x25a9();}const a39_0x4e6adb=a39_0xa392;(function(_0x33f029,_0x260842){const _0x4f80a2=a39_0xa392,_0x3bb970=_0x33f029();while(!![]){try{const _0xd5f771=-parseInt(_0x4f80a2(0x180))/0x1+-parseInt(_0x4f80a2(0x162))/0x2+-parseInt(_0x4f80a2(0x14f))/0x3*(parseInt(_0x4f80a2(0x183))/0x4)+parseInt(_0x4f80a2(0x174))/0x5*(-parseInt(_0x4f80a2(0x14d))/0x6)+-parseInt(_0x4f80a2(0x188))/0x7+parseInt(_0x4f80a2(0x186))/0x8*(-parseInt(_0x4f80a2(0x17f))/0x9)+-parseInt(_0x4f80a2(0x14e))/0xa*(-parseInt(_0x4f80a2(0x151))/0xb);if(_0xd5f771===_0x260842)break;else _0x3bb970['push'](_0x3bb970['shift']());}catch(_0x188f0e){_0x3bb970['push'](_0x3bb970['shift']());}}}(a39_0x25a9,0x4549e));function a39_0xa392(_0x1f05e9,_0x49319e){_0x1f05e9=_0x1f05e9-0x144;const _0x25a97d=a39_0x25a9();let _0xa39263=_0x25a97d[_0x1f05e9];return _0xa39263;}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x4e6adb(0x163),'type':a39_0x4e6adb(0x171),'required':!![],'description':a39_0x4e6adb(0x166)},SERVICE_FLAG={'name':a39_0x4e6adb(0x172),'type':a39_0x4e6adb(0x171),'required':!![],'description':a39_0x4e6adb(0x17b),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x4e6adb(0x15f)}};function summarizeService(_0x56e653){const _0xcca6e6=a39_0x4e6adb;return{'serviceCode':_0x56e653[_0xcca6e6(0x14a)],'name':_0x56e653[_0xcca6e6(0x149)][_0xcca6e6(0x172)][_0xcca6e6(0x154)],'version':_0x56e653[_0xcca6e6(0x161)],'importedAt':_0x56e653['importedAt'],'source':_0x56e653[_0xcca6e6(0x144)],'commandCount':_0x56e653['normalizedManifest'][_0xcca6e6(0x176)][_0xcca6e6(0x16e)],'commands':_0x56e653[_0xcca6e6(0x149)]['commands'][_0xcca6e6(0x15a)](_0x1bcd0a=>({'path':_0x1bcd0a[_0xcca6e6(0x155)],'description':_0x1bcd0a[_0xcca6e6(0x147)],'risk':_0x1bcd0a[_0xcca6e6(0x17a)],'target':_0x1bcd0a[_0xcca6e6(0x17d)],'flags':_0x1bcd0a[_0xcca6e6(0x178)]['map'](_0x3ea0c5=>({'name':_0x3ea0c5[_0xcca6e6(0x154)],'cliName':_0x3ea0c5[_0xcca6e6(0x189)],'type':_0x3ea0c5[_0xcca6e6(0x167)],'required':_0x3ea0c5[_0xcca6e6(0x165)]===!![]}))}))};}function summarizeLoadedManifest(_0x37701e){const _0x5d653c=a39_0x4e6adb;return{'service':_0x37701e['normalizedManifest']?.[_0x5d653c(0x172)],'version':_0x37701e['normalizedManifest']?.['version'],'commandCount':_0x37701e[_0x5d653c(0x149)]?.[_0x5d653c(0x176)][_0x5d653c(0x16e)]??0x0,'commands':_0x37701e[_0x5d653c(0x149)]?.[_0x5d653c(0x176)][_0x5d653c(0x15a)](_0x2f2312=>({'path':_0x2f2312['cliPath'],'risk':_0x2f2312[_0x5d653c(0x17a)],'target':_0x2f2312[_0x5d653c(0x17d)]}))??[],'registryIndex':_0x37701e[_0x5d653c(0x17c)],'registryServiceCode':_0x37701e['registryServiceCode'],'errors':_0x37701e[_0x5d653c(0x173)][_0x5d653c(0x181)],'warnings':_0x37701e[_0x5d653c(0x173)][_0x5d653c(0x179)]};}export const serviceDefinitions=[{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x15d),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a39_0x4e6adb(0x182),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4e4959){const _0x7d6c8c=a39_0x4e6adb,_0x42eb2c=loadServiceManifestFromFile(_0x4e4959[_0x7d6c8c(0x16b)](_0x7d6c8c(0x163)));if(!_0x42eb2c[_0x7d6c8c(0x173)]['ok'])return{'ok':![],'data':{'file':_0x42eb2c[_0x7d6c8c(0x175)],'hash':_0x42eb2c[_0x7d6c8c(0x150)],'kind':_0x42eb2c[_0x7d6c8c(0x157)],'serviceCount':_0x42eb2c[_0x7d6c8c(0x156)][_0x7d6c8c(0x16e)],'services':_0x42eb2c[_0x7d6c8c(0x156)]['map'](summarizeLoadedManifest),'errors':_0x42eb2c[_0x7d6c8c(0x173)][_0x7d6c8c(0x181)],'warnings':_0x42eb2c[_0x7d6c8c(0x173)]['warnings']},'message':formatValidationFailure(_0x42eb2c[_0x7d6c8c(0x173)])};if(_0x42eb2c[_0x7d6c8c(0x157)]===_0x7d6c8c(0x185)||_0x42eb2c['manifests'][_0x7d6c8c(0x16e)]!==0x1)return{'ok':!![],'data':{'file':_0x42eb2c['filePath'],'hash':_0x42eb2c[_0x7d6c8c(0x150)],'kind':_0x42eb2c[_0x7d6c8c(0x157)],'serviceCount':_0x42eb2c['manifests'][_0x7d6c8c(0x16e)],'commandCount':_0x42eb2c[_0x7d6c8c(0x156)][_0x7d6c8c(0x18c)]((_0x76490c,_0x3a4833)=>_0x76490c+(_0x3a4833[_0x7d6c8c(0x149)]?.[_0x7d6c8c(0x176)][_0x7d6c8c(0x16e)]??0x0),0x0),'services':_0x42eb2c[_0x7d6c8c(0x156)][_0x7d6c8c(0x15a)](summarizeLoadedManifest),'warnings':_0x42eb2c['report']['warnings']},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x42eb2c[_0x7d6c8c(0x175)],'hash':_0x42eb2c[_0x7d6c8c(0x150)],'kind':_0x42eb2c[_0x7d6c8c(0x157)],'service':_0x42eb2c[_0x7d6c8c(0x149)]?.[_0x7d6c8c(0x172)],'version':_0x42eb2c['normalizedManifest']?.[_0x7d6c8c(0x161)],'commandCount':_0x42eb2c['normalizedManifest']?.[_0x7d6c8c(0x176)]['length']??0x0,'commands':_0x42eb2c[_0x7d6c8c(0x149)]?.['commands']['map'](_0xd3e86e=>({'path':_0xd3e86e[_0x7d6c8c(0x155)],'risk':_0xd3e86e['risk'],'target':_0xd3e86e[_0x7d6c8c(0x17d)]})),'warnings':_0x42eb2c[_0x7d6c8c(0x173)]['warnings']},'message':_0x7d6c8c(0x14b)};}},{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x145),'description':a39_0x4e6adb(0x16a),'risk':a39_0x4e6adb(0x184),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x3a2fd0){const _0x5c6190=a39_0x4e6adb,_0x2a30bc=loadServiceManifestFromFile(_0x3a2fd0[_0x5c6190(0x16b)]('file'));return{'method':_0x5c6190(0x153),'url':getServiceRegistryPath(),'body':{'file':_0x2a30bc[_0x5c6190(0x175)],'hash':_0x2a30bc[_0x5c6190(0x150)],'kind':_0x2a30bc['kind'],'ok':_0x2a30bc[_0x5c6190(0x173)]['ok'],'service':_0x2a30bc[_0x5c6190(0x149)]?.[_0x5c6190(0x172)],'version':_0x2a30bc['normalizedManifest']?.[_0x5c6190(0x161)],'serviceCount':_0x2a30bc['manifests'][_0x5c6190(0x16e)],'services':_0x2a30bc[_0x5c6190(0x156)][_0x5c6190(0x15a)](_0x25c79d=>({'service':_0x25c79d[_0x5c6190(0x149)]?.[_0x5c6190(0x172)],'version':_0x25c79d['normalizedManifest']?.['version'],'commandCount':_0x25c79d[_0x5c6190(0x149)]?.[_0x5c6190(0x176)]['length']??0x0,'errors':_0x25c79d[_0x5c6190(0x173)][_0x5c6190(0x181)]})),'errors':_0x2a30bc[_0x5c6190(0x173)][_0x5c6190(0x181)],'commandCount':_0x2a30bc['normalizedManifest']?.[_0x5c6190(0x176)][_0x5c6190(0x16e)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x3ad533){const _0x2824c8=a39_0x4e6adb,_0x2927ec=importServiceManifest(_0x3ad533['str'](_0x2824c8(0x163)));if(_0x2927ec[_0x2824c8(0x18a)][_0x2824c8(0x16e)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x2927ec[_0x2824c8(0x16c)],'imported':_0x2927ec[_0x2824c8(0x16d)],'updated':_0x2927ec['updated'],'serviceCount':_0x2927ec['serviceCount'],'services':_0x2927ec[_0x2824c8(0x18a)]['map'](summarizeService)},'message':_0x2824c8(0x15c)+_0x2927ec[_0x2824c8(0x16d)]+_0x2824c8(0x152)+_0x2927ec[_0x2824c8(0x18b)]+_0x2824c8(0x187)};return{'ok':!![],'data':{'registryPath':_0x2927ec[_0x2824c8(0x16c)],'replaced':_0x2927ec[_0x2824c8(0x169)],'imported':_0x2927ec['imported'],'updated':_0x2927ec[_0x2824c8(0x18b)],'serviceCount':_0x2927ec[_0x2824c8(0x177)],'service':summarizeService(_0x2927ec['entry'])},'message':(_0x2927ec[_0x2824c8(0x169)]?_0x2824c8(0x146):_0x2824c8(0x16f))+'\x20service\x20'+_0x2927ec['entry'][_0x2824c8(0x14a)]+'.'};}},{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x164),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0x4e6adb(0x184),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x2e4268){const _0x252626=a39_0x4e6adb,_0x1af9cf=getLocalServiceEntry(_0x2e4268[_0x252626(0x16b)](_0x252626(0x172)));return{'method':_0x252626(0x153),'url':_0x2e4268[_0x252626(0x16b)]('file'),'body':{'service':_0x2e4268['str']('service'),'found':Boolean(_0x1af9cf),'version':_0x1af9cf?.[_0x252626(0x161)],'source':_0x1af9cf?.[_0x252626(0x144)]},'description':_0x252626(0x168)};},async 'execute'(_0x592446){const _0x43d6e3=a39_0x4e6adb,_0x419c8a=exportServiceManifest(_0x592446[_0x43d6e3(0x16b)](_0x43d6e3(0x172)),_0x592446[_0x43d6e3(0x16b)]('file'));return{'ok':!![],'data':{'registryPath':_0x419c8a[_0x43d6e3(0x16c)],'file':_0x419c8a[_0x43d6e3(0x175)],'service':summarizeService(_0x419c8a[_0x43d6e3(0x158)])},'message':_0x43d6e3(0x15e)+_0x419c8a['entry']['serviceCode']+'.'};}},{'service':'service','command':'list','description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a39_0x4e6adb(0x182),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x1614ef=a39_0x4e6adb,_0x9e788b=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x9e788b[_0x1614ef(0x16e)],'services':_0x9e788b[_0x1614ef(0x15a)](summarizeService)}};}},{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x15b),'description':a39_0x4e6adb(0x17e),'risk':a39_0x4e6adb(0x184),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x4e2145){const _0x3f3369=a39_0x4e6adb,_0x2775d1=getLocalServiceEntry(_0x4e2145['str'](_0x3f3369(0x172)));return{'method':_0x3f3369(0x153),'url':getServiceRegistryPath(),'body':{'service':_0x4e2145[_0x3f3369(0x16b)]('service'),'found':Boolean(_0x2775d1),'version':_0x2775d1?.[_0x3f3369(0x161)],'source':_0x2775d1?.[_0x3f3369(0x144)]},'description':_0x3f3369(0x160)};},async 'execute'(_0x1915a2){const _0x3fcd3b=a39_0x4e6adb,_0x3f9663=removeServiceManifest(_0x1915a2[_0x3fcd3b(0x16b)](_0x3fcd3b(0x172)));return{'ok':!![],'data':{'registryPath':_0x3f9663[_0x3fcd3b(0x16c)],'serviceCount':_0x3f9663[_0x3fcd3b(0x177)],'service':summarizeService(_0x3f9663['entry'])},'message':'Removed\x20service\x20'+_0x3f9663[_0x3fcd3b(0x158)][_0x3fcd3b(0x14a)]+'.'};}},{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x159),'description':a39_0x4e6adb(0x170),'risk':a39_0x4e6adb(0x182),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x557503){const _0x555604=a39_0x4e6adb,_0x11a90a=getLocalServiceEntry(_0x557503['str'](_0x555604(0x172)));if(!_0x11a90a)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x557503[_0x555604(0x16b)](_0x555604(0x172))},'message':_0x555604(0x148)+_0x557503[_0x555604(0x16b)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x11a90a),'manifest':_0x11a90a[_0x555604(0x14c)],'normalizedManifest':_0x11a90a[_0x555604(0x149)]}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x168e26=a40_0x2f9a;(function(_0xeba417,_0x3816f8){const _0x2d14a8=a40_0x2f9a,_0x30f464=_0xeba417();while(!![]){try{const _0x583ca8=-parseInt(_0x2d14a8(0xa5))/0x1*(parseInt(_0x2d14a8(0x96))/0x2)+parseInt(_0x2d14a8(0xcb))/0x3+parseInt(_0x2d14a8(0x9d))/0x4+parseInt(_0x2d14a8(0xc1))/0x5+-parseInt(_0x2d14a8(0xbc))/0x6*(-parseInt(_0x2d14a8(0xd0))/0x7)+-parseInt(_0x2d14a8(0x94))/0x8+-parseInt(_0x2d14a8(0xc5))/0x9;if(_0x583ca8===_0x3816f8)break;else _0x30f464['push'](_0x30f464['shift']());}catch(_0x123548){_0x30f464['push'](_0x30f464['shift']());}}}(a40_0x8957,0xef465));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';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a40_0x168e26(0xd7);export function getServiceRegistryPath(_0x53c535={}){const _0x478193=a40_0x168e26;return resolve(_0x53c535['homeDir']??homedir(),PRODUCT_CONFIG[_0x478193(0xaf)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0xca7fba={}){const _0x44ad03=a40_0x168e26,_0xaef048=getServiceRegistryPath(_0xca7fba);if(!existsSync(_0xaef048))return emptyServiceRegistry();try{const _0x50a109=readFileSync(_0xaef048,_0x44ad03(0xbe));if(!_0x50a109[_0x44ad03(0xa8)]())return emptyServiceRegistry();const _0x263021=JSON[_0x44ad03(0xc0)](_0x50a109);if(_0x263021['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x44ad03(0x97)](_0x44ad03(0x9a)+String(_0x263021[_0x44ad03(0xc6)]),_0x44ad03(0xb2)+_0xaef048+'.');if(!Array[_0x44ad03(0x99)](_0x263021[_0x44ad03(0xc2)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x263021[_0x44ad03(0x9e)],'services':_0x263021[_0x44ad03(0xc2)]};}catch(_0xd95265){if(_0xd95265 instanceof Error&&_0xd95265[_0x44ad03(0xb6)]===_0x44ad03(0xdd))throw _0xd95265;throw CliErrors[_0x44ad03(0x97)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0xaef048,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x5eca94,_0x1f25c0={}){const _0x34116d=a40_0x168e26,_0x281e2d=getServiceRegistryPath(_0x1f25c0),_0xf6f0bf=dirname(_0x281e2d);!existsSync(_0xf6f0bf)&&mkdirSync(_0xf6f0bf,{'recursive':!![]});const _0x5cf886=_0x281e2d+_0x34116d(0xbd);try{writeFileSync(_0x5cf886,JSON[_0x34116d(0xe0)](_0x5eca94,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x5cf886,_0x281e2d);}catch(_0x257693){try{unlinkSync(_0x5cf886);}catch{}if(_0x257693?.[_0x34116d(0xaa)]===_0x34116d(0xae))throw CliErrors[_0x34116d(0x97)](_0x34116d(0xcc)+_0x281e2d);throw _0x257693;}return _0x281e2d;}export function loadServiceManifestFromFile(_0x3245d1){const _0x147035=a40_0x168e26,_0x14e138=resolve(_0x3245d1);if(!existsSync(_0x14e138))throw CliErrors[_0x147035(0x97)](_0x147035(0xda)+_0x3245d1);let _0x3d6f03;const _0x18a949=readFileSync(_0x14e138,_0x147035(0xbe));try{_0x3d6f03=JSON['parse'](_0x18a949);}catch{throw CliErrors['validation'](_0x147035(0xa4)+_0x3245d1,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x3def34=sha256(_0x18a949),_0x3be2f0=extractLoadedServiceManifests(_0x3d6f03,_0x3def34),_0x295952=aggregateValidationReports(_0x3be2f0),_0x240173=_0x3be2f0[0x0];return{'filePath':_0x14e138,'hash':_0x3def34,'kind':isServiceRegistryLike(_0x3d6f03)?'registry':'manifest','manifest':_0x240173?.[_0x147035(0xac)]??_0x3d6f03,'report':_0x295952,'normalizedManifest':_0x3be2f0[_0x147035(0xdf)]===0x1?_0x240173?.[_0x147035(0xb1)]:undefined,'manifests':_0x3be2f0};}export function importServiceManifest(_0xe0631b,_0x3fa173={}){const _0x544ddd=a40_0x168e26,_0x2be234=loadServiceManifestFromFile(_0xe0631b);if(!_0x2be234['report']['ok'])throw CliErrors[_0x544ddd(0x97)](formatValidationFailure(_0x2be234[_0x544ddd(0xd8)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x2be234[_0x544ddd(0xe3)]['length']===0x0)throw CliErrors[_0x544ddd(0x97)](_0x544ddd(0xc4),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x4132b2=readServiceRegistry(_0x3fa173),_0xd83ff2=(_0x3fa173[_0x544ddd(0x9b)]??(()=>new Date()))()['toISOString'](),_0x49d1a1=[];let _0x291d82=0x0,_0x530a51=0x0;for(const _0x5f2960 of _0x2be234[_0x544ddd(0xe3)]){if(!_0x5f2960[_0x544ddd(0xb1)])continue;const _0x1db22e=_0x5f2960[_0x544ddd(0xb1)][_0x544ddd(0xb7)][_0x544ddd(0xaa)],_0x52c9be={'serviceCode':_0x1db22e,'version':_0x5f2960[_0x544ddd(0xb1)][_0x544ddd(0xcd)],'importedAt':_0xd83ff2,'source':{'type':_0x544ddd(0xd3),'path':_0x2be234[_0x544ddd(0xc8)],'hash':_0x5f2960[_0x544ddd(0xb4)]},'manifest':_0x5f2960[_0x544ddd(0xac)],'normalizedManifest':_0x5f2960[_0x544ddd(0xb1)]},_0x3cde35=_0x4132b2['services']['findIndex'](_0x2d6acf=>_0x2d6acf[_0x544ddd(0xd1)]===_0x1db22e);_0x3cde35>=0x0?(_0x4132b2[_0x544ddd(0xc2)][_0x3cde35]=_0x52c9be,_0x530a51++):(_0x4132b2[_0x544ddd(0xc2)]['push'](_0x52c9be),_0x291d82++),_0x49d1a1[_0x544ddd(0xa3)](_0x52c9be);}_0x4132b2[_0x544ddd(0xc2)][_0x544ddd(0xa2)]((_0x2cf371,_0x34a804)=>_0x2cf371[_0x544ddd(0xd1)][_0x544ddd(0xce)](_0x34a804[_0x544ddd(0xd1)])),_0x4132b2[_0x544ddd(0x9e)]=_0xd83ff2;const _0x134ada=writeServiceRegistry(_0x4132b2,_0x3fa173);return{'registryPath':_0x134ada,'entry':_0x49d1a1[0x0],'replaced':_0x49d1a1['length']===0x1?_0x530a51===0x1:_0x530a51>0x0,'entries':_0x49d1a1,'imported':_0x291d82,'updated':_0x530a51,'serviceCount':_0x4132b2['services'][_0x544ddd(0xdf)]};}export function exportServiceManifest(_0x4c2775,_0x3cad10,_0x58d2d5={}){const _0x211c16=a40_0x168e26,_0x7b4f62=getServiceRegistryPath(_0x58d2d5),_0x1589cc=getLocalServiceEntry(_0x4c2775,_0x58d2d5);if(!_0x1589cc)throw CliErrors[_0x211c16(0x97)]('Local\x20service\x20not\x20found:\x20'+_0x4c2775,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x5aeeb1=resolve(_0x3cad10),_0x141862=dirname(_0x5aeeb1);return!existsSync(_0x141862)&&mkdirSync(_0x141862,{'recursive':!![]}),writeFileSync(_0x5aeeb1,JSON[_0x211c16(0xe0)](_0x1589cc[_0x211c16(0xac)],null,0x2)+'\x0a',{'encoding':_0x211c16(0xbe),'mode':0x180}),{'registryPath':_0x7b4f62,'filePath':_0x5aeeb1,'entry':_0x1589cc};}export function removeServiceManifest(_0x155494,_0x48365f={}){const _0x57be8d=a40_0x168e26,_0x3443c9=readServiceRegistry(_0x48365f),_0x53e979=_0x155494[_0x57be8d(0xa8)](),_0x376850=_0x3443c9[_0x57be8d(0xc2)][_0x57be8d(0xa9)](_0x2a303d=>_0x2a303d['serviceCode']===_0x53e979);if(_0x376850<0x0)throw CliErrors[_0x57be8d(0x97)](_0x57be8d(0xe1)+_0x53e979,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x4452d6]=_0x3443c9[_0x57be8d(0xc2)][_0x57be8d(0xcf)](_0x376850,0x1),_0x3889db=(_0x48365f[_0x57be8d(0x9b)]??(()=>new Date()))()[_0x57be8d(0x9c)]();_0x3443c9['updatedAt']=_0x3889db;const _0x57fbd1=writeServiceRegistry(_0x3443c9,_0x48365f);return{'registryPath':_0x57fbd1,'entry':_0x4452d6,'serviceCount':_0x3443c9['services']['length']};}export function listLocalServices(_0x496f50={}){const _0x284058=a40_0x168e26;return readServiceRegistry(_0x496f50)[_0x284058(0xc2)];}export function getLocalServiceEntry(_0x1efe68,_0x51dbbe={}){const _0x2146c6=a40_0x168e26;return readServiceRegistry(_0x51dbbe)['services'][_0x2146c6(0xba)](_0x2431a3=>_0x2431a3['serviceCode']===_0x1efe68['trim']());}export function listLocalServiceTrees(_0x137203={}){const _0x8860bf=a40_0x168e26;return readServiceRegistry(_0x137203)['services'][_0x8860bf(0xb9)](_0xa8abed=>_0xa8abed[_0x8860bf(0xb1)]);}export function inspectServiceRegistry(_0x786b53={}){const _0x320e6e=a40_0x168e26,_0x54ec8a=getServiceRegistryPath(_0x786b53);if(!existsSync(_0x54ec8a))return emptyServiceRegistryInspection(_0x54ec8a,_0x320e6e(0xb0),![]);try{const _0x76d1e=readFileSync(_0x54ec8a,_0x320e6e(0xbe));if(!_0x76d1e[_0x320e6e(0xa8)]())return emptyServiceRegistryInspection(_0x54ec8a,'empty',!![]);const _0x2314e7=JSON[_0x320e6e(0xc0)](_0x76d1e);if(_0x2314e7[_0x320e6e(0xc6)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x54ec8a,'invalid',!![]),'schemaVersion':_0x2314e7[_0x320e6e(0xc6)],'message':_0x320e6e(0xdb)+String(_0x2314e7[_0x320e6e(0xc6)])};if(!Array[_0x320e6e(0x99)](_0x2314e7[_0x320e6e(0xc2)]))return{...emptyServiceRegistryInspection(_0x54ec8a,_0x320e6e(0xc9),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2314e7['updatedAt'],'message':_0x320e6e(0xbb)};const _0x3bddc5=_0x2314e7[_0x320e6e(0xc2)][_0x320e6e(0xb9)](summarizeLocalServiceEntry);return{'registryPath':_0x54ec8a,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2314e7[_0x320e6e(0x9e)],'serviceCount':_0x3bddc5['length'],'commandCount':_0x3bddc5[_0x320e6e(0xa6)]((_0x38f3b0,_0x119665)=>_0x38f3b0+_0x119665[_0x320e6e(0xc3)],0x0),'services':_0x3bddc5};}catch(_0x5e56fd){return{...emptyServiceRegistryInspection(_0x54ec8a,_0x320e6e(0xc9),!![]),'message':_0x5e56fd instanceof Error?_0x5e56fd[_0x320e6e(0xb8)]:String(_0x5e56fd)};}}function a40_0x8957(){const _0x720760=['382817llDFdN','reduce','digest','trim','findIndex','code','registryIndex','manifest','join','ENOENT','homeDirName','missing','normalizedManifest','Remove\x20or\x20migrate\x20','description','sourceHash','sha256','name','service','message','map','find','services\x20must\x20be\x20an\x20array','6TYOPsW','.tmp','utf8','hex','parse','1459730sHBsZn','services','commandCount','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','3897018qtsIxL','schemaVersion','errors','filePath','invalid','path','3311466yIABuv','Cannot\x20write\x20service\x20registry:\x20','version','localeCompare','splice','2027235JFnZgq','serviceCode','flatMap','file','].manifest','target','commands','service.json','report','risk','Service\x20manifest\x20file\x20not\x20found:\x20','Unsupported\x20schemaVersion:\x20','startsWith','CliError','cliPath','length','stringify','Local\x20service\x20not\x20found:\x20','kind','manifests','12322632sYaKik','command','2uKOMUa','validation','importedAt','isArray','Unsupported\x20service\x20registry\x20schemaVersion:\x20','now','toISOString','6603376LpcTyh','updatedAt','slice','warnings','$.services[','sort','push','Invalid\x20service\x20manifest\x20JSON:\x20'];a40_0x8957=function(){return _0x720760;};return a40_0x8957();}export function formatValidationFailure(_0x157bc5){const _0x560feb=a40_0x168e26,_0x34b612=_0x157bc5[_0x560feb(0xc7)][_0x560feb(0xb9)](_0x38ef96=>_0x38ef96[_0x560feb(0xca)]+':\x20'+_0x38ef96[_0x560feb(0xb8)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x34b612[_0x560feb(0xad)]('\x0a');}function extractLoadedServiceManifests(_0x3ee69a,_0x386701){const _0x164dd3=a40_0x168e26;if(!isServiceRegistryLike(_0x3ee69a)){const _0xe7b997=_0x3ee69a,_0x5305a7=validateServiceTreeManifest(_0xe7b997);return[{'manifest':_0xe7b997,'report':_0x5305a7,'normalizedManifest':_0x5305a7['ok']?normalizeServiceTreeManifest(_0xe7b997):undefined,'sourceHash':_0x386701}];}return _0x3ee69a[_0x164dd3(0xc2)]['map']((_0x3fa20c,_0x2323c1)=>{const _0x3d412e=_0x164dd3,_0x2b9b42=isObjectRecord(_0x3fa20c)?_0x3fa20c[_0x3d412e(0xac)]:undefined,_0x3b3305=validateServiceTreeManifest(_0x2b9b42),_0x3ef251=isObjectRecord(_0x3fa20c)&&typeof _0x3fa20c[_0x3d412e(0xd1)]==='string'?_0x3fa20c[_0x3d412e(0xd1)]:undefined;return{'manifest':_0x2b9b42,'report':_0x3b3305,'normalizedManifest':_0x3b3305['ok']?normalizeServiceTreeManifest(_0x2b9b42):undefined,'sourceHash':sha256(JSON['stringify'](_0x2b9b42,null,0x2)+'\x0a'),'registryIndex':_0x2323c1,'registryServiceCode':_0x3ef251};});}function aggregateValidationReports(_0x282d26){const _0x1ca4bb=a40_0x168e26,_0x3965d3=_0x282d26[_0x1ca4bb(0xd2)](_0x4c5431=>_0x4c5431[_0x1ca4bb(0xab)]===undefined?_0x4c5431[_0x1ca4bb(0xd8)]['errors']:_0x4c5431[_0x1ca4bb(0xd8)]['errors'][_0x1ca4bb(0xb9)](_0x5a10aa=>({..._0x5a10aa,'path':prefixRegistryIssuePath(_0x4c5431[_0x1ca4bb(0xab)],_0x5a10aa['path'])}))),_0x255b05=_0x282d26[_0x1ca4bb(0xd2)](_0x4e0d3e=>_0x4e0d3e[_0x1ca4bb(0xab)]===undefined?_0x4e0d3e[_0x1ca4bb(0xd8)][_0x1ca4bb(0xa0)]:_0x4e0d3e[_0x1ca4bb(0xd8)][_0x1ca4bb(0xa0)]['map'](_0x4b3c51=>({..._0x4b3c51,'path':prefixRegistryIssuePath(_0x4e0d3e[_0x1ca4bb(0xab)],_0x4b3c51['path'])})));return{'ok':_0x3965d3['length']===0x0,'errors':_0x3965d3,'warnings':_0x255b05};}function prefixRegistryIssuePath(_0x4c4199,_0x2e883a){const _0x43c4e7=a40_0x168e26;if(_0x2e883a==='$')return'$.services['+_0x4c4199+_0x43c4e7(0xd4);if(_0x2e883a[_0x43c4e7(0xdc)]('$.'))return _0x43c4e7(0xa1)+_0x4c4199+_0x43c4e7(0xd4)+_0x2e883a['slice'](0x1);if(_0x2e883a[_0x43c4e7(0xdc)]('$['))return _0x43c4e7(0xa1)+_0x4c4199+_0x43c4e7(0xd4)+_0x2e883a[_0x43c4e7(0x9f)](0x1);return'$.services['+_0x4c4199+'].manifest.'+_0x2e883a;}function isServiceRegistryLike(_0x3e2e84){const _0x1b096c=a40_0x168e26;return isObjectRecord(_0x3e2e84)&&_0x3e2e84[_0x1b096c(0xc6)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x1b096c(0x99)](_0x3e2e84[_0x1b096c(0xc2)]);}function isObjectRecord(_0x3fc740){const _0x3cb47d=a40_0x168e26;return Boolean(_0x3fc740)&&typeof _0x3fc740==='object'&&!Array[_0x3cb47d(0x99)](_0x3fc740);}function emptyServiceRegistryInspection(_0x530733,_0x584bed,_0x3ce8d1){return{'registryPath':_0x530733,'exists':_0x3ce8d1,'status':_0x584bed,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0xd043f8){const _0x3faac3=a40_0x168e26,_0x45feb1=_0xd043f8[_0x3faac3(0xb1)],_0x35c688=_0x45feb1[_0x3faac3(0xd6)][_0x3faac3(0xb9)](_0x23aa14=>({'path':_0x23aa14[_0x3faac3(0xde)],'description':_0x23aa14['description'],'risk':_0x23aa14[_0x3faac3(0xd9)],'targetKind':_0x23aa14[_0x3faac3(0xd5)][_0x3faac3(0xe2)],'targetCommand':_0x23aa14[_0x3faac3(0xd5)][_0x3faac3(0x95)]}));return{'serviceCode':_0xd043f8[_0x3faac3(0xd1)],'name':_0x45feb1[_0x3faac3(0xb7)]['name'],'description':_0x45feb1[_0x3faac3(0xb7)][_0x3faac3(0xb3)],'version':_0xd043f8[_0x3faac3(0xcd)],'importedAt':_0xd043f8[_0x3faac3(0x98)],'source':_0xd043f8['source'],'commandCount':_0x35c688[_0x3faac3(0xdf)],'commands':_0x35c688};}function a40_0x2f9a(_0x13d6c4,_0x3cf70c){_0x13d6c4=_0x13d6c4-0x94;const _0x89571b=a40_0x8957();let _0x2f9ad3=_0x89571b[_0x13d6c4];return _0x2f9ad3;}function sha256(_0x4f04ec){const _0x37e45a=a40_0x168e26;return createHash(_0x37e45a(0xb5))['update'](_0x4f04ec)[_0x37e45a(0xa7)](_0x37e45a(0xbf));}
|
|
1
|
+
const a40_0x35eed1=a40_0x667d;(function(_0x675ec4,_0x20f9a3){const _0x287ae2=a40_0x667d,_0xd1ef56=_0x675ec4();while(!![]){try{const _0x30084f=parseInt(_0x287ae2(0x9b))/0x1+-parseInt(_0x287ae2(0xbf))/0x2*(-parseInt(_0x287ae2(0xc2))/0x3)+parseInt(_0x287ae2(0x9c))/0x4*(-parseInt(_0x287ae2(0x84))/0x5)+parseInt(_0x287ae2(0xa4))/0x6+parseInt(_0x287ae2(0xbd))/0x7+-parseInt(_0x287ae2(0x7b))/0x8*(-parseInt(_0x287ae2(0x7e))/0x9)+-parseInt(_0x287ae2(0xc8))/0xa*(parseInt(_0x287ae2(0xb8))/0xb);if(_0x30084f===_0x20f9a3)break;else _0xd1ef56['push'](_0xd1ef56['shift']());}catch(_0x4a44ff){_0xd1ef56['push'](_0xd1ef56['shift']());}}}(a40_0xe65e,0x5020c));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';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a40_0x35eed1(0xca);export function getServiceRegistryPath(_0x3e6931={}){const _0x5c8b38=a40_0x35eed1;return resolve(_0x3e6931[_0x5c8b38(0x86)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x3ee74c={}){const _0xb6ba05=a40_0x35eed1,_0x36dc73=getServiceRegistryPath(_0x3ee74c);if(!existsSync(_0x36dc73))return emptyServiceRegistry();try{const _0x442a05=readFileSync(_0x36dc73,'utf8');if(!_0x442a05[_0xb6ba05(0x9f)]())return emptyServiceRegistry();const _0x17eb3c=JSON['parse'](_0x442a05);if(_0x17eb3c[_0xb6ba05(0x7c)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0xb6ba05(0xa8)](_0xb6ba05(0x94)+String(_0x17eb3c['schemaVersion']),'Remove\x20or\x20migrate\x20'+_0x36dc73+'.');if(!Array[_0xb6ba05(0xce)](_0x17eb3c[_0xb6ba05(0xc1)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x17eb3c[_0xb6ba05(0x92)],'services':_0x17eb3c[_0xb6ba05(0xc1)]};}catch(_0x20296c){if(_0x20296c instanceof Error&&_0x20296c[_0xb6ba05(0xc3)]===_0xb6ba05(0xb5))throw _0x20296c;throw CliErrors[_0xb6ba05(0xa8)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0x36dc73,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x17704b,_0x31abe9={}){const _0x21a455=a40_0x35eed1,_0x539eed=getServiceRegistryPath(_0x31abe9),_0x268f07=dirname(_0x539eed);!existsSync(_0x268f07)&&mkdirSync(_0x268f07,{'recursive':!![]});const _0x592c44=_0x539eed+_0x21a455(0x7d);try{writeFileSync(_0x592c44,JSON['stringify'](_0x17704b,null,0x2)+'\x0a',{'encoding':_0x21a455(0xbb),'mode':0x180}),renameSync(_0x592c44,_0x539eed);}catch(_0x485b92){try{unlinkSync(_0x592c44);}catch{}if(_0x485b92?.[_0x21a455(0x93)]===_0x21a455(0xa1))throw CliErrors[_0x21a455(0xa8)](_0x21a455(0xbc)+_0x539eed);throw _0x485b92;}return _0x539eed;}export function loadServiceManifestFromFile(_0x6d35fa){const _0x55e545=a40_0x35eed1,_0x309dca=resolve(_0x6d35fa);if(!existsSync(_0x309dca))throw CliErrors[_0x55e545(0xa8)](_0x55e545(0xaa)+_0x6d35fa);let _0x2ea326;const _0x555cf9=readFileSync(_0x309dca,_0x55e545(0xbb));try{_0x2ea326=JSON[_0x55e545(0x9a)](_0x555cf9);}catch{throw CliErrors[_0x55e545(0xa8)](_0x55e545(0xa0)+_0x6d35fa,_0x55e545(0xb9));}const _0x3242c9=sha256(_0x555cf9),_0x22416b=extractLoadedServiceManifests(_0x2ea326,_0x3242c9),_0x23f103=aggregateValidationReports(_0x22416b),_0x4e69a1=_0x22416b[0x0];return{'filePath':_0x309dca,'hash':_0x3242c9,'kind':isServiceRegistryLike(_0x2ea326)?_0x55e545(0x8a):'manifest','manifest':_0x4e69a1?.[_0x55e545(0xae)]??_0x2ea326,'report':_0x23f103,'normalizedManifest':_0x22416b[_0x55e545(0xbe)]===0x1?_0x4e69a1?.[_0x55e545(0xc4)]:undefined,'manifests':_0x22416b};}export function importServiceManifest(_0x537672,_0x2568d2={}){const _0x2e082e=a40_0x35eed1,_0x1ce341=loadServiceManifestFromFile(_0x537672);if(!_0x1ce341[_0x2e082e(0xc0)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x1ce341['report']),_0x2e082e(0xc7));if(_0x1ce341[_0x2e082e(0x95)][_0x2e082e(0xbe)]===0x0)throw CliErrors[_0x2e082e(0xa8)](_0x2e082e(0x96),_0x2e082e(0xa6));const _0x1e276a=readServiceRegistry(_0x2568d2),_0x2d871b=(_0x2568d2[_0x2e082e(0xb6)]??(()=>new Date()))()['toISOString'](),_0x3ea7f0=[];let _0x5939fd=0x0,_0x2d7787=0x0;for(const _0x38bd1b of _0x1ce341[_0x2e082e(0x95)]){if(!_0x38bd1b[_0x2e082e(0xc4)])continue;const _0x3da609=_0x38bd1b['normalizedManifest'][_0x2e082e(0xaf)]['code'],_0x343530={'serviceCode':_0x3da609,'version':_0x38bd1b['normalizedManifest']['version'],'importedAt':_0x2d871b,'source':{'type':_0x2e082e(0xb4),'path':_0x1ce341[_0x2e082e(0x88)],'hash':_0x38bd1b['sourceHash']},'manifest':_0x38bd1b[_0x2e082e(0xae)],'normalizedManifest':_0x38bd1b[_0x2e082e(0xc4)]},_0x530c93=_0x1e276a['services']['findIndex'](_0x20052e=>_0x20052e[_0x2e082e(0x8b)]===_0x3da609);_0x530c93>=0x0?(_0x1e276a[_0x2e082e(0xc1)][_0x530c93]=_0x343530,_0x2d7787++):(_0x1e276a[_0x2e082e(0xc1)][_0x2e082e(0x90)](_0x343530),_0x5939fd++),_0x3ea7f0[_0x2e082e(0x90)](_0x343530);}_0x1e276a[_0x2e082e(0xc1)][_0x2e082e(0x8c)]((_0x50f93b,_0x231aec)=>_0x50f93b[_0x2e082e(0x8b)][_0x2e082e(0x81)](_0x231aec[_0x2e082e(0x8b)])),_0x1e276a[_0x2e082e(0x92)]=_0x2d871b;const _0x5dc981=writeServiceRegistry(_0x1e276a,_0x2568d2);return{'registryPath':_0x5dc981,'entry':_0x3ea7f0[0x0],'replaced':_0x3ea7f0[_0x2e082e(0xbe)]===0x1?_0x2d7787===0x1:_0x2d7787>0x0,'entries':_0x3ea7f0,'imported':_0x5939fd,'updated':_0x2d7787,'serviceCount':_0x1e276a['services'][_0x2e082e(0xbe)]};}export function exportServiceManifest(_0x632c7c,_0x14968c,_0x496c42={}){const _0x24fc03=a40_0x35eed1,_0xb0bc00=getServiceRegistryPath(_0x496c42),_0x525206=getLocalServiceEntry(_0x632c7c,_0x496c42);if(!_0x525206)throw CliErrors[_0x24fc03(0xa8)](_0x24fc03(0xa9)+_0x632c7c,_0x24fc03(0xba));const _0x39920c=resolve(_0x14968c),_0x37ba1d=dirname(_0x39920c);return!existsSync(_0x37ba1d)&&mkdirSync(_0x37ba1d,{'recursive':!![]}),writeFileSync(_0x39920c,JSON[_0x24fc03(0xab)](_0x525206['manifest'],null,0x2)+'\x0a',{'encoding':_0x24fc03(0xbb),'mode':0x180}),{'registryPath':_0xb0bc00,'filePath':_0x39920c,'entry':_0x525206};}function a40_0x667d(_0x5d30d9,_0xd33cfb){_0x5d30d9=_0x5d30d9-0x7b;const _0xe65e49=a40_0xe65e();let _0x667d15=_0xe65e49[_0x5d30d9];return _0x667d15;}export function removeServiceManifest(_0x4eb6de,_0x593fd8={}){const _0x1927c9=a40_0x35eed1,_0x361154=readServiceRegistry(_0x593fd8),_0x42f6d7=_0x4eb6de['trim'](),_0x5af1fb=_0x361154[_0x1927c9(0xc1)][_0x1927c9(0x9d)](_0x55361d=>_0x55361d[_0x1927c9(0x8b)]===_0x42f6d7);if(_0x5af1fb<0x0)throw CliErrors['validation'](_0x1927c9(0xa9)+_0x42f6d7,_0x1927c9(0xba));const [_0x592228]=_0x361154[_0x1927c9(0xc1)][_0x1927c9(0xa3)](_0x5af1fb,0x1),_0x4728f8=(_0x593fd8[_0x1927c9(0xb6)]??(()=>new Date()))()['toISOString']();_0x361154[_0x1927c9(0x92)]=_0x4728f8;const _0x571a14=writeServiceRegistry(_0x361154,_0x593fd8);return{'registryPath':_0x571a14,'entry':_0x592228,'serviceCount':_0x361154[_0x1927c9(0xc1)][_0x1927c9(0xbe)]};}function a40_0xe65e(){const _0x4923e9=['registry','serviceCode','sort','missing','reduce','map','push','digest','updatedAt','code','Unsupported\x20service\x20registry\x20schemaVersion:\x20','manifests','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','commandCount','message','slice','parse','574694oDrQYe','44tFxfne','findIndex','startsWith','trim','Invalid\x20service\x20manifest\x20JSON:\x20','ENOENT','Unsupported\x20schemaVersion:\x20','splice','3535728xMZqSV','].manifest.','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','target','validation','Local\x20service\x20not\x20found:\x20','Service\x20manifest\x20file\x20not\x20found:\x20','stringify','importedAt','update','manifest','service','command','hex','string','flatMap','file','CliError','now','$.services[','6446zbpGgs','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','utf8','Cannot\x20write\x20service\x20registry:\x20','2232027SDtvJR','length','6PxiLHy','report','services','607938APxVBt','name','normalizedManifest','version','join','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','35780KrQkfN','find','service.json','source','registryIndex','path','isArray','542728uovQBz','schemaVersion','.tmp','63RAiugo','kind','sha256','localeCompare','description','errors','63980TLukqQ','commands','homeDir','].manifest','filePath','empty'];a40_0xe65e=function(){return _0x4923e9;};return a40_0xe65e();}export function listLocalServices(_0x42c25e={}){return readServiceRegistry(_0x42c25e)['services'];}export function getLocalServiceEntry(_0x1379f3,_0x389a35={}){const _0x310eea=a40_0x35eed1;return readServiceRegistry(_0x389a35)[_0x310eea(0xc1)][_0x310eea(0xc9)](_0x2ad072=>_0x2ad072[_0x310eea(0x8b)]===_0x1379f3[_0x310eea(0x9f)]());}export function listLocalServiceTrees(_0x4ab414={}){const _0xc13850=a40_0x35eed1;return readServiceRegistry(_0x4ab414)[_0xc13850(0xc1)][_0xc13850(0x8f)](_0xfa8584=>_0xfa8584[_0xc13850(0xc4)]);}export function inspectServiceRegistry(_0x26cc0d={}){const _0x2b145e=a40_0x35eed1,_0xc964d4=getServiceRegistryPath(_0x26cc0d);if(!existsSync(_0xc964d4))return emptyServiceRegistryInspection(_0xc964d4,_0x2b145e(0x8d),![]);try{const _0xcd88d5=readFileSync(_0xc964d4,_0x2b145e(0xbb));if(!_0xcd88d5[_0x2b145e(0x9f)]())return emptyServiceRegistryInspection(_0xc964d4,_0x2b145e(0x89),!![]);const _0x3121c2=JSON[_0x2b145e(0x9a)](_0xcd88d5);if(_0x3121c2['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0xc964d4,'invalid',!![]),'schemaVersion':_0x3121c2['schemaVersion'],'message':_0x2b145e(0xa2)+String(_0x3121c2[_0x2b145e(0x7c)])};if(!Array[_0x2b145e(0xce)](_0x3121c2['services']))return{...emptyServiceRegistryInspection(_0xc964d4,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3121c2['updatedAt'],'message':'services\x20must\x20be\x20an\x20array'};const _0x4aefea=_0x3121c2[_0x2b145e(0xc1)][_0x2b145e(0x8f)](summarizeLocalServiceEntry);return{'registryPath':_0xc964d4,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3121c2[_0x2b145e(0x92)],'serviceCount':_0x4aefea[_0x2b145e(0xbe)],'commandCount':_0x4aefea[_0x2b145e(0x8e)]((_0x31a73b,_0x57272a)=>_0x31a73b+_0x57272a[_0x2b145e(0x97)],0x0),'services':_0x4aefea};}catch(_0x4e71ac){return{...emptyServiceRegistryInspection(_0xc964d4,'invalid',!![]),'message':_0x4e71ac instanceof Error?_0x4e71ac[_0x2b145e(0x98)]:String(_0x4e71ac)};}}export function formatValidationFailure(_0x11cdf5){const _0x5a9b58=a40_0x35eed1,_0x23a6a3=_0x11cdf5[_0x5a9b58(0x83)][_0x5a9b58(0x8f)](_0x2c311f=>_0x2c311f[_0x5a9b58(0xcd)]+':\x20'+_0x2c311f[_0x5a9b58(0x98)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x23a6a3[_0x5a9b58(0xc6)]('\x0a');}function extractLoadedServiceManifests(_0x4f921d,_0x5e4a31){const _0x5dbed1=a40_0x35eed1;if(!isServiceRegistryLike(_0x4f921d)){const _0x3514df=_0x4f921d,_0x445427=validateServiceTreeManifest(_0x3514df);return[{'manifest':_0x3514df,'report':_0x445427,'normalizedManifest':_0x445427['ok']?normalizeServiceTreeManifest(_0x3514df):undefined,'sourceHash':_0x5e4a31}];}return _0x4f921d[_0x5dbed1(0xc1)][_0x5dbed1(0x8f)]((_0x206046,_0x4b6c08)=>{const _0x35ebe1=_0x5dbed1,_0xf260a2=isObjectRecord(_0x206046)?_0x206046[_0x35ebe1(0xae)]:undefined,_0x5e6f57=validateServiceTreeManifest(_0xf260a2),_0x287ba7=isObjectRecord(_0x206046)&&typeof _0x206046[_0x35ebe1(0x8b)]===_0x35ebe1(0xb2)?_0x206046[_0x35ebe1(0x8b)]:undefined;return{'manifest':_0xf260a2,'report':_0x5e6f57,'normalizedManifest':_0x5e6f57['ok']?normalizeServiceTreeManifest(_0xf260a2):undefined,'sourceHash':sha256(JSON[_0x35ebe1(0xab)](_0xf260a2,null,0x2)+'\x0a'),'registryIndex':_0x4b6c08,'registryServiceCode':_0x287ba7};});}function aggregateValidationReports(_0xad4155){const _0x4bf3be=a40_0x35eed1,_0x160f49=_0xad4155[_0x4bf3be(0xb3)](_0x523f70=>_0x523f70[_0x4bf3be(0xcc)]===undefined?_0x523f70[_0x4bf3be(0xc0)][_0x4bf3be(0x83)]:_0x523f70[_0x4bf3be(0xc0)][_0x4bf3be(0x83)][_0x4bf3be(0x8f)](_0xcf4c70=>({..._0xcf4c70,'path':prefixRegistryIssuePath(_0x523f70[_0x4bf3be(0xcc)],_0xcf4c70[_0x4bf3be(0xcd)])}))),_0x2e7dcc=_0xad4155[_0x4bf3be(0xb3)](_0x2650e9=>_0x2650e9['registryIndex']===undefined?_0x2650e9[_0x4bf3be(0xc0)]['warnings']:_0x2650e9[_0x4bf3be(0xc0)]['warnings'][_0x4bf3be(0x8f)](_0x4dbc26=>({..._0x4dbc26,'path':prefixRegistryIssuePath(_0x2650e9[_0x4bf3be(0xcc)],_0x4dbc26[_0x4bf3be(0xcd)])})));return{'ok':_0x160f49[_0x4bf3be(0xbe)]===0x0,'errors':_0x160f49,'warnings':_0x2e7dcc};}function prefixRegistryIssuePath(_0x4bd04e,_0x24355a){const _0x1dd251=a40_0x35eed1;if(_0x24355a==='$')return _0x1dd251(0xb7)+_0x4bd04e+_0x1dd251(0x87);if(_0x24355a[_0x1dd251(0x9e)]('$.'))return'$.services['+_0x4bd04e+_0x1dd251(0x87)+_0x24355a[_0x1dd251(0x99)](0x1);if(_0x24355a[_0x1dd251(0x9e)]('$['))return'$.services['+_0x4bd04e+_0x1dd251(0x87)+_0x24355a[_0x1dd251(0x99)](0x1);return _0x1dd251(0xb7)+_0x4bd04e+_0x1dd251(0xa5)+_0x24355a;}function isServiceRegistryLike(_0xd2dcad){const _0x119dd4=a40_0x35eed1;return isObjectRecord(_0xd2dcad)&&_0xd2dcad[_0x119dd4(0x7c)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0xd2dcad[_0x119dd4(0xc1)]);}function isObjectRecord(_0x515719){const _0x28e9c8=a40_0x35eed1;return Boolean(_0x515719)&&typeof _0x515719==='object'&&!Array[_0x28e9c8(0xce)](_0x515719);}function emptyServiceRegistryInspection(_0x40771c,_0x24739f,_0x29afa6){return{'registryPath':_0x40771c,'exists':_0x29afa6,'status':_0x24739f,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x5840d3){const _0x398df2=a40_0x35eed1,_0x272776=_0x5840d3['normalizedManifest'],_0x4ddfe6=_0x272776[_0x398df2(0x85)][_0x398df2(0x8f)](_0xb11e30=>({'path':_0xb11e30['cliPath'],'description':_0xb11e30[_0x398df2(0x82)],'risk':_0xb11e30['risk'],'targetKind':_0xb11e30['target'][_0x398df2(0x7f)],'targetCommand':_0xb11e30[_0x398df2(0xa7)][_0x398df2(0xb0)]}));return{'serviceCode':_0x5840d3[_0x398df2(0x8b)],'name':_0x272776['service']['name'],'description':_0x272776[_0x398df2(0xaf)][_0x398df2(0x82)],'version':_0x5840d3[_0x398df2(0xc5)],'importedAt':_0x5840d3[_0x398df2(0xac)],'source':_0x5840d3[_0x398df2(0xcb)],'commandCount':_0x4ddfe6[_0x398df2(0xbe)],'commands':_0x4ddfe6};}function sha256(_0x29c0e7){const _0x3a1df5=a40_0x35eed1;return createHash(_0x3a1df5(0x80))[_0x3a1df5(0xad)](_0x29c0e7)[_0x3a1df5(0x91)](_0x3a1df5(0xb1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x345ac6=a41_0x12a1;(function(_0x46a63e,_0x2dd647){const _0x3de1cd=a41_0x12a1,_0xca5f58=_0x46a63e();while(!![]){try{const _0x388770=-parseInt(_0x3de1cd(0xf4))/0x1*(parseInt(_0x3de1cd(0x107))/0x2)+-parseInt(_0x3de1cd(0x108))/0x3*(parseInt(_0x3de1cd(0x10a))/0x4)+parseInt(_0x3de1cd(0x102))/0x5+parseInt(_0x3de1cd(0x115))/0x6+parseInt(_0x3de1cd(0x100))/0x7*(-parseInt(_0x3de1cd(0xf6))/0x8)+-parseInt(_0x3de1cd(0x113))/0x9*(parseInt(_0x3de1cd(0x103))/0xa)+-parseInt(_0x3de1cd(0x119))/0xb*(-parseInt(_0x3de1cd(0x101))/0xc);if(_0x388770===_0x2dd647)break;else _0xca5f58['push'](_0xca5f58['shift']());}catch(_0x38cc14){_0xca5f58['push'](_0xca5f58['shift']());}}}(a41_0xad88,0x748f9));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a41_0x345ac6(0x105),'command':a41_0x345ac6(0x10f),'description':a41_0x345ac6(0xf3),'risk':a41_0x345ac6(0x10e),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x427a23){const _0x2b2a37=a41_0x345ac6,_0x3ae1c5=buildSkillCreatePlan(_0x427a23[_0x2b2a37(0xfc)](_0x2b2a37(0xfb)),_0x427a23[_0x2b2a37(0xfc)](_0x2b2a37(0xf8)),_0x427a23['str'](_0x2b2a37(0x10d)));return{'method':_0x2b2a37(0xfa),'url':_0x3ae1c5[_0x2b2a37(0x118)],'body':{'skillName':_0x3ae1c5[_0x2b2a37(0x116)]['skillName'],'type':_0x3ae1c5[_0x2b2a37(0x116)]['type'],'selfContained':!![],'files':_0x3ae1c5[_0x2b2a37(0x116)][_0x2b2a37(0x111)]['map'](_0x4dff8d=>_0x4dff8d[_0x2b2a37(0xff)])},'description':_0x2b2a37(0x112)};},async 'execute'(_0x54519a){const _0x4fc1b2=a41_0x345ac6,_0x57e6b2=buildSkillCreatePlan(_0x54519a['str'](_0x4fc1b2(0xfb)),_0x54519a[_0x4fc1b2(0xfc)](_0x4fc1b2(0xf8)),_0x54519a[_0x4fc1b2(0xfc)](_0x4fc1b2(0x10d)));return writeSkillDraft(_0x57e6b2,_0x54519a[_0x4fc1b2(0x117)](_0x4fc1b2(0xf7))),{'ok':!![],'data':{'skillName':_0x57e6b2[_0x4fc1b2(0x116)][_0x4fc1b2(0x106)],'type':_0x57e6b2[_0x4fc1b2(0x116)][_0x4fc1b2(0xf8)],'dir':_0x57e6b2[_0x4fc1b2(0x118)],'files':_0x57e6b2[_0x4fc1b2(0x116)][_0x4fc1b2(0x111)]['map'](_0x36f506=>_0x36f506[_0x4fc1b2(0xff)])},'message':_0x4fc1b2(0x10b)+_0x57e6b2['rendered']['skillName']};}};function buildSkillCreatePlan(_0x74aa79,_0x21f4dd,_0x3bdd41){const _0x3a7bdc=renderSkillTemplate({'skillName':_0x74aa79,'type':_0x21f4dd}),_0xd66ee9=resolve(normalizeSkillTarget(_0x3bdd41));return{'rendered':_0x3a7bdc,'targetRoot':_0xd66ee9,'skillDir':resolve(_0xd66ee9,_0x3a7bdc['skillName'])};}function a41_0xad88(){const _0x4c054a=['force','type','Skill\x20directory\x20already\x20exists:\x20','WRITE','name','str','content','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','path','7nEOuYa','545268UrktsL','2919365pWPRuU','4793340eldJgZ','Refusing\x20to\x20overwrite\x20symlink:\x20','skill','skillName','2IdceDh','40671HtMiYT','trim','36mufJWe','Created\x20local\x20Skill\x20draft\x20','utf8','target','write','create','validation','files','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','9irDRnx','isSymbolicLink','418086wWIrTG','rendered','bool','skillDir','297uQUkbb','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','756554coQQTp','isDirectory','360584VWyzNR'];a41_0xad88=function(){return _0x4c054a;};return a41_0xad88();}function a41_0x12a1(_0x39b7a9,_0xaa448a){_0x39b7a9=_0x39b7a9-0xf3;const _0xad883c=a41_0xad88();let _0x12a14e=_0xad883c[_0x39b7a9];return _0x12a14e;}function normalizeSkillTarget(_0x40ba90){const _0x10499e=a41_0x345ac6;return(_0x40ba90||DEFAULT_SKILL_TARGET)[_0x10499e(0x109)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x296f00,_0x1baba9){const _0x53a338=a41_0x345ac6;if(existsSync(_0x296f00[_0x53a338(0x118)])){const _0xe7155e=lstatSync(_0x296f00['skillDir']);if(!_0xe7155e[_0x53a338(0xf5)]()||_0xe7155e[_0x53a338(0x114)]())throw CliErrors[_0x53a338(0x110)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x296f00['skillDir']);if(!_0x1baba9)throw CliErrors['validation'](_0x53a338(0xf9)+_0x296f00[_0x53a338(0x118)],_0x53a338(0xfe));}for(const _0x132806 of _0x296f00[_0x53a338(0x116)]['files']){const _0x542853=resolve(_0x296f00[_0x53a338(0x118)],_0x132806[_0x53a338(0xff)]),_0x16dafa=dirname(_0x542853);mkdirSync(_0x16dafa,{'recursive':!![]});if(existsSync(_0x542853)&&lstatSync(_0x542853)[_0x53a338(0x114)]())throw CliErrors[_0x53a338(0x110)](_0x53a338(0x104)+_0x542853);writeFileSync(_0x542853,_0x132806[_0x53a338(0xfd)],_0x53a338(0x10c));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x2064d3=a42_0x2af4;(function(_0x34a8e3,_0x58e9f4){const _0x3aa589=a42_0x2af4,_0x198fef=_0x34a8e3();while(!![]){try{const _0x3fa793=parseInt(_0x3aa589(0xc1))/0x1+parseInt(_0x3aa589(0xb1))/0x2+parseInt(_0x3aa589(0xb4))/0x3*(parseInt(_0x3aa589(0xce))/0x4)+-parseInt(_0x3aa589(0xd1))/0x5*(-parseInt(_0x3aa589(0xb3))/0x6)+parseInt(_0x3aa589(0xcf))/0x7*(-parseInt(_0x3aa589(0xb2))/0x8)+parseInt(_0x3aa589(0xa9))/0x9*(parseInt(_0x3aa589(0xab))/0xa)+parseInt(_0x3aa589(0xc7))/0xb*(-parseInt(_0x3aa589(0xa5))/0xc);if(_0x3fa793===_0x58e9f4)break;else _0x198fef['push'](_0x198fef['shift']());}catch(_0x1634a5){_0x198fef['push'](_0x198fef['shift']());}}}(a42_0x2e0b,0x5a168));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,SCOPE_FLAG}from'../flags.js';function a42_0x2af4(_0x27be11,_0x44832d){_0x27be11=_0x27be11-0xa3;const _0x2e0b9=a42_0x2e0b();let _0x2af4e2=_0x2e0b9[_0x27be11];return _0x2af4e2;}import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a42_0x2064d3(0xc8),'command':a42_0x2064d3(0xbf),'description':a42_0x2064d3(0xba),'risk':a42_0x2064d3(0xbe),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG],async 'execute'(_0x5eeae0){return syncRuntimeSkills(_0x5eeae0);}};async function syncRuntimeSkills(_0x302e58){const _0x9b4b78=a42_0x2064d3,{downloadRuntimeSkillPackage:_0x20dc70,listRuntimeSkills:_0x15b836}=await import(_0x9b4b78(0xa7)),{linkEffectiveRuntimeSkills:_0x55def4,materializeRuntimeSkill:_0x31fb19,pruneStaleRuntimeSkillCache:_0x1ff1cc,pruneStaleRuntimeSkillLinks:_0x341b37}=await import(_0x9b4b78(0xb6)),_0x34b335=_0x302e58[_0x9b4b78(0xad)](_0x9b4b78(0xcb)),_0xb33d2d=normalizeSyncScopes(_0x302e58[_0x9b4b78(0xad)]('scope')),_0x4d2c30=_0x302e58[_0x9b4b78(0xa4)]??_0x9b4b78(0xae),_0x15f227=_0x302e58[_0x9b4b78(0xa6)];if(!_0x15f227)throw CliErrors[_0x9b4b78(0xcc)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x383b3f=await Promise[_0x9b4b78(0xb8)](_0xb33d2d[_0x9b4b78(0xc5)](_0x3b1d16=>_0x15b836({'appCode':_0x302e58[_0x9b4b78(0xc2)],'scope':_0x3b1d16,'code':_0x34b335['trim']()||undefined}))),_0x461049=_0xb33d2d[_0x9b4b78(0xaf)](_0x9b4b78(0xc0))?_0x383b3f[_0x9b4b78(0xd0)]((_0x3d846e,_0x6b6017)=>_0xb33d2d[_0x6b6017]===_0x9b4b78(0xc0)?_0x3d846e[_0x9b4b78(0xc0)]:[]):[],_0x39527b=_0xb33d2d[_0x9b4b78(0xaf)]('company')?_0x383b3f['flatMap']((_0x3e6620,_0x1e6876)=>_0xb33d2d[_0x1e6876]===_0x9b4b78(0xca)?_0x3e6620[_0x9b4b78(0xca)]:[]):[],_0x5d00ba=new Set([..._0x461049[_0x9b4b78(0xc5)](_0x4c7b28=>_0x4c7b28['skillCode']?.[_0x9b4b78(0xc6)]())[_0x9b4b78(0xa3)](_0x1870ab=>Boolean(_0x1870ab)),..._0x39527b[_0x9b4b78(0xc5)](_0x5f0fc4=>_0x5f0fc4[_0x9b4b78(0xc4)]?.[_0x9b4b78(0xc6)]())[_0x9b4b78(0xa3)](_0x1ada6c=>Boolean(_0x1ada6c))]),_0x28f079=_0x34b335[_0x9b4b78(0xc6)]()?[_0x34b335[_0x9b4b78(0xc6)]()]:undefined,_0x1827bb=_0xb33d2d['length']===0x2&&_0xb33d2d[_0x9b4b78(0xaf)](_0x9b4b78(0xc0))&&_0xb33d2d[_0x9b4b78(0xaf)](_0x9b4b78(0xca)),_0x3ebb60=_0x1827bb?_0x341b37(_0x302e58[_0x9b4b78(0xc2)],_0x5d00ba,{},_0x28f079):[],_0xa4afb7=_0x1ff1cc({'env':_0x4d2c30,'accessKey':_0x15f227,'appCode':_0x302e58[_0x9b4b78(0xc2)],'activeSkillCodes':_0x5d00ba,'pruneSkillCodes':_0x28f079,'scopes':_0xb33d2d}),_0x1c9ae0=[];for(const _0x111cfb of _0x461049){_0x1c9ae0[_0x9b4b78(0xa8)](_0x31fb19(_0x111cfb,_0x9b4b78(0xc0),{'env':_0x4d2c30,'accessKey':_0x15f227,'appCode':_0x302e58[_0x9b4b78(0xc2)],'packageBytes':await downloadSkillPackage(_0x111cfb,_0x9b4b78(0xc0),_0x302e58[_0x9b4b78(0xc2)],_0x20dc70)}));}for(const _0x5c09d3 of _0x39527b){_0x1c9ae0[_0x9b4b78(0xa8)](_0x31fb19(_0x5c09d3,'company',{'env':_0x4d2c30,'accessKey':_0x15f227,'appCode':_0x302e58[_0x9b4b78(0xc2)],'packageBytes':await downloadSkillPackage(_0x5c09d3,_0x9b4b78(0xca),_0x302e58[_0x9b4b78(0xc2)],_0x20dc70)}));}const _0x1606b7=_0x55def4(_0x1c9ae0,_0x302e58[_0x9b4b78(0xc2)]),_0x23e825=countLinkActions(_0x1606b7);return{'ok':!![],'data':{'appCode':_0x302e58[_0x9b4b78(0xc2)],'personal':_0x461049[_0x9b4b78(0xcd)],'company':_0x39527b['length'],'materialized':_0x1c9ae0[_0x9b4b78(0xcd)],'links':{'total':_0x1606b7[_0x9b4b78(0xcd)],'created':_0x23e825[_0x9b4b78(0xbc)]??0x0,'updated':_0x23e825[_0x9b4b78(0xb9)]??0x0,'unchanged':_0x23e825[_0x9b4b78(0xc9)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x3ebb60[_0x9b4b78(0xa3)](_0x2e6512=>_0x2e6512['action']===_0x9b4b78(0xb5))['length'],'cacheDirs':_0xa4afb7['filter'](_0x1a2f90=>_0x1a2f90[_0x9b4b78(0xb7)]==='removed')[_0x9b4b78(0xcd)],'skipped':[..._0x3ebb60,..._0xa4afb7]['filter'](_0x4f4cfb=>_0x4f4cfb[_0x9b4b78(0xb7)]===_0x9b4b78(0xb0))['length']},'skills':{'personal':_0x461049['map'](summarizeRuntimeSkill),'company':_0x39527b[_0x9b4b78(0xc5)](summarizeRuntimeSkill)}},'message':_0x9b4b78(0xac)+_0x461049['length']+_0x9b4b78(0xaa)+_0x39527b[_0x9b4b78(0xcd)]+_0x9b4b78(0xbb)};}async function downloadSkillPackage(_0x412efa,_0x33b5a3,_0x563762,_0x2f38cc){const _0xb4a6c4=a42_0x2064d3,_0x88339a=_0x412efa[_0xb4a6c4(0xbd)]?.[_0xb4a6c4(0xc6)]();return _0x88339a?_0x2f38cc(_0x33b5a3,_0x412efa[_0xb4a6c4(0xc4)],_0x563762,_0x88339a):_0x2f38cc(_0x33b5a3,_0x412efa[_0xb4a6c4(0xc4)],_0x563762);}function countLinkActions(_0x3ce518){const _0x4888ea=a42_0x2064d3;return _0x3ce518[_0x4888ea(0xc3)]((_0x1e3396,_0x3aac14)=>{const _0x4f5904=_0x4888ea;return _0x1e3396[_0x3aac14['action']]=(_0x1e3396[_0x3aac14[_0x4f5904(0xb7)]]??0x0)+0x1,_0x1e3396;},{});}function a42_0x2e0b(){const _0x228cf1=['write','install','personal','482316LVaElh','appCode','reduce','skillCode','map','trim','627649zOJKJx','skill','unchanged','company','code','authRequired','length','2308CYqYvq','3800398wjpnzw','flatMap','5LRbkuR','filter','envName','228VAcUqp','accessKey','../../../core/api-client.js','push','179649DSlykX','\x20personal\x20and\x20','20HXqyzp','Installed\x20','str','production','includes','skipped','590610Oghteb','8AIsVud','3075804BInbGP','3462jgYbUo','removed','../../../skills/runtime-skill-sync.js','action','all','updated','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','\x20company\x20Skill(s).','created','version'];a42_0x2e0b=function(){return _0x228cf1;};return a42_0x2e0b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a43_0x3790(){const _0x3fa2eb=['242067GRbrFT','bool','accessKey','length','remote','3316890dWJePK','list','trim','1465VdDERT','3070864qUoxmM','filter','envName','12jdTaiY','scope','company','code','2035460pzbsBG','9nUfTpz','local','production','appCode','str','3918IeGwsY','skill','6264eGEoof','builtin','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','map','451SBSnnm','\x20local\x20Skill(s).','../../../skills/runtime-skill-sync.js','Listed\x20','742cYBXLx','personal','read','\x20remote\x20Skill(s).','707uwnfAa'];a43_0x3790=function(){return _0x3fa2eb;};return a43_0x3790();}const a43_0xb28c1c=a43_0x353e;function a43_0x353e(_0x33d781,_0x24a932){_0x33d781=_0x33d781-0xb4;const _0x3790ff=a43_0x3790();let _0x353ed7=_0x3790ff[_0x33d781];return _0x353ed7;}(function(_0x4bb6c2,_0x28db8a){const _0x48d429=a43_0x353e,_0x42345c=_0x4bb6c2();while(!![]){try{const _0x210d97=-parseInt(_0x48d429(0xce))/0x1*(-parseInt(_0x48d429(0xca))/0x2)+-parseInt(_0x48d429(0xcf))/0x3*(parseInt(_0x48d429(0xb6))/0x4)+parseInt(_0x48d429(0xd7))/0x5*(-parseInt(_0x48d429(0xc0))/0x6)+-parseInt(_0x48d429(0xba))/0x7+parseInt(_0x48d429(0xd8))/0x8*(parseInt(_0x48d429(0xbb))/0x9)+parseInt(_0x48d429(0xd4))/0xa+parseInt(_0x48d429(0xc6))/0xb*(parseInt(_0x48d429(0xc2))/0xc);if(_0x210d97===_0x28db8a)break;else _0x42345c['push'](_0x42345c['shift']());}catch(_0x356503){_0x42345c['push'](_0x42345c['shift']());}}}(a43_0x3790,0x4327e));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a43_0xb28c1c(0xc1),'command':a43_0xb28c1c(0xd5),'description':a43_0xb28c1c(0xc4),'risk':a43_0xb28c1c(0xcc),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG],async 'execute'(_0x499421){const _0x32a558=a43_0xb28c1c,_0x55056f=_0x499421[_0x32a558(0xbf)](_0x32a558(0xb9)),_0x38fde8=normalizeListScope(_0x499421[_0x32a558(0xbf)](_0x32a558(0xb7)));if(_0x499421[_0x32a558(0xd0)](_0x32a558(0xbc))){const _0x52a5dc=_0x499421[_0x32a558(0xd1)];if(!_0x52a5dc)throw CliErrors['authRequired']();const {listLocalRuntimeSkills:_0x240a65}=await import(_0x32a558(0xc8)),_0x12372f=_0x240a65({'env':_0x499421[_0x32a558(0xb5)]??_0x32a558(0xbd),'accessKey':_0x52a5dc,'appCode':_0x499421[_0x32a558(0xbe)],'scopes':listScopeToRuntimeScopes(_0x38fde8),'code':_0x55056f[_0x32a558(0xd6)]()||undefined}),_0x5c95c5=groupLocalRuntimeSkills(_0x12372f);return{'ok':!![],'data':{'appCode':_0x499421[_0x32a558(0xbe)],'source':_0x32a558(0xbc),'scope':_0x38fde8,'total':_0x12372f[_0x32a558(0xd2)],'personal':_0x5c95c5['personal'][_0x32a558(0xd2)],'company':_0x5c95c5[_0x32a558(0xb8)][_0x32a558(0xd2)],'items':_0x12372f[_0x32a558(0xc5)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x5c95c5[_0x32a558(0xcb)][_0x32a558(0xc5)](summarizeLocalRuntimeSkill),'company':_0x5c95c5[_0x32a558(0xb8)]['map'](summarizeLocalRuntimeSkill)}},'message':_0x32a558(0xc9)+_0x12372f['length']+_0x32a558(0xc7)};}const {listRuntimeSkills:_0x121825}=await import('../../../core/api-client.js'),_0x4b3ec0=await _0x121825({'appCode':_0x499421[_0x32a558(0xbe)],'scope':listScopeToRemoteScope(_0x38fde8),'code':_0x55056f[_0x32a558(0xd6)]()||undefined}),_0x3d7d3d=shouldListScope(_0x38fde8,_0x32a558(0xcb))?_0x4b3ec0[_0x32a558(0xcb)]??[]:[],_0x2b7b64=shouldListScope(_0x38fde8,_0x32a558(0xb8))?_0x4b3ec0[_0x32a558(0xb8)]??[]:[],_0x57a791=[..._0x3d7d3d,..._0x2b7b64];return{'ok':!![],'data':{'appCode':_0x499421[_0x32a558(0xbe)],'source':_0x32a558(0xd3),'scope':_0x38fde8,'total':_0x57a791['length'],'personal':_0x3d7d3d[_0x32a558(0xd2)],'company':_0x2b7b64[_0x32a558(0xd2)],'items':_0x57a791[_0x32a558(0xc5)](summarizeRuntimeSkill),'skills':{'personal':_0x3d7d3d[_0x32a558(0xc5)](summarizeRuntimeSkill),'company':_0x2b7b64[_0x32a558(0xc5)](summarizeRuntimeSkill)}},'message':_0x32a558(0xc9)+_0x57a791['length']+_0x32a558(0xcd)};}};function groupLocalRuntimeSkills(_0x1040ae){const _0x806b73=a43_0xb28c1c;return{'personal':_0x1040ae[_0x806b73(0xb4)](_0xed3113=>_0xed3113[_0x806b73(0xb7)]==='personal'),'company':_0x1040ae[_0x806b73(0xb4)](_0x5759a2=>_0x5759a2['scope']===_0x806b73(0xb8)),'builtin':_0x1040ae[_0x806b73(0xb4)](_0x504aa1=>_0x504aa1['scope']===_0x806b73(0xc3))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0xdb0f06=a44_0x5060;(function(_0x172227,_0x4b4c79){const _0x5d62e9=a44_0x5060,_0x314dde=_0x172227();while(!![]){try{const _0x2faf9c=-parseInt(_0x5d62e9(0x80))/0x1+-parseInt(_0x5d62e9(0x7b))/0x2*(-parseInt(_0x5d62e9(0x7e))/0x3)+parseInt(_0x5d62e9(0x86))/0x4+parseInt(_0x5d62e9(0x84))/0x5+parseInt(_0x5d62e9(0x83))/0x6*(parseInt(_0x5d62e9(0x7f))/0x7)+-parseInt(_0x5d62e9(0x7a))/0x8*(-parseInt(_0x5d62e9(0x85))/0x9)+-parseInt(_0x5d62e9(0x81))/0xa*(parseInt(_0x5d62e9(0x82))/0xb);if(_0x2faf9c===_0x4b4c79)break;else _0x314dde['push'](_0x314dde['shift']());}catch(_0x10b029){_0x314dde['push'](_0x314dde['shift']());}}}(a44_0x3aa7,0x3a678));import{CONFIRM_WARNINGS_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a44_0x5060(_0x1e9112,_0x3cc696){_0x1e9112=_0x1e9112-0x79;const _0x3aa7d9=a44_0x3aa7();let _0x50606d=_0x3aa7d9[_0x1e9112];return _0x50606d;}function a44_0x3aa7(){const _0xa8bdca=['232TYqImf','10AlKrhV','write','push','238389jFjsPK','7NcGAUG','443DWzAiU','20zNOePz','3960836dqxIAU','907422aPZLhi','699610BFIhrW','49185mndhkD','451440nudSBq','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20scope\x20or\x20submit\x20company\x20scope\x20for\x20review','skill'];a44_0x3aa7=function(){return _0xa8bdca;};return a44_0x3aa7();}export const pushCommand={'service':a44_0xdb0f06(0x79),'command':a44_0xdb0f06(0x7d),'description':a44_0xdb0f06(0x87),'risk':a44_0xdb0f06(0x7c),'flags':[DIR_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a45_0x2233(){const _0x551d93=['Skill\x20validation\x20passed.','1227mANoRC','56555ZpuoiX','str','4500770fkdtPE','read','1433583HpjpYP','3988XZIpTA','3548qUawsQ','skill','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','validate','104SXGFxA','11496szQytg','11diUlYy','dir','53522zhtuVh','warnings','366rHanBT','errors','25909JuTVuF','type','752JycMXI'];a45_0x2233=function(){return _0x551d93;};return a45_0x2233();}const a45_0x2c9a93=a45_0x5a33;(function(_0xeee50c,_0x238646){const _0x1432e4=a45_0x5a33,_0x53c5ee=_0xeee50c();while(!![]){try{const _0x17bc6b=parseInt(_0x1432e4(0xe6))/0x1*(-parseInt(_0x1432e4(0xe2))/0x2)+parseInt(_0x1432e4(0xdb))/0x3*(-parseInt(_0x1432e4(0xe1))/0x4)+-parseInt(_0x1432e4(0xdc))/0x5*(parseInt(_0x1432e4(0xd5))/0x6)+-parseInt(_0x1432e4(0xd3))/0x7*(-parseInt(_0x1432e4(0xd9))/0x8)+-parseInt(_0x1432e4(0xe0))/0x9+-parseInt(_0x1432e4(0xde))/0xa*(parseInt(_0x1432e4(0xd1))/0xb)+-parseInt(_0x1432e4(0xd0))/0xc*(-parseInt(_0x1432e4(0xd7))/0xd);if(_0x17bc6b===_0x238646)break;else _0x53c5ee['push'](_0x53c5ee['shift']());}catch(_0x54f116){_0x53c5ee['push'](_0x53c5ee['shift']());}}}(a45_0x2233,0xb3c9e));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a45_0x5a33(_0x212211,_0x2c8944){_0x212211=_0x212211-0xd0;const _0x2233a1=a45_0x2233();let _0x5a336d=_0x2233a1[_0x212211];return _0x5a336d;}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a45_0x2c9a93(0xe3),'command':a45_0x2c9a93(0xe5),'description':a45_0x2c9a93(0xe4),'risk':a45_0x2c9a93(0xdf),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x4c2a4a){const _0x1a2243=a45_0x2c9a93,_0x188cdc=_0x4c2a4a['bool']('strict'),_0xe8e464=validateSkillDirectory(_0x4c2a4a[_0x1a2243(0xdd)](_0x1a2243(0xd2)),{'strict':_0x188cdc});return throwIfSkillValidationFailed(_0xe8e464,_0x188cdc),{'ok':!![],'data':{'dir':_0xe8e464[_0x1a2243(0xd2)],'type':_0xe8e464[_0x1a2243(0xd8)],'errors':_0xe8e464[_0x1a2243(0xd6)],'warnings':_0xe8e464[_0x1a2243(0xd4)]},'message':_0x1a2243(0xda)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a46_0x595877=a46_0x4870;function a46_0x4870(_0x3a1346,_0x18ec50){_0x3a1346=_0x3a1346-0x18c;const _0x1727f8=a46_0x1727();let _0x48701e=_0x1727f8[_0x3a1346];return _0x48701e;}(function(_0x2b6964,_0x56da8f){const _0x4b6f02=a46_0x4870,_0x488e3c=_0x2b6964();while(!![]){try{const _0x359d3c=parseInt(_0x4b6f02(0x19f))/0x1+-parseInt(_0x4b6f02(0x1a7))/0x2*(-parseInt(_0x4b6f02(0x1ab))/0x3)+parseInt(_0x4b6f02(0x191))/0x4+-parseInt(_0x4b6f02(0x1a4))/0x5+-parseInt(_0x4b6f02(0x198))/0x6+-parseInt(_0x4b6f02(0x1a3))/0x7*(parseInt(_0x4b6f02(0x1a1))/0x8)+-parseInt(_0x4b6f02(0x18e))/0x9;if(_0x359d3c===_0x56da8f)break;else _0x488e3c['push'](_0x488e3c['shift']());}catch(_0x57b952){_0x488e3c['push'](_0x488e3c['shift']());}}}(a46_0x1727,0xdde27));import{DEFAULT_SKILL_TARGET,SKILL_NAME_PATTERN,SKILL_TYPES}from'./templates.js';export const CODE_FLAG={'name':a46_0x595877(0x18f),'type':a46_0x595877(0x1aa),'description':a46_0x595877(0x1a6)};export const SCOPE_FLAG={'name':'scope','type':'string','description':a46_0x595877(0x1ae),'enum':['all',a46_0x595877(0x193),'company']};export const PUSH_SCOPE_FLAG={'name':a46_0x595877(0x197),'type':a46_0x595877(0x1aa),'description':a46_0x595877(0x190),'default':a46_0x595877(0x193),'enum':['personal','company']};export const LIST_SCOPE_FLAG={'name':a46_0x595877(0x197),'type':'string','description':a46_0x595877(0x18d),'enum':[a46_0x595877(0x1a2),a46_0x595877(0x193),a46_0x595877(0x192)]};export const LOCAL_FLAG={'name':a46_0x595877(0x18c),'type':'boolean','description':a46_0x595877(0x199)};export const DIR_FLAG={'name':'dir','type':'string','required':!![],'description':a46_0x595877(0x19e)};export const CREATE_NAME_FLAG={'name':a46_0x595877(0x196),'type':a46_0x595877(0x1aa),'required':!![],'description':a46_0x595877(0x1ac),'pattern':{'regex':SKILL_NAME_PATTERN,'description':a46_0x595877(0x1a8)}};function a46_0x1727(){const _0x261eb2=['Read\x20CLI-managed\x20local\x20Skill\x20cache\x20and\x20links\x20instead\x20of\x20remote\x20lists','force','strict','Compatibility\x20flag;\x20no\x20extra\x20checks\x20are\x20enabled','Directory\x20that\x20will\x20contain\x20the\x20generated\x20Skill\x20directory','Local\x20Skill\x20directory\x20containing\x20SKILL.md','932114cwZfyW','Skill\x20template\x20type','88sBZHIr','all','230083IisngT','4978795ohpUBe','Overwrite\x20generated\x20files\x20when\x20the\x20Skill\x20directory\x20already\x20exists','Only\x20target\x20a\x20specific\x20runtime\x20Skill\x20code','2558324UxsNGO','lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens','confirm-warnings','string','3PFKYaO','Skill\x20name\x20using\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','target','Skill\x20sync\x20scope:\x20all\x20(personal/company),\x20personal,\x20or\x20company','Continue\x20company\x20Skill\x20push\x20when\x20SkillHub\x20validation\x20reports\x20warnings','local','Skill\x20list\x20scope:\x20all,\x20personal,\x20or\x20company','11637576YcAgUm','code','Skill\x20push\x20target\x20scope:\x20personal\x20saves\x20immediately,\x20company\x20submits\x20a\x20new\x20version\x20for\x20review','6362072PzQsQu','company','personal','write','boolean','name','scope','1455438YOBNmP'];a46_0x1727=function(){return _0x261eb2;};return a46_0x1727();}export const TYPE_FLAG={'name':'type','type':a46_0x595877(0x1aa),'description':a46_0x595877(0x1a0),'default':a46_0x595877(0x194),'enum':[...SKILL_TYPES]};export const TARGET_FLAG={'name':a46_0x595877(0x1ad),'type':a46_0x595877(0x1aa),'description':a46_0x595877(0x19d),'default':DEFAULT_SKILL_TARGET};export const FORCE_FLAG={'name':a46_0x595877(0x19a),'type':a46_0x595877(0x195),'description':a46_0x595877(0x1a5)};export const CONFIRM_WARNINGS_FLAG={'name':a46_0x595877(0x1a9),'type':'boolean','description':a46_0x595877(0x1af)};export const STRICT_FLAG={'name':a46_0x595877(0x19b),'type':a46_0x595877(0x195),'description':a46_0x595877(0x19c)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0x5ae5(_0x4b5428,_0x44b206){_0x4b5428=_0x4b5428-0x1ce;const _0x120d1d=a47_0x120d();let _0x5ae5dc=_0x120d1d[_0x4b5428];return _0x5ae5dc;}(function(_0x3e8193,_0x17395a){const _0x3c13c2=a47_0x5ae5,_0x36c1a=_0x3e8193();while(!![]){try{const _0x42377c=-parseInt(_0x3c13c2(0x1d2))/0x1+-parseInt(_0x3c13c2(0x1d5))/0x2*(-parseInt(_0x3c13c2(0x1d3))/0x3)+-parseInt(_0x3c13c2(0x1d1))/0x4+-parseInt(_0x3c13c2(0x1d4))/0x5+-parseInt(_0x3c13c2(0x1cf))/0x6*(parseInt(_0x3c13c2(0x1ce))/0x7)+parseInt(_0x3c13c2(0x1d6))/0x8+parseInt(_0x3c13c2(0x1d0))/0x9;if(_0x42377c===_0x17395a)break;else _0x36c1a['push'](_0x36c1a['shift']());}catch(_0x1c7c6e){_0x36c1a['push'](_0x36c1a['shift']());}}}(a47_0x120d,0xc5fdc));function a47_0x120d(){const _0x753223=['4PsYnRn','7405096QiAGoc','168WtOIJt','279864mQxKWC','40442931RABmIe','4182208Tudyfq','1390669ymcANe','390183IRktRg','6563845hXNQbm'];a47_0x120d=function(){return _0x753223;};return a47_0x120d();}import{createCommand}from'./commands/create.js';import{installCommand}from'./commands/install.js';import{listCommand}from'./commands/list.js';import{pushCommand}from'./commands/push.js';import{validateCommand}from'./commands/validate.js';export const skillDefinitions=[installCommand,createCommand,validateCommand,listCommand,pushCommand];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x3373(){var _0x3854f8=['252842jVsULr','684830QPKsvl','isArray','373077hcNCmi','object','29315ZGDkeP','45kCqYsj','77tjhxsZ','path','files','369wsDBfg','length','2984mDmApD','string','660JLnfok','4ZLNCSV','406413eyUEEg','66RuVcwC','615208TRQiCs','ossPath','SKILL.md'];a48_0x3373=function(){return _0x3854f8;};return a48_0x3373();}function a48_0x5d53(_0x29cc49,_0xb26ad9){_0x29cc49=_0x29cc49-0x70;var _0x33739a=a48_0x3373();var _0x5d53d7=_0x33739a[_0x29cc49];return _0x5d53d7;}(function(_0x38dda2,_0x1a4df5){var _0x52a484=a48_0x5d53,_0x16079c=_0x38dda2();while(!![]){try{var _0x1da60e=parseInt(_0x52a484(0x76))/0x1*(parseInt(_0x52a484(0x7c))/0x2)+parseInt(_0x52a484(0x7f))/0x3+parseInt(_0x52a484(0x79))/0x4*(parseInt(_0x52a484(0x82))/0x5)+parseInt(_0x52a484(0x78))/0x6*(-parseInt(_0x52a484(0x77))/0x7)+parseInt(_0x52a484(0x73))/0x8*(parseInt(_0x52a484(0x71))/0x9)+-parseInt(_0x52a484(0x7d))/0xa*(parseInt(_0x52a484(0x83))/0xb)+-parseInt(_0x52a484(0x75))/0xc*(parseInt(_0x52a484(0x81))/0xd);if(_0x1da60e===_0x1a4df5)break;else _0x16079c['push'](_0x16079c['shift']());}catch(_0x5de4df){_0x16079c['push'](_0x16079c['shift']());}}}(a48_0x3373,0xc042b));export function isPackageBackedManifest(_0x5858be){var _0x4130f7=a48_0x5d53;return!!_0x5858be&&typeof _0x5858be===_0x4130f7(0x80)&&!Array[_0x4130f7(0x7e)](_0x5858be)&&typeof _0x5858be[_0x4130f7(0x7a)]===_0x4130f7(0x74)&&_0x5858be[_0x4130f7(0x7a)][_0x4130f7(0x72)]>0x0&&Array[_0x4130f7(0x7e)](_0x5858be['files']);}export function isMultiFileManifest(_0x14a5e7){var _0x29418c=a48_0x5d53;return!!_0x14a5e7&&typeof _0x14a5e7===_0x29418c(0x80)&&!Array[_0x29418c(0x7e)](_0x14a5e7)&&Array['isArray'](_0x14a5e7[_0x29418c(0x70)])&&_0x14a5e7[_0x29418c(0x70)]['some'](_0x3807ce=>_0x3807ce[_0x29418c(0x84)]!==_0x29418c(0x7b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x8803d5,_0x17718b){const _0x3a211f=a49_0x435b,_0x237b4a=_0x8803d5();while(!![]){try{const _0x3e0a45=parseInt(_0x3a211f(0xed))/0x1*(-parseInt(_0x3a211f(0x101))/0x2)+parseInt(_0x3a211f(0x116))/0x3+-parseInt(_0x3a211f(0x11a))/0x4+parseInt(_0x3a211f(0x112))/0x5+-parseInt(_0x3a211f(0xfc))/0x6+parseInt(_0x3a211f(0x100))/0x7*(-parseInt(_0x3a211f(0x107))/0x8)+parseInt(_0x3a211f(0x111))/0x9*(parseInt(_0x3a211f(0xeb))/0xa);if(_0x3e0a45===_0x17718b)break;else _0x237b4a['push'](_0x237b4a['shift']());}catch(_0x369fc2){_0x237b4a['push'](_0x237b4a['shift']());}}}(a49_0x52a0,0xbfb08));import{CliErrors}from'../../errors.js';import{isMultiFileManifest,isPackageBackedManifest}from'./manifest-helpers.js';import{remotePersonalReadOptions,remoteMissingCompanyReadOptions,remoteMissingPersonalReadOptions}from'./push-flow-helpers.js';import{allowRetargetArgs,buildRetargetWarning,remoteFirstMetadataOptions,resolvePushScope,throwIfBuiltinPushTarget,throwIfPublishValidationFailed}from'./push-flow-helpers.js';import{withRetargetExistingMetadata}from'./push-retarget.js';import{summarizeRuntimeSkill}from'./summary.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'./validate.js';export async function skillPushDryRun(_0x420052){const _0x3e285e=a49_0x435b,{getRuntimeSkillByCode:_0x4657f5,validateRuntimeSkillPublish:_0x44da41}=await import(_0x3e285e(0xe8)),{readPushDirectory:_0x598d41,resolvePushDirectoryIdentity:_0x272ae5}=await import(_0x3e285e(0xf5));if(!_0x420052[_0x3e285e(0x105)])throw CliErrors['authRequired']();const _0x5ee3e2=resolvePushScope(_0x420052),_0x1ac09e=validateSkillDirectory(_0x420052['str']('dir'));throwIfSkillValidationFailed(_0x1ac09e);const _0x3b88bf=_0x272ae5(_0x1ac09e[_0x3e285e(0xf7)],_0x420052[_0x3e285e(0xe7)],remoteFirstMetadataOptions()),_0x2e5d5e=await _0x4657f5(_0x420052[_0x3e285e(0xe7)],_0x3b88bf[_0x3e285e(0x103)]);throwIfBuiltinPushTarget(_0x2e5d5e);if(_0x5ee3e2==='company'){const _0x25396e=_0x598d41(_0x1ac09e[_0x3e285e(0xf7)],_0x420052[_0x3e285e(0xe7)],remoteMissingCompanyReadOptions()),_0x40b385=await _0x44da41(_0x420052['appCode'],_0x25396e[_0x3e285e(0xe9)],{'visibility':_0x3e285e(0xf8)});return{'method':_0x3e285e(0x10a),'url':_0x3e285e(0xf4)+_0x420052['appCode']+_0x3e285e(0xf6),'body':{'skillCode':_0x25396e[_0x3e285e(0x103)],'visibility':_0x3e285e(0xf8),'valid':_0x40b385[_0x3e285e(0xe6)],'errors':_0x40b385[_0x3e285e(0x102)],'warnings':_0x40b385['warnings'],'resolvedSlug':_0x40b385['resolvedSlug'],'resolvedVersion':_0x40b385[_0x3e285e(0x104)]},'description':_0x3e285e(0xff)};}if(_0x2e5d5e&&_0x2e5d5e[_0x3e285e(0x108)]!==_0x3e285e(0xea))throw CliErrors[_0x3e285e(0xef)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20remote\x20Skill\x20'+_0x3b88bf[_0x3e285e(0x103)]+_0x3e285e(0x10c)+(_0x2e5d5e['scope']??_0x3e285e(0xfe))+'\x22.');const _0x5966c5=_0x598d41(_0x1ac09e[_0x3e285e(0xf7)],_0x420052[_0x3e285e(0xe7)],_0x2e5d5e?remotePersonalReadOptions(!![]):remoteMissingPersonalReadOptions());return{'method':_0x3e285e(0x10a),'url':_0x3e285e(0xf4)+_0x420052[_0x3e285e(0xe7)]+_0x3e285e(0x10e),'body':{'skillCode':_0x5966c5['skillCode'],'visibility':_0x3e285e(0x113),'files':_0x5966c5[_0x3e285e(0xe9)][_0x3e285e(0xf1)]?.[_0x3e285e(0xf1)][_0x3e285e(0x10d)](_0x50701=>_0x50701[_0x3e285e(0x106)])??[]},'description':'Preview\x20a\x20personal\x20Skill\x20push\x20without\x20creating\x20or\x20updating\x20a\x20remote\x20Skill.'};}export async function skillPushExecute(_0x20d21f){const _0x6c4e51=a49_0x435b,{createPersonalRuntimeSkill:_0x31065d,downloadRuntimeSkillPackage:_0x56d646,getRuntimeSkillByCode:_0x251af9,publishCompanyRuntimeSkill:_0x4a96e3,updatePersonalRuntimeSkill:_0x53ed31,validateRuntimeSkillPublish:_0x494437}=await import('../../core/api-client.js'),{verifyRuntimeSkillPackage:_0x71d2e,verifyRuntimeSkillBundle:_0xe3fb30,readPushDirectory:_0x427f02,refreshPushDirectoryMetadataFromRemote:_0x3d6e78,recordPushedRuntimeSkill:_0x5e4fb7,resolvePushDirectoryIdentity:_0x473d9}=await import(_0x6c4e51(0xf5));if(!_0x20d21f['accessKey'])throw CliErrors[_0x6c4e51(0xf3)]();const _0x3bef4c=resolvePushScope(_0x20d21f),_0x302299=validateSkillDirectory(_0x20d21f[_0x6c4e51(0xee)](_0x6c4e51(0xf7)));throwIfSkillValidationFailed(_0x302299);const _0x3eec79=_0x302299[_0x6c4e51(0xf7)];if(_0x3bef4c===_0x6c4e51(0x10f)){const _0x5bc215=_0x473d9(_0x3eec79,_0x20d21f[_0x6c4e51(0xe7)],remoteFirstMetadataOptions()),_0x1bb1d5=await _0x251af9(_0x20d21f[_0x6c4e51(0xe7)],_0x5bc215[_0x6c4e51(0x103)]);throwIfBuiltinPushTarget(_0x1bb1d5);if(_0x1bb1d5)_0x3d6e78(_0x3eec79,_0x1bb1d5,_0x20d21f['appCode']);const _0x4cd572=_0x427f02(_0x3eec79,_0x20d21f[_0x6c4e51(0xe7)],_0x1bb1d5?{'targetScope':_0x6c4e51(0x10f),'ignoreInvalidMetadata':!![]}:remoteMissingCompanyReadOptions()),_0x20fa1c=await _0x494437(_0x20d21f[_0x6c4e51(0xe7)],_0x4cd572[_0x6c4e51(0xe9)],{'visibility':_0x6c4e51(0xf8)});throwIfPublishValidationFailed(_0x4cd572[_0x6c4e51(0x103)],_0x20fa1c);const _0xafa266=_0x20d21f[_0x6c4e51(0xfa)](_0x6c4e51(0xf2))||_0x20d21f[_0x6c4e51(0xfa)](_0x6c4e51(0x114));if(_0x20fa1c['warnings'][_0x6c4e51(0xf9)]>0x0&&!_0xafa266)throw CliErrors['validation'](_0x6c4e51(0x10b)+_0x4cd572['skillCode']+'.','Review\x20the\x20warnings\x20and\x20rerun\x20with\x20--confirm-warnings\x20to\x20submit:\x20'+_0x20fa1c['warnings']['join'](';\x20'));const _0x16433a=await _0x4a96e3(_0x20d21f[_0x6c4e51(0xe7)],_0x4cd572[_0x6c4e51(0xe9)],{'confirmWarnings':_0xafa266});return _0x5e4fb7(_0x3eec79,{..._0x16433a,'files':_0x4cd572[_0x6c4e51(0xe9)][_0x6c4e51(0xf1)]},_0x20d21f[_0x6c4e51(0xe7)],{'scope':'company'}),{'ok':!![],'data':{...summarizeRuntimeSkill(_0x16433a),'scope':_0x6c4e51(0x10f),'reviewState':_0x6c4e51(0x118),'submittedForReview':!![],'validation':{'warnings':_0x20fa1c[_0x6c4e51(0x117)]}},'message':_0x6c4e51(0xfb)+_0x4cd572[_0x6c4e51(0x103)]+_0x6c4e51(0xec)+(_0x16433a['version']??'(unknown)')+'\x20for\x20review'};}const _0x449829=_0x20d21f[_0x6c4e51(0xee)](_0x6c4e51(0xfd))[_0x6c4e51(0x110)](),_0x1c063d=Boolean(_0x449829),_0x5688d8=allowRetargetArgs(_0x1c063d),_0x28cf72=_0x473d9(_0x3eec79,_0x20d21f[_0x6c4e51(0xe7)],{...remoteFirstMetadataOptions(),..._0x5688d8[0x0]}),_0xb8f4c3=await _0x251af9(_0x20d21f['appCode'],_0x28cf72[_0x6c4e51(0x103)]);throwIfBuiltinPushTarget(_0xb8f4c3);if(_0xb8f4c3){if(_0xb8f4c3[_0x6c4e51(0x108)]!=='personal'){if(_0x1c063d)throw CliErrors['validation'](_0x6c4e51(0xf0)+_0x28cf72[_0x6c4e51(0x103)]+'\x20has\x20scope=\x22'+(_0xb8f4c3[_0x6c4e51(0x108)]??_0x6c4e51(0xfe))+'\x22.');_0x3d6e78(_0x3eec79,_0xb8f4c3,_0x20d21f['appCode']);}else!_0x1c063d&&_0x3d6e78(_0x3eec79,_0xb8f4c3,_0x20d21f[_0x6c4e51(0xe7)]);}const _0x60de62=_0x427f02(_0x3eec79,_0x20d21f['appCode'],_0xb8f4c3?remotePersonalReadOptions(_0x1c063d,_0x5688d8[0x0]):remoteMissingPersonalReadOptions(_0x5688d8[0x0])),_0x176e0b=_0xb8f4c3?.['scope']==='personal'&&_0xb8f4c3[_0x6c4e51(0x103)]===_0x60de62['skillCode']?_0xb8f4c3:undefined,_0x2a87a9=_0x1c063d&&_0x176e0b?withRetargetExistingMetadata(_0x60de62['input'],_0x176e0b,{'preferInputSkillName':Boolean(_0x60de62[_0x6c4e51(0x119)])}):_0x60de62[_0x6c4e51(0xe9)],_0x5e859e=_0x176e0b?await _0x53ed31(_0x60de62[_0x6c4e51(0x103)],_0x20d21f[_0x6c4e51(0xe7)],_0x2a87a9):await _0x31065d(_0x20d21f[_0x6c4e51(0xe7)],_0x2a87a9);let _0x103d5c=_0x5e859e;if(isMultiFileManifest(_0x60de62[_0x6c4e51(0xe9)]['files'])){const _0x532095=await _0x56d646(_0x6c4e51(0xea),_0x5e859e[_0x6c4e51(0x103)]||_0x60de62[_0x6c4e51(0x103)],_0x20d21f[_0x6c4e51(0xe7)]);_0xe3fb30(_0x60de62['input'][_0x6c4e51(0xf1)],_0x532095),_0x103d5c={..._0x5e859e,'files':_0x60de62[_0x6c4e51(0xe9)][_0x6c4e51(0xf1)]};}else{if(isPackageBackedManifest(_0x5e859e['files'])){const _0x471c15=await _0x56d646(_0x6c4e51(0xea),_0x5e859e['skillCode']||_0x60de62[_0x6c4e51(0x103)],_0x20d21f[_0x6c4e51(0xe7)]);_0x71d2e(_0x5e859e[_0x6c4e51(0xf1)],_0x471c15);}}_0x5e4fb7(_0x3eec79,_0x103d5c,_0x20d21f['appCode']);const _0x50427f=_0x1c063d?buildRetargetWarning(_0x28cf72[_0x6c4e51(0x115)],_0x20d21f[_0x6c4e51(0xe7)]):[];return{'ok':!![],'data':{...summarizeRuntimeSkill(_0x5e859e),'warnings':[..._0x302299['warnings'],..._0x50427f]},'message':_0x176e0b?'Updated\x20personal\x20Skill\x20'+_0x60de62['skillCode']:_0x6c4e51(0x109)+_0x60de62[_0x6c4e51(0x103)]};}function a49_0x435b(_0xf3db45,_0x2b4ff8){_0xf3db45=_0xf3db45-0xe6;const _0x52a09a=a49_0x52a0();let _0x435bba=_0x52a09a[_0xf3db45];return _0x435bba;}function a49_0x52a0(){const _0x37e892=['map','/publish','company','trim','27549zahWFj','2239325RLyrrd','PRIVATE','confirmWarnings','metadata','3937341XHkoUS','warnings','submitted','frontmatterDisplayName','5725084DqBTwe','valid','appCode','../../core/api-client.js','input','personal','9810vRfyEJ','\x20version\x20','1087dyWJJv','str','validation','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20remote\x20Skill\x20','files','confirm-warnings','authRequired','/api/cli/v1/skills/','../../skills/runtime-skill-sync.js','/publish/validate','dir','NAMESPACE_ONLY','length','bool','Submitted\x20company\x20Skill\x20','8720004jzdRCy','appcode','unknown','Validate\x20a\x20company\x20Skill\x20push\x20package\x20without\x20creating\x20a\x20version\x20or\x20review\x20task.','6383013IcMtNw','334TtLvUi','errors','skillCode','resolvedVersion','accessKey','path','8Cboodw','scope','Created\x20personal\x20Skill\x20','POST','Company\x20Skill\x20push\x20validation\x20reported\x20warning(s)\x20for\x20','\x20has\x20scope=\x22'];a49_0x52a0=function(){return _0x37e892;};return a49_0x52a0();}
|
|
1
|
+
(function(_0x3b3f14,_0xc221ee){const _0x16eb30=a49_0x9692,_0x34538b=_0x3b3f14();while(!![]){try{const _0xc50afa=-parseInt(_0x16eb30(0x16e))/0x1+-parseInt(_0x16eb30(0x13a))/0x2+parseInt(_0x16eb30(0x14e))/0x3*(parseInt(_0x16eb30(0x150))/0x4)+parseInt(_0x16eb30(0x13e))/0x5+parseInt(_0x16eb30(0x155))/0x6*(-parseInt(_0x16eb30(0x13d))/0x7)+parseInt(_0x16eb30(0x167))/0x8*(-parseInt(_0x16eb30(0x147))/0x9)+parseInt(_0x16eb30(0x161))/0xa;if(_0xc50afa===_0xc221ee)break;else _0x34538b['push'](_0x34538b['shift']());}catch(_0xc84680){_0x34538b['push'](_0x34538b['shift']());}}}(a49_0x5e1b,0x994f3));import{CliErrors}from'../../errors.js';import{isMultiFileManifest,isPackageBackedManifest}from'./manifest-helpers.js';import{remotePersonalReadOptions,remoteMissingCompanyReadOptions,remoteMissingPersonalReadOptions}from'./push-flow-helpers.js';import{allowRetargetArgs,buildRetargetWarning,remoteFirstMetadataOptions,resolvePushScope,runRemoteContentPreflight,throwIfBuiltinPushTarget,throwIfPublishValidationFailed}from'./push-flow-helpers.js';import{withRetargetExistingMetadata}from'./push-retarget.js';import{summarizeRuntimeSkill}from'./summary.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'./validate.js';function a49_0x9692(_0x5d8cce,_0x75da1a){_0x5d8cce=_0x5d8cce-0x13a;const _0x5e1bc1=a49_0x5e1b();let _0x9692a8=_0x5e1bc1[_0x5d8cce];return _0x9692a8;}function a49_0x5e1b(){const _0xa99e09=['Personal','str','POST','\x20for\x20review','545816UPZGvQ','accessKey','version','\x20Skill\x20','skillCode','savedSkill','Created\x20personal\x20Skill\x20','437959WfvqCo','confirmWarnings','Validate\x20a\x20company\x20Skill\x20push\x20package\x20without\x20creating\x20a\x20version\x20or\x20review\x20task.','path','/publish','warnings','status','2459012GZTnxp','bool','validation','133jIsLAA','1526615DFVOSD','remoteForPreflight','join','payload','PRIVATE','/api/cli/v1/skills/','company','../../core/api-client.js','Preview\x20a\x20personal\x20Skill\x20push\x20without\x20creating\x20or\x20updating\x20a\x20remote\x20Skill.','27nGTbFD','input','resolvedSlug','\x20has\x20scope=\x22','Submitted\x20company\x20Skill\x20','files','(unknown)','1592583NjNYaD','/publish/validate','4QsPyPw','trim','appCode','frontmatterDisplayName','authRequired','47442paLtkg','personal','NAMESPACE_ONLY','\x20version\x20','Updated\x20personal\x20Skill\x20','publishInput','../../skills/runtime-skill-sync.js','scope','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20remote\x20Skill\x20','map','existing','Company\x20Skill\x20push\x20validation\x20reported\x20warning(s)\x20for\x20','18141500bumZFM','dir'];a49_0x5e1b=function(){return _0xa99e09;};return a49_0x5e1b();}export async function skillPushDryRun(_0x56c2ac){const _0x32439a=a49_0x9692,{getRuntimeSkillByCode:_0x1c6e0c,validateRuntimeSkillPublish:_0x143fe6}=await import(_0x32439a(0x145)),{readPushDirectory:_0x14c7b5,resolvePushDirectoryIdentity:_0x57c51f}=await import(_0x32439a(0x15b));if(!_0x56c2ac[_0x32439a(0x168)])throw CliErrors[_0x32439a(0x154)]();const _0x52975a=resolvePushScope(_0x56c2ac),_0x143170=validateSkillDirectory(_0x56c2ac[_0x32439a(0x164)](_0x32439a(0x162)));throwIfSkillValidationFailed(_0x143170);const _0x22d4d3=_0x57c51f(_0x143170['dir'],_0x56c2ac[_0x32439a(0x152)],remoteFirstMetadataOptions()),_0x4489bc=await _0x1c6e0c(_0x56c2ac[_0x32439a(0x152)],_0x22d4d3[_0x32439a(0x16b)]);throwIfBuiltinPushTarget(_0x4489bc);if(_0x52975a===_0x32439a(0x144)){const _0xaf2571=_0x14c7b5(_0x143170[_0x32439a(0x162)],_0x56c2ac['appCode'],remoteMissingCompanyReadOptions()),_0x3e2c01=await _0x143fe6(_0x56c2ac[_0x32439a(0x152)],_0xaf2571[_0x32439a(0x148)],{'visibility':_0x32439a(0x157)});return{'method':_0x32439a(0x165),'url':_0x32439a(0x143)+_0x56c2ac[_0x32439a(0x152)]+_0x32439a(0x14f),'body':{'skillCode':_0xaf2571['skillCode'],'visibility':_0x32439a(0x157),'valid':_0x3e2c01['valid'],'errors':_0x3e2c01['errors'],'warnings':_0x3e2c01[_0x32439a(0x173)],'resolvedSlug':_0x3e2c01[_0x32439a(0x149)],'resolvedVersion':_0x3e2c01['resolvedVersion']},'description':_0x32439a(0x170)};}if(_0x4489bc&&_0x4489bc['scope']!==_0x32439a(0x156))throw CliErrors[_0x32439a(0x13c)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20remote\x20Skill\x20'+_0x22d4d3[_0x32439a(0x16b)]+_0x32439a(0x14a)+(_0x4489bc[_0x32439a(0x15c)]??'unknown')+'\x22.');const _0x506fa8=_0x14c7b5(_0x143170['dir'],_0x56c2ac[_0x32439a(0x152)],_0x4489bc?remotePersonalReadOptions(!![]):remoteMissingPersonalReadOptions());return{'method':_0x32439a(0x165),'url':'/api/cli/v1/skills/'+_0x56c2ac[_0x32439a(0x152)]+_0x32439a(0x172),'body':{'skillCode':_0x506fa8[_0x32439a(0x16b)],'visibility':_0x32439a(0x142),'files':_0x506fa8[_0x32439a(0x148)][_0x32439a(0x14c)]?.[_0x32439a(0x14c)][_0x32439a(0x15e)](_0x2c713f=>_0x2c713f[_0x32439a(0x171)])??[]},'description':_0x32439a(0x146)};}export async function skillPushExecute(_0x431642){const _0x3863c2=a49_0x9692,{createPersonalRuntimeSkill:_0x3a3995,downloadRuntimeSkillPackage:_0x4a95fb,getRuntimeSkillByCode:_0x98db4c,publishCompanyRuntimeSkill:_0x52f1f1,updatePersonalRuntimeSkill:_0x2bf3cf,validateRuntimeSkillPublish:_0x54ee1a}=await import(_0x3863c2(0x145)),{verifyRuntimeSkillPackage:_0x2a090e,verifyRuntimeSkillBundle:_0x5692cb,readPushDirectory:_0x5c9b66,refreshPushDirectoryMetadataFromRemote:_0x1f24ab,recordPushedRuntimeSkill:_0xaa28,resolvePushDirectoryIdentity:_0x43f3bc}=await import(_0x3863c2(0x15b));if(!_0x431642[_0x3863c2(0x168)])throw CliErrors[_0x3863c2(0x154)]();const _0x1575a0=resolvePushScope(_0x431642),_0x3e4066=validateSkillDirectory(_0x431642[_0x3863c2(0x164)]('dir'));throwIfSkillValidationFailed(_0x3e4066);const _0x291ed8=_0x3e4066[_0x3863c2(0x162)];let _0x170a45;if(_0x1575a0===_0x3863c2(0x144)){const _0x15e612=_0x43f3bc(_0x291ed8,_0x431642[_0x3863c2(0x152)],remoteFirstMetadataOptions()),_0x4c15e5=await _0x98db4c(_0x431642['appCode'],_0x15e612[_0x3863c2(0x16b)]);throwIfBuiltinPushTarget(_0x4c15e5);if(_0x4c15e5)_0x1f24ab(_0x291ed8,_0x4c15e5,_0x431642[_0x3863c2(0x152)]);const _0x8a7c04=_0x5c9b66(_0x291ed8,_0x431642[_0x3863c2(0x152)],_0x4c15e5?{'targetScope':_0x3863c2(0x144),'ignoreInvalidMetadata':!![]}:remoteMissingCompanyReadOptions());_0x170a45={'scope':_0x3863c2(0x144),'payload':_0x8a7c04,'publishInput':_0x8a7c04[_0x3863c2(0x148)],'remoteForPreflight':_0x4c15e5,'warnings':[]};}else{const _0x20981a=_0x431642[_0x3863c2(0x164)]('appcode')[_0x3863c2(0x151)](),_0x9a45fe=Boolean(_0x20981a),_0x3b3c69=allowRetargetArgs(_0x9a45fe),_0x2a9cd9=_0x43f3bc(_0x291ed8,_0x431642[_0x3863c2(0x152)],{...remoteFirstMetadataOptions(),..._0x3b3c69[0x0]}),_0xf4a870=await _0x98db4c(_0x431642['appCode'],_0x2a9cd9[_0x3863c2(0x16b)]);throwIfBuiltinPushTarget(_0xf4a870);if(_0xf4a870){if(_0xf4a870[_0x3863c2(0x15c)]!==_0x3863c2(0x156)){if(_0x9a45fe)throw CliErrors[_0x3863c2(0x13c)](_0x3863c2(0x15d)+_0x2a9cd9['skillCode']+_0x3863c2(0x14a)+(_0xf4a870[_0x3863c2(0x15c)]??'unknown')+'\x22.');_0x1f24ab(_0x291ed8,_0xf4a870,_0x431642[_0x3863c2(0x152)]);}else!_0x9a45fe&&_0x1f24ab(_0x291ed8,_0xf4a870,_0x431642[_0x3863c2(0x152)]);}const _0x320925=_0x5c9b66(_0x291ed8,_0x431642[_0x3863c2(0x152)],_0xf4a870?remotePersonalReadOptions(_0x9a45fe,_0x3b3c69[0x0]):remoteMissingPersonalReadOptions(_0x3b3c69[0x0])),_0x1965fa=_0xf4a870?.[_0x3863c2(0x15c)]===_0x3863c2(0x156)&&_0xf4a870[_0x3863c2(0x16b)]===_0x320925[_0x3863c2(0x16b)]?_0xf4a870:undefined,_0x401990=_0x9a45fe&&_0x1965fa?withRetargetExistingMetadata(_0x320925['input'],_0x1965fa,{'preferInputSkillName':Boolean(_0x320925[_0x3863c2(0x153)])}):_0x320925[_0x3863c2(0x148)],_0x369587=_0x9a45fe?buildRetargetWarning(_0x2a9cd9['metadata'],_0x431642['appCode']):[];_0x170a45={'scope':_0x3863c2(0x156),'payload':_0x320925,'publishInput':_0x401990,'remoteForPreflight':_0x1965fa,'existing':_0x1965fa,'warnings':[..._0x3e4066['warnings'],..._0x369587]};}const _0x323858=await runRemoteContentPreflight({'scope':_0x170a45['scope'],'remote':_0x170a45[_0x3863c2(0x13f)],'publishInput':_0x170a45[_0x3863c2(0x15a)],'skillCode':_0x170a45[_0x3863c2(0x141)][_0x3863c2(0x16b)],'appCode':_0x431642[_0x3863c2(0x152)],'downloadRuntimeSkillPackage':_0x4a95fb,'verifyRuntimeSkillBundle':_0x5692cb});if(_0x323858[_0x3863c2(0x174)]==='identical')return _0x170a45[_0x3863c2(0x15c)]===_0x3863c2(0x144)?_0xaa28(_0x291ed8,_0x323858[_0x3863c2(0x16c)],_0x431642['appCode'],{'scope':_0x3863c2(0x144)}):_0xaa28(_0x291ed8,_0x323858[_0x3863c2(0x16c)],_0x431642[_0x3863c2(0x152)]),{'ok':!![],'data':{...summarizeRuntimeSkill(_0x323858[_0x3863c2(0x16c)]),'scope':_0x170a45[_0x3863c2(0x15c)],..._0x170a45[_0x3863c2(0x15c)]==='personal'?{'warnings':_0x170a45['warnings']}:{},'alreadyPublished':!![],'contentIdentical':!![]},'message':scopeLabel(_0x170a45[_0x3863c2(0x15c)])+_0x3863c2(0x16a)+_0x170a45[_0x3863c2(0x141)][_0x3863c2(0x16b)]+'\x20is\x20already\x20published\x20and\x20content\x20is\x20identical'};if(_0x170a45['scope']===_0x3863c2(0x144)){const _0x5ec70c=await _0x54ee1a(_0x431642['appCode'],_0x170a45[_0x3863c2(0x15a)],{'visibility':_0x3863c2(0x157)});throwIfPublishValidationFailed(_0x170a45[_0x3863c2(0x141)]['skillCode'],_0x5ec70c);const _0x319adc=_0x431642[_0x3863c2(0x13b)]('confirm-warnings')||_0x431642[_0x3863c2(0x13b)](_0x3863c2(0x16f));if(_0x5ec70c[_0x3863c2(0x173)]['length']>0x0&&!_0x319adc)throw CliErrors[_0x3863c2(0x13c)](_0x3863c2(0x160)+_0x170a45[_0x3863c2(0x141)][_0x3863c2(0x16b)]+'.','Review\x20the\x20warnings\x20and\x20rerun\x20with\x20--confirm-warnings\x20to\x20submit:\x20'+_0x5ec70c[_0x3863c2(0x173)][_0x3863c2(0x140)](';\x20'));const _0x4262a3=await _0x52f1f1(_0x431642[_0x3863c2(0x152)],_0x170a45['publishInput'],{'confirmWarnings':_0x319adc});return _0xaa28(_0x291ed8,{..._0x4262a3,'files':_0x170a45[_0x3863c2(0x15a)]['files']},_0x431642[_0x3863c2(0x152)],{'scope':_0x3863c2(0x144)}),{'ok':!![],'data':{...summarizeRuntimeSkill(_0x4262a3),'scope':_0x3863c2(0x144),'reviewState':'submitted','submittedForReview':!![],'validation':{'warnings':_0x5ec70c[_0x3863c2(0x173)]}},'message':_0x3863c2(0x14b)+_0x170a45[_0x3863c2(0x141)][_0x3863c2(0x16b)]+_0x3863c2(0x158)+(_0x4262a3[_0x3863c2(0x169)]??_0x3863c2(0x14d))+_0x3863c2(0x166)};}const _0x59f6e4=_0x170a45['existing']?await _0x2bf3cf(_0x170a45['payload'][_0x3863c2(0x16b)],_0x431642[_0x3863c2(0x152)],_0x170a45['publishInput']):await _0x3a3995(_0x431642['appCode'],_0x170a45[_0x3863c2(0x15a)]);let _0x1f1063=_0x59f6e4;if(isMultiFileManifest(_0x170a45[_0x3863c2(0x15a)]['files'])){const _0xedef4c=await _0x4a95fb(_0x3863c2(0x156),_0x59f6e4[_0x3863c2(0x16b)]||_0x170a45[_0x3863c2(0x141)]['skillCode'],_0x431642['appCode']);_0x5692cb(_0x170a45[_0x3863c2(0x15a)][_0x3863c2(0x14c)],_0xedef4c),_0x1f1063={..._0x59f6e4,'files':_0x170a45[_0x3863c2(0x15a)][_0x3863c2(0x14c)]};}else{if(isPackageBackedManifest(_0x59f6e4[_0x3863c2(0x14c)])){const _0x69344b=await _0x4a95fb(_0x3863c2(0x156),_0x59f6e4['skillCode']||_0x170a45[_0x3863c2(0x141)][_0x3863c2(0x16b)],_0x431642[_0x3863c2(0x152)]);_0x2a090e(_0x59f6e4[_0x3863c2(0x14c)],_0x69344b);}}return _0xaa28(_0x291ed8,_0x1f1063,_0x431642[_0x3863c2(0x152)]),{'ok':!![],'data':{...summarizeRuntimeSkill(_0x59f6e4),'warnings':_0x170a45[_0x3863c2(0x173)]},'message':_0x170a45[_0x3863c2(0x15f)]?_0x3863c2(0x159)+_0x170a45[_0x3863c2(0x141)][_0x3863c2(0x16b)]:_0x3863c2(0x16d)+_0x170a45[_0x3863c2(0x141)][_0x3863c2(0x16b)]};}function scopeLabel(_0x3c5ad3){const _0x35ade2=a49_0x9692;return _0x3c5ad3===_0x35ade2(0x144)?'Company':_0x35ade2(0x163);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a50_0x22de(){const _0x172667=['Local\x20Skill\x20metadata\x20appCode\x20','identical','\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20','100461tQnhku','personal','join','warning','not-applicable','verifyRuntimeSkillBundle','validation','80310kHsPfE','valid','7529jRiEYx','version','995208CppcWu','scope','lovrabet.skill.json','Builtin\x20Skill\x20','176qGdsmQ','publishInput','SkillHub\x20validation\x20returned\x20invalid.','Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.','17991oNMohY','appCode','736212nhyVYY','skill\x20push\x20supports\x20--scope\x20personal\x20or\x20--scope\x20company;\x20received\x20\x22','builtin','errors','skill-metadata-appcode-retargeted','12KmPERE','Company\x20Skill\x20push\x20validation\x20failed\x20for\x20','skillCode','files','content','remote','length','554645kjImBt','str'];a50_0x22de=function(){return _0x172667;};return a50_0x22de();}(function(_0xd6fb0f,_0x2f4d30){const _0x563d1f=a50_0x41dd,_0x55987b=_0xd6fb0f();while(!![]){try{const _0x585421=parseInt(_0x563d1f(0xb9))/0x1*(-parseInt(_0x563d1f(0xa4))/0x2)+parseInt(_0x563d1f(0xb0))/0x3+-parseInt(_0x563d1f(0x9f))/0x4+parseInt(_0x563d1f(0xb7))/0x5+parseInt(_0x563d1f(0xbb))/0x6+parseInt(_0x563d1f(0xab))/0x7+parseInt(_0x563d1f(0xbf))/0x8*(parseInt(_0x563d1f(0x9d))/0x9);if(_0x585421===_0x2f4d30)break;else _0x55987b['push'](_0x55987b['shift']());}catch(_0x4017f9){_0x55987b['push'](_0x55987b['shift']());}}}(a50_0x22de,0x1ab5b));import{CliErrors}from'../../errors.js';export function resolvePushScope(_0x3df402){const _0x3e91db=a50_0x41dd,_0x18f726=_0x3df402[_0x3e91db(0xac)](_0x3e91db(0xbc))||_0x3e91db(0xb1);if(_0x18f726===_0x3e91db(0xb1)||_0x18f726==='company')return _0x18f726;throw CliErrors['validation'](_0x3e91db(0xa0)+_0x18f726+'\x22.');}export function allowRetargetArgs(_0x3c58ff){return _0x3c58ff?[{'allowAppCodeRetarget':!![]}]:[];}export function remoteFirstMetadataOptions(){return{'ignoreInvalidMetadata':!![],'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataSkillCode':!![]};}export function remoteMissingPayloadOptions(){return{'ignoreMetadataForPayload':!![],'ignoreMetadataScope':!![],'ignoreMetadataSkillCode':!![]};}export function remoteMissingCompanyReadOptions(){return{'targetScope':'company',...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions()};}export function remoteMissingPersonalReadOptions(_0x2bc110={}){return{...remoteFirstMetadataOptions(),...remoteMissingPayloadOptions(),..._0x2bc110};}export function remotePersonalReadOptions(_0x54ae7a,_0x39a4ff={}){return{'ignoreInvalidMetadata':!![],..._0x54ae7a?{'ignoreMetadataAppCodeMismatch':!![],'ignoreMetadataScope':!![]}:{},..._0x39a4ff};}function a50_0x41dd(_0x6220a5,_0x2e2bf1){_0x6220a5=_0x6220a5-0x9a;const _0x22deb6=a50_0x22de();let _0x41ddd8=_0x22deb6[_0x6220a5];return _0x41ddd8;}export function throwIfBuiltinPushTarget(_0x1339c4){const _0x3543a3=a50_0x41dd;if(_0x1339c4?.[_0x3543a3(0xbc)]!==_0x3543a3(0xa1))return;throw CliErrors['validation'](_0x3543a3(0xbe)+(_0x1339c4[_0x3543a3(0xa6)]??'(unknown)')+'\x20cannot\x20be\x20pushed.','Use\x20a\x20different\x20skillCode\x20when\x20submitting\x20a\x20personal\x20or\x20company\x20Skill.');}export function throwIfPublishValidationFailed(_0x1cdc53,_0x524999){const _0xf55922=a50_0x41dd;if(_0x524999[_0xf55922(0xb8)]&&_0x524999[_0xf55922(0xa2)][_0xf55922(0xaa)]===0x0)return;const _0x514392=_0x524999[_0xf55922(0xa2)][_0xf55922(0xaa)]>0x0?_0x524999[_0xf55922(0xa2)][_0xf55922(0xb2)](';\x20'):_0xf55922(0x9b);throw CliErrors[_0xf55922(0xb6)](_0xf55922(0xa5)+_0x1cdc53+'.',_0x514392);}export function buildRetargetWarning(_0x22b55a,_0xe12d75){const _0xe3994f=a50_0x41dd;if(!_0x22b55a?.[_0xe3994f(0x9e)]||_0x22b55a[_0xe3994f(0x9e)]===_0xe12d75)return[];return[{'level':_0xe3994f(0xb3),'ruleId':_0xe3994f(0xa3),'file':_0xe3994f(0xbd),'message':_0xe3994f(0xad)+_0x22b55a['appCode']+_0xe3994f(0xaf)+_0xe12d75+'\x20after\x20successful\x20push.','suggestion':_0xe3994f(0x9c)}];}export async function runRemoteContentPreflight(_0xdd1762){const _0x7735e7=a50_0x41dd;if(!_0xdd1762[_0x7735e7(0xa9)]||_0xdd1762[_0x7735e7(0xa9)][_0x7735e7(0xbc)]!==_0xdd1762['scope']||!_0xdd1762[_0x7735e7(0x9a)]['files'])return{'status':_0x7735e7(0xb4)};const _0x3dd1d6=_0xdd1762['remote'][_0x7735e7(0xa6)]||_0xdd1762[_0x7735e7(0xa6)];if(!_0x3dd1d6)return{'status':'not-applicable'};const _0xd5a566=await _0xdd1762['downloadRuntimeSkillPackage'](_0xdd1762['scope'],_0x3dd1d6,_0xdd1762[_0x7735e7(0x9e)],_0xdd1762[_0x7735e7(0xa9)][_0x7735e7(0xba)]);try{_0xdd1762[_0x7735e7(0xb5)](_0xdd1762[_0x7735e7(0x9a)][_0x7735e7(0xa7)],_0xd5a566);}catch{return{'status':'different'};}return{'status':_0x7735e7(0xae),'savedSkill':{..._0xdd1762[_0x7735e7(0xa9)],'content':_0xdd1762[_0x7735e7(0x9a)][_0x7735e7(0xa8)],'files':_0xdd1762[_0x7735e7(0x9a)][_0x7735e7(0xa7)]}};}
|