@lovrabet/lovrabet-cli 2.1.22-beta.2 → 2.1.22-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/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x50fbcc,_0x26f8ef){const _0x5e474d=a39_0x137e,_0x2c1455=_0x50fbcc();while(!![]){try{const _0x186b9c=parseInt(_0x5e474d(0xe4))/0x1*(parseInt(_0x5e474d(0xcb))/0x2)+parseInt(_0x5e474d(0xc6))/0x3*(parseInt(_0x5e474d(0xbb))/0x4)+parseInt(_0x5e474d(0xca))/0x5*(parseInt(_0x5e474d(0xe9))/0x6)+-parseInt(_0x5e474d(0x105))/0x7*(parseInt(_0x5e474d(0x118))/0x8)+parseInt(_0x5e474d(0xb8))/0x9*(parseInt(_0x5e474d(0xd1))/0xa)+parseInt(_0x5e474d(0xe7))/0xb+-parseInt(_0x5e474d(0xee))/0xc*(parseInt(_0x5e474d(0x10d))/0xd);if(_0x186b9c===_0x26f8ef)break;else _0x2c1455['push'](_0x2c1455['shift']());}catch(_0x178444){_0x2c1455['push'](_0x2c1455['shift']());}}}(a39_0x43fb,0x8bf09));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(_0x34a4ac,_0x2c1b0d){const _0x17562a=a39_0x137e,_0x4c0aa1=listLocalServiceTrees();let _0x1640c0;for(const _0x33ee61 of _0x4c0aa1){const _0x32706d=matchServiceTreeCommand(_0x33ee61,_0x34a4ac);if(!_0x32706d)continue;(!_0x1640c0||_0x32706d[_0x17562a(0x109)]['fullPath'][_0x17562a(0xdf)]>_0x1640c0[_0x17562a(0x109)][_0x17562a(0xff)][_0x17562a(0xdf)])&&(_0x1640c0={'tree':_0x33ee61,'command':_0x32706d[_0x17562a(0x109)],'remainingArgs':_0x32706d[_0x17562a(0xc3)]});}if(!_0x1640c0)return undefined;const _0x1ceb7c={..._0x2c1b0d};return applyAppBinding(_0x1640c0[_0x17562a(0xe3)],_0x1640c0[_0x17562a(0x109)],_0x1ceb7c),{'definition':buildDynamicCommandDefinition(_0x1640c0[_0x17562a(0xe3)],_0x1640c0[_0x17562a(0x109)]),'args':_0x1640c0['remainingArgs'],'flags':_0x1ceb7c,'tree':_0x1640c0['tree'],'command':_0x1640c0[_0x17562a(0x109)]};}export function generateDynamicServiceHelp(_0x1bccaa){const _0x10e0d2=a39_0x137e,_0x2da328=listLocalServiceTrees()[_0x10e0d2(0xfa)](_0x493431=>_0x493431[_0x10e0d2(0xb9)]['code']===_0x1bccaa);if(!_0x2da328)return undefined;const _0x32a55c=[CLI_BIN_NAME+'\x20'+_0x1bccaa+_0x10e0d2(0xf7),'',_0x2da328[_0x10e0d2(0xb9)][_0x10e0d2(0xda)]||_0x1bccaa,_0x2da328[_0x10e0d2(0xb9)][_0x10e0d2(0x111)]?'\x20\x20'+_0x2da328[_0x10e0d2(0xb9)][_0x10e0d2(0x111)]:'','',_0x10e0d2(0xc2),..._0x2da328['commands'][_0x10e0d2(0xd8)](_0x3dc94f=>{const _0x1cf615=_0x10e0d2,_0x2b730d=_0x3dc94f[_0x1cf615(0xff)][_0x1cf615(0x115)](0x1)[_0x1cf615(0xc9)]('\x20'),_0x5bf004=_0x3dc94f['risk']===_0x1cf615(0xfc)?'':'\x20['+_0x3dc94f[_0x1cf615(0x114)]+']';return'\x20\x20'+_0x2b730d[_0x1cf615(0xf2)](0x18)+'\x20'+(_0x3dc94f[_0x1cf615(0x111)]||'')+_0x5bf004;}),'','Use\x20`'+CLI_BIN_NAME+_0x10e0d2(0x104)+_0x1bccaa+_0x10e0d2(0xc4)][_0x10e0d2(0xf1)](Boolean);return _0x32a55c['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x4a9a8d=>{const _0x548b21=a39_0x137e,_0x1abedf=_0x4a9a8d[_0x548b21(0xfd)];return{'service':_0x1abedf['service'][_0x548b21(0xd0)],'label':_0x1abedf['service'][_0x548b21(0xda)]||_0x1abedf['service'][_0x548b21(0xd0)],'commands':_0x1abedf['commands'][_0x548b21(0xd8)](_0x45683d=>({'command':dynamicCommandName(_0x45683d),'description':_0x45683d[_0x548b21(0x111)]||'Run\x20service\x20command\x20'+_0x45683d[_0x548b21(0xf3)],'tag':riskTag(_0x45683d[_0x548b21(0x114)])}))};});}export function getDynamicServiceEntry(_0x41ff92){const _0x2ea695=a39_0x137e;return listDynamicServiceEntries()[_0x2ea695(0xfa)](_0x5192bc=>_0x5192bc['service']===_0x41ff92);}export function listDynamicServiceDefinitions(_0x4dd55b){const _0x17709f=a39_0x137e;return listLocalServiceTrees()[_0x17709f(0xf1)](_0x229d9e=>!_0x4dd55b||_0x229d9e['service'][_0x17709f(0xd0)]===_0x4dd55b)[_0x17709f(0xea)](_0x1357de=>_0x1357de[_0x17709f(0x10a)][_0x17709f(0xd8)](_0x46dd2a=>buildDynamicCommandDefinition(_0x1357de,_0x46dd2a)));}export function getDynamicServiceDefinitions(_0x5b144d){const _0x5012a7=a39_0x137e,_0x5c6a59=listDynamicServiceDefinitions(_0x5b144d);return _0x5c6a59[_0x5012a7(0xdf)]>0x0?_0x5c6a59:undefined;}export function findDynamicServiceDefinition(_0x13b504,_0x27732d){const _0x51a3e1=a39_0x137e;return listDynamicServiceDefinitions(_0x13b504)[_0x51a3e1(0xfa)](_0x48665f=>_0x48665f[_0x51a3e1(0x109)]===_0x27732d);}function a39_0x137e(_0x279414,_0x2102bc){_0x279414=_0x279414-0xb8;const _0x43fbf4=a39_0x43fb();let _0x137e8c=_0x43fbf4[_0x279414];return _0x137e8c;}export function buildDynamicCommandDefinition(_0x4f30c5,_0x21eb5d){const _0x54e693=a39_0x137e;return{'service':_0x4f30c5[_0x54e693(0xb9)]['code'],'command':dynamicCommandName(_0x21eb5d),'description':_0x21eb5d[_0x54e693(0x111)]||_0x54e693(0xcf)+_0x21eb5d['cliPath'],'risk':_0x21eb5d[_0x54e693(0x114)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x21eb5d['args'][_0x54e693(0xd8)](_0x485833=>({'name':_0x485833[_0x54e693(0xda)],'description':_0x485833[_0x54e693(0x111)]||_0x485833[_0x54e693(0xda)],'required':_0x485833[_0x54e693(0xcd)]})),'flags':_0x21eb5d[_0x54e693(0xe8)][_0x54e693(0xd8)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x21eb5d),async 'dryRun'(_0x4d0aa5){const _0x4b0b6a=_0x54e693,_0xc9f272=await compilePlan(_0x21eb5d,_0x4d0aa5);return{'method':_0x4b0b6a(0xbf),'url':_0x21eb5d[_0x4b0b6a(0xf3)],'body':{'target':targetPreview(_0xc9f272),'params':_0xc9f272[_0x4b0b6a(0x119)]},'description':_0x4b0b6a(0xce)+_0x21eb5d[_0x4b0b6a(0xf3)]};},async 'execute'(_0x3e8460){const _0x6fc6bc=_0x54e693,_0x48c9c7=await compilePlan(_0x21eb5d,_0x3e8460),_0x1eeeb5=Date[_0x6fc6bc(0x102)](),_0x2645a5=await executePlan(_0x48c9c7,_0x21eb5d,_0x3e8460),_0x46f9a6=Date[_0x6fc6bc(0x102)]()-_0x1eeeb5;return{'ok':!![],'data':{'service':_0x4f30c5[_0x6fc6bc(0xb9)],'command':_0x21eb5d[_0x6fc6bc(0xf3)],'target':targetPreview(_0x48c9c7),'result':_0x2645a5,'elapsed':_0x46f9a6},'message':_0x6fc6bc(0xc0)+_0x21eb5d[_0x6fc6bc(0xf3)]+_0x6fc6bc(0xd2)+_0x46f9a6+'ms'};}};}function dynamicCommandName(_0x41775b){const _0x57224d=a39_0x137e;return _0x41775b['fullPath'][_0x57224d(0x115)](0x1)[_0x57224d(0xc9)]('\x20');}function riskTag(_0xf04fc3){const _0x3186f6=a39_0x137e;return _0xf04fc3===_0x3186f6(0xfc)?'':'\x20\x20['+_0xf04fc3+']';}function flagToCommandFlag(_0x448ab5){const _0x51de12=a39_0x137e;return{'name':_0x448ab5['cliName'],'type':_0x448ab5[_0x51de12(0xdc)]===_0x51de12(0x112)?'string':_0x448ab5[_0x51de12(0xdc)],'description':_0x448ab5['description']||_0x448ab5[_0x51de12(0xda)],'required':_0x448ab5[_0x51de12(0xcd)],'default':isPrimitiveFlagDefault(_0x448ab5['default'])?_0x448ab5[_0x51de12(0xf9)]:undefined,'enum':_0x448ab5['enum']};}async function compilePlan(_0x1cc4b5,_0x40afff){const _0x1c5052=a39_0x137e;return compileServiceTreeCommand(_0x1cc4b5,{'flags':_0x40afff[_0x1c5052(0xf5)],'args':_0x40afff['args'],'context':await buildServiceContext(_0x1cc4b5,_0x40afff)});}async function buildServiceContext(_0x3dc27,_0x20d5a2){const _0x1f5190=a39_0x137e,_0x46960e={'appCode':_0x20d5a2['appCode'],'env':_0x20d5a2[_0x1f5190(0x103)],'envName':_0x20d5a2['envName']};if(!usesRuntimeContext(_0x3dc27))return _0x46960e;const _0x2025b6=await getLoginUserInfo(),_0xfff729=pickFirst(_0x2025b6[_0x1f5190(0x107)],_0x2025b6['id']);return{..._0x46960e,'user':_0x2025b6,'userId':_0xfff729,'id':_0x2025b6['id'],'username':pickFirst(_0x2025b6[_0x1f5190(0x106)],_0x2025b6[_0x1f5190(0xfe)],_0x2025b6[_0x1f5190(0x117)]),'userName':_0x2025b6[_0x1f5190(0xfe)],'nickname':pickFirst(_0x2025b6[_0x1f5190(0xc5)],_0x2025b6[_0x1f5190(0xf4)]),'nickName':_0x2025b6[_0x1f5190(0xf4)],'tenantCode':_0x2025b6[_0x1f5190(0x10f)],'employeeId':_0x2025b6[_0x1f5190(0xf6)]};}function usesRuntimeContext(_0x1e17dc){const _0x287121=a39_0x137e;return _0x1e17dc['mapTo'][_0x287121(0x11a)](_0x57815d=>typeof _0x57815d['source']===_0x287121(0xc7)&&(_0x57815d[_0x287121(0xba)][_0x287121(0xde)](_0x287121(0x101))||_0x57815d[_0x287121(0xba)]['startsWith'](_0x287121(0x11c))));}function pickFirst(..._0x3b5e05){const _0x504ba2=a39_0x137e;return _0x3b5e05[_0x504ba2(0xfa)](_0x456176=>_0x456176!==undefined&&_0x456176!==null);}async function executePlan(_0x1aefab,_0x8bc0af,_0x250db2){const _0xc7f6cb=a39_0x137e;if(_0x1aefab[_0xc7f6cb(0xdb)]==='data'){const _0x599e48=await resolveDatasetCode(_0x1aefab,_0x8bc0af,_0x250db2);return executeData(_0x599e48,_0x1aefab['command'],_0x1aefab[_0xc7f6cb(0x119)]);}if(_0x1aefab['kind']===_0xc7f6cb(0xe5)){if(!_0x1aefab[_0xc7f6cb(0x10e)])throw CliErrors[_0xc7f6cb(0xbc)](_0xc7f6cb(0xc0)+_0x8bc0af['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x1aefab[_0xc7f6cb(0x10e)],normalizeScalarParams(_0x1aefab[_0xc7f6cb(0x119)]));}if(_0x1aefab[_0xc7f6cb(0xdb)]===_0xc7f6cb(0xd3)){const _0x25a332=_0x1aefab['scriptName']||_0x1aefab['bffCode']||(_0x1aefab[_0xc7f6cb(0xfb)]==null?'':String(_0x1aefab[_0xc7f6cb(0xfb)]));if(!_0x25a332)throw CliErrors[_0xc7f6cb(0xbc)]('Service\x20command\x20'+_0x8bc0af[_0xc7f6cb(0xf3)]+_0xc7f6cb(0xef));return executeSdkBff(_0x25a332,_0x1aefab[_0xc7f6cb(0x119)]);}throw CliErrors['validation']('Unsupported\x20service\x20target\x20kind:\x20'+_0x1aefab[_0xc7f6cb(0xdb)]);}async function resolveDatasetCode(_0x3bbd67,_0x1ca1cc,_0x25ce66){const _0x54ac77=a39_0x137e;if(_0x3bbd67['datasetCode'])return _0x3bbd67[_0x54ac77(0x10c)];if(!_0x3bbd67[_0x54ac77(0x113)])throw CliErrors[_0x54ac77(0xbc)](_0x54ac77(0xc0)+_0x1ca1cc[_0x54ac77(0xf3)]+_0x54ac77(0x10b));const _0x221bf9=await listDatasets(_0x25ce66[_0x54ac77(0xe0)]),_0xe2a758=_0x221bf9['find'](_0x535416=>_0x535416[_0x54ac77(0xbe)]?.[_0x54ac77(0xec)]===_0x3bbd67[_0x54ac77(0x113)]);if(!_0xe2a758?.[_0x54ac77(0xd0)])throw CliErrors[_0x54ac77(0xbc)](_0x54ac77(0x108)+_0x3bbd67[_0x54ac77(0x113)]+_0x54ac77(0xd5)+_0x25ce66[_0x54ac77(0xe0)]+'.',_0x54ac77(0x110));return _0xe2a758['code'];}function a39_0x43fb(){const _0x2244c0=['find','bffId','read','normalizedManifest','userName','fullPath','\x20\x20\x20\x20command:\x20','context.','now','envName','\x20service\x20detail\x20--service\x20','28WuXNXY','username','userId','Cannot\x20resolve\x20datatable\x20\x22','command','commands','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','datasetCode','39blZGhq','sqlCode','tenantCode','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','description','json','datatable','risk','slice','\x20\x20\x20\x20functionName:\x20','loginName','1683584pOJpBn','params','some','\x20\x20\x20\x20','ctx.','4635693KjZvDJ','service','source','8jYLmKf','validation','\x22\x20in\x20service\x20command\x20','dbtableConfig','SERVICE_TREE','Service\x20command\x20','trim','Commands:','remainingArgs','`\x20to\x20inspect\x20the\x20manifest.','nickname','501726EAPxgV','string','app','join','5mIhgDw','225122vNsuZE','env','required','Preview\x20dynamic\x20service\x20command:\x20','Run\x20service\x20command\x20','code','10FaSJoC','\x20completed\x20in\x20','bff','appcode','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20->\x20','target','map','\x20\x20\x20\x20datatable:\x20','name','kind','type','number','startsWith','length','appCode','appRef','scriptName','tree','3krAqTg','sql','mapTo','4332163wXaoMY','flags','6199614wXDKGZ','flatMap','push','tableName','appBindings','4797444ekHzXE','\x20requires\x20target.functionName.','Unknown\x20appRef\x20\x22','filter','padEnd','cliPath','nickName','rawFlags','employeeId','\x20<command>\x20[flags]','\x20\x20\x20\x20sqlCode:\x20','default'];a39_0x43fb=function(){return _0x2244c0;};return a39_0x43fb();}function applyAppBinding(_0x3045b3,_0x5b7c42,_0x109ef7){const _0x3c747a=a39_0x137e,_0x3f6f33=_0x5b7c42[_0x3c747a(0xd7)]['appRef'];if(!_0x3f6f33)return;const _0x298f91=_0x3045b3[_0x3c747a(0xed)][_0x3f6f33];if(!_0x298f91)throw CliErrors['validation'](_0x3c747a(0xf0)+_0x3f6f33+_0x3c747a(0xbd)+_0x5b7c42['cliPath']+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x19de95=_0x298f91[_0x3c747a(0xd4)]||_0x298f91[_0x3c747a(0xe0)];_0x19de95&&!hasText(_0x109ef7[_0x3c747a(0xd4)])&&(_0x109ef7[_0x3c747a(0xd4)]=_0x19de95),_0x298f91['app']&&!hasText(_0x109ef7[_0x3c747a(0xc8)])&&!hasText(_0x109ef7[_0x3c747a(0xd4)])&&(_0x109ef7['app']=_0x298f91[_0x3c747a(0xc8)]),_0x298f91[_0x3c747a(0xcc)]&&!hasText(_0x109ef7['env'])&&(_0x109ef7[_0x3c747a(0xcc)]=_0x298f91[_0x3c747a(0xcc)]);}function renderDynamicCommandHelp(_0xd23a73){const _0x34e458=a39_0x137e,_0x355f02=['\x20\x20SERVICE\x20TREE\x20TARGET','\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0xd23a73[_0x34e458(0xd7)]['kind'],_0x34e458(0x100)+_0xd23a73['target'][_0x34e458(0x109)]];if(_0xd23a73['target']['datasetCode'])_0x355f02[_0x34e458(0xeb)]('\x20\x20\x20\x20datasetCode:\x20'+_0xd23a73[_0x34e458(0xd7)][_0x34e458(0x10c)]);if(_0xd23a73[_0x34e458(0xd7)][_0x34e458(0x113)])_0x355f02[_0x34e458(0xeb)](_0x34e458(0xd9)+_0xd23a73[_0x34e458(0xd7)]['datatable']);if(_0xd23a73[_0x34e458(0xd7)]['sqlCode'])_0x355f02[_0x34e458(0xeb)](_0x34e458(0xf8)+_0xd23a73[_0x34e458(0xd7)][_0x34e458(0x10e)]);if(_0xd23a73['target'][_0x34e458(0xe2)])_0x355f02[_0x34e458(0xeb)](_0x34e458(0x116)+_0xd23a73[_0x34e458(0xd7)][_0x34e458(0xe2)]);if(_0xd23a73['mapTo'][_0x34e458(0xdf)]>0x0){_0x355f02[_0x34e458(0xeb)]('','\x20\x20MAP\x20TO');for(const _0x362176 of _0xd23a73[_0x34e458(0xe6)]){_0x355f02[_0x34e458(0xeb)](_0x34e458(0x11b)+(_0x362176['source']||'const')+_0x34e458(0xd6)+_0x362176['target']+(_0x362176['operator']?'.'+_0x362176['operator']:''));}}return _0x355f02[_0x34e458(0xc9)]('\x0a');}function targetPreview(_0x9e4bc1){const _0x419cf0=a39_0x137e;return{'kind':_0x9e4bc1[_0x419cf0(0xdb)],'command':_0x9e4bc1['command'],'appRef':_0x9e4bc1[_0x419cf0(0xe1)],'datasetCode':_0x9e4bc1[_0x419cf0(0x10c)],'datatable':_0x9e4bc1[_0x419cf0(0x113)],'sqlCode':_0x9e4bc1[_0x419cf0(0x10e)],'bffCode':_0x9e4bc1['bffCode'],'bffId':_0x9e4bc1[_0x419cf0(0xfb)],'functionName':_0x9e4bc1[_0x419cf0(0xe2)]};}function normalizeScalarParams(_0x28dd42){const _0x3d6a76=a39_0x137e;return Object['fromEntries'](Object['entries'](_0x28dd42)['filter'](([,_0x2b35d3])=>typeof _0x2b35d3===_0x3d6a76(0xc7)||typeof _0x2b35d3==='number'));}function hasText(_0x171314){const _0x36b795=a39_0x137e;return typeof _0x171314===_0x36b795(0xc7)&&_0x171314[_0x36b795(0xc1)]()[_0x36b795(0xdf)]>0x0;}function isPrimitiveFlagDefault(_0x107cec){const _0x57a680=a39_0x137e;return _0x107cec===undefined||typeof _0x107cec===_0x57a680(0xc7)||typeof _0x107cec===_0x57a680(0xdd)||typeof _0x107cec==='boolean';}
|
|
1
|
+
(function(_0x27c684,_0x49bbca){const _0x1b4c72=a39_0x38a5,_0x34923d=_0x27c684();while(!![]){try{const _0x203471=-parseInt(_0x1b4c72(0xd3))/0x1+-parseInt(_0x1b4c72(0xe4))/0x2*(-parseInt(_0x1b4c72(0xe3))/0x3)+-parseInt(_0x1b4c72(0x10d))/0x4*(-parseInt(_0x1b4c72(0xf4))/0x5)+parseInt(_0x1b4c72(0xf6))/0x6*(parseInt(_0x1b4c72(0xd1))/0x7)+parseInt(_0x1b4c72(0x107))/0x8+-parseInt(_0x1b4c72(0xce))/0x9+-parseInt(_0x1b4c72(0xd2))/0xa;if(_0x203471===_0x49bbca)break;else _0x34923d['push'](_0x34923d['shift']());}catch(_0x2a526f){_0x34923d['push'](_0x34923d['shift']());}}}(a39_0x48c9,0x5fa55));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a39_0x38a5(_0x343ae1,_0xcc010a){_0x343ae1=_0x343ae1-0xb5;const _0x48c919=a39_0x48c9();let _0x38a5d5=_0x48c919[_0x343ae1];return _0x38a5d5;}function a39_0x48c9(){const _0x90a16a=['bffId','loginName','mapTo','enum','\x20requires\x20target.sqlCode.','sqlCode','cliPath','padEnd','sql','operator','json','find','context.','110100SiXPKn','10AbuQcq','Preview\x20dynamic\x20service\x20command:\x20','\x20\x20[','datasetCode','type','read','required','params','fullPath','Service\x20command\x20','service','commands','bffCode','appCode','number','\x20\x20\x20\x20kind:\x20\x20\x20\x20','837230GXORRY','scriptName','6HNfQvm','\x20service\x20detail\x20--service\x20','flags','length','\x20\x20\x20\x20datatable:\x20','\x20\x20\x20\x20functionName:\x20','nickName','filter','push','Unknown\x20appRef\x20\x22','envName','kind','boolean','risk','employeeId','map','command','224896BkoQhX','now','fromEntries','userId','some','code','4wDIHDy','datatable','Use\x20`','appcode','env','default','target','app','dbtableConfig','\x20requires\x20target.functionName.','\x22\x20in\x20service\x20command\x20','const','\x20\x20SERVICE\x20TREE\x20TARGET','trim','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','source','tenantCode','userName','flatMap','validation','\x20->\x20','bff','slice','name','\x20<command>\x20[flags]','\x20\x20\x20\x20sqlCode:\x20','tableName','join','\x20completed\x20in\x20','rawFlags','remainingArgs','Run\x20service\x20command\x20','startsWith','appBindings','entries','string','1992636BCvzXG','data','\x20\x20\x20\x20command:\x20','3374203FLJmNy','1970120RDvQea','50906QUKTlm','nickname','tree'];a39_0x48c9=function(){return _0x90a16a;};return a39_0x48c9();}export function resolveDynamicServiceCommand(_0x338b16,_0x5c2040){const _0x37e1e8=a39_0x38a5,_0x460bee=listLocalServiceTrees();let _0x6694b0;for(const _0xb6b68b of _0x460bee){const _0x2a31ca=matchServiceTreeCommand(_0xb6b68b,_0x338b16);if(!_0x2a31ca)continue;(!_0x6694b0||_0x2a31ca[_0x37e1e8(0x106)]['fullPath'][_0x37e1e8(0xf9)]>_0x6694b0[_0x37e1e8(0x106)][_0x37e1e8(0xec)][_0x37e1e8(0xf9)])&&(_0x6694b0={'tree':_0xb6b68b,'command':_0x2a31ca[_0x37e1e8(0x106)],'remainingArgs':_0x2a31ca[_0x37e1e8(0xc8)]});}if(!_0x6694b0)return undefined;const _0x23e1ec={..._0x5c2040};return applyAppBinding(_0x6694b0['tree'],_0x6694b0[_0x37e1e8(0x106)],_0x23e1ec),{'definition':buildDynamicCommandDefinition(_0x6694b0[_0x37e1e8(0xd5)],_0x6694b0[_0x37e1e8(0x106)]),'args':_0x6694b0[_0x37e1e8(0xc8)],'flags':_0x23e1ec,'tree':_0x6694b0[_0x37e1e8(0xd5)],'command':_0x6694b0[_0x37e1e8(0x106)]};}export function generateDynamicServiceHelp(_0x256886){const _0x45d745=a39_0x38a5,_0x229fc5=listLocalServiceTrees()['find'](_0x3c2844=>_0x3c2844['service'][_0x45d745(0x10c)]===_0x256886);if(!_0x229fc5)return undefined;const _0x551187=[CLI_BIN_NAME+'\x20'+_0x256886+_0x45d745(0xc2),'',_0x229fc5[_0x45d745(0xee)][_0x45d745(0xc1)]||_0x256886,_0x229fc5['service']['description']?'\x20\x20'+_0x229fc5[_0x45d745(0xee)]['description']:'','','Commands:',..._0x229fc5[_0x45d745(0xef)][_0x45d745(0x105)](_0x39250b=>{const _0x1d64fc=_0x45d745,_0x4c0c85=_0x39250b[_0x1d64fc(0xec)][_0x1d64fc(0xc0)](0x1)[_0x1d64fc(0xc5)]('\x20'),_0x5c8c7c=_0x39250b['risk']==='read'?'':'\x20['+_0x39250b[_0x1d64fc(0x103)]+']';return'\x20\x20'+_0x4c0c85[_0x1d64fc(0xdd)](0x18)+'\x20'+(_0x39250b['description']||'')+_0x5c8c7c;}),'',_0x45d745(0x10f)+CLI_BIN_NAME+_0x45d745(0xf7)+_0x256886+'`\x20to\x20inspect\x20the\x20manifest.'][_0x45d745(0xfd)](Boolean);return _0x551187['join']('\x0a');}export function listDynamicServiceEntries(){const _0x417d3e=a39_0x38a5;return listLocalServices()[_0x417d3e(0x105)](_0x20d53e=>{const _0x365494=_0x417d3e,_0xeeaf2f=_0x20d53e['normalizedManifest'];return{'service':_0xeeaf2f[_0x365494(0xee)][_0x365494(0x10c)],'label':_0xeeaf2f['service'][_0x365494(0xc1)]||_0xeeaf2f[_0x365494(0xee)][_0x365494(0x10c)],'commands':_0xeeaf2f['commands'][_0x365494(0x105)](_0x439890=>({'command':dynamicCommandName(_0x439890),'description':_0x439890['description']||_0x365494(0xc9)+_0x439890[_0x365494(0xdc)],'tag':riskTag(_0x439890[_0x365494(0x103)])}))};});}export function getDynamicServiceEntry(_0x5c429c){const _0x2c2332=a39_0x38a5;return listDynamicServiceEntries()['find'](_0x59956b=>_0x59956b[_0x2c2332(0xee)]===_0x5c429c);}export function listDynamicServiceDefinitions(_0x5c8080){const _0x409389=a39_0x38a5;return listLocalServiceTrees()[_0x409389(0xfd)](_0x2230dd=>!_0x5c8080||_0x2230dd['service']['code']===_0x5c8080)[_0x409389(0xbc)](_0x58bca3=>_0x58bca3[_0x409389(0xef)][_0x409389(0x105)](_0x7b3b29=>buildDynamicCommandDefinition(_0x58bca3,_0x7b3b29)));}export function getDynamicServiceDefinitions(_0x432630){const _0x3794ad=listDynamicServiceDefinitions(_0x432630);return _0x3794ad['length']>0x0?_0x3794ad:undefined;}export function findDynamicServiceDefinition(_0x123734,_0x30f7a0){const _0x36e33d=a39_0x38a5;return listDynamicServiceDefinitions(_0x123734)['find'](_0xc3444d=>_0xc3444d[_0x36e33d(0x106)]===_0x30f7a0);}export function buildDynamicCommandDefinition(_0x3f79e9,_0x3a558e){const _0x387e73=a39_0x38a5;return{'service':_0x3f79e9[_0x387e73(0xee)][_0x387e73(0x10c)],'command':dynamicCommandName(_0x3a558e),'description':_0x3a558e['description']||_0x387e73(0xc9)+_0x3a558e[_0x387e73(0xdc)],'risk':_0x3a558e[_0x387e73(0x103)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3a558e['args'][_0x387e73(0x105)](_0xcbd39e=>({'name':_0xcbd39e[_0x387e73(0xc1)],'description':_0xcbd39e['description']||_0xcbd39e[_0x387e73(0xc1)],'required':_0xcbd39e['required']})),'flags':_0x3a558e[_0x387e73(0xf8)][_0x387e73(0x105)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3a558e),async 'dryRun'(_0x3f01af){const _0x469379=_0x387e73,_0x1de40=await compilePlan(_0x3a558e,_0x3f01af);return{'method':'SERVICE_TREE','url':_0x3a558e[_0x469379(0xdc)],'body':{'target':targetPreview(_0x1de40),'params':_0x1de40[_0x469379(0xeb)]},'description':_0x469379(0xe5)+_0x3a558e[_0x469379(0xdc)]};},async 'execute'(_0x51b6b9){const _0x23d78a=_0x387e73,_0x39ee5b=await compilePlan(_0x3a558e,_0x51b6b9),_0x43443c=Date[_0x23d78a(0x108)](),_0x43afa5=await executePlan(_0x39ee5b,_0x3a558e,_0x51b6b9),_0x4308cf=Date['now']()-_0x43443c;return{'ok':!![],'data':{'service':_0x3f79e9[_0x23d78a(0xee)],'command':_0x3a558e[_0x23d78a(0xdc)],'target':targetPreview(_0x39ee5b),'result':_0x43afa5,'elapsed':_0x4308cf},'message':_0x23d78a(0xed)+_0x3a558e[_0x23d78a(0xdc)]+_0x23d78a(0xc6)+_0x4308cf+'ms'};}};}function dynamicCommandName(_0x50ea64){const _0x311093=a39_0x38a5;return _0x50ea64[_0x311093(0xec)][_0x311093(0xc0)](0x1)['join']('\x20');}function riskTag(_0x18ef1d){const _0x4fef94=a39_0x38a5;return _0x18ef1d===_0x4fef94(0xe9)?'':_0x4fef94(0xe6)+_0x18ef1d+']';}function flagToCommandFlag(_0x21d798){const _0x33bca5=a39_0x38a5;return{'name':_0x21d798['cliName'],'type':_0x21d798[_0x33bca5(0xe8)]===_0x33bca5(0xe0)?_0x33bca5(0xcd):_0x21d798[_0x33bca5(0xe8)],'description':_0x21d798['description']||_0x21d798[_0x33bca5(0xc1)],'required':_0x21d798[_0x33bca5(0xea)],'default':isPrimitiveFlagDefault(_0x21d798['default'])?_0x21d798[_0x33bca5(0x112)]:undefined,'enum':_0x21d798[_0x33bca5(0xd9)]};}async function compilePlan(_0x430a84,_0x5b4ec9){const _0xe1ab0b=a39_0x38a5;return compileServiceTreeCommand(_0x430a84,{'flags':_0x5b4ec9[_0xe1ab0b(0xc7)],'args':_0x5b4ec9['args'],'context':await buildServiceContext(_0x430a84,_0x5b4ec9)});}async function buildServiceContext(_0x20391a,_0x44d481){const _0x3e33d1=a39_0x38a5,_0x1840a6={'appCode':_0x44d481[_0x3e33d1(0xf1)],'env':_0x44d481[_0x3e33d1(0x100)],'envName':_0x44d481[_0x3e33d1(0x100)]};if(!usesRuntimeContext(_0x20391a))return _0x1840a6;const _0x4276c9=await getLoginUserInfo(),_0x276d42=pickFirst(_0x4276c9[_0x3e33d1(0x10a)],_0x4276c9['id']);return{..._0x1840a6,'user':_0x4276c9,'userId':_0x276d42,'id':_0x4276c9['id'],'username':pickFirst(_0x4276c9['username'],_0x4276c9[_0x3e33d1(0xbb)],_0x4276c9[_0x3e33d1(0xd7)]),'userName':_0x4276c9[_0x3e33d1(0xbb)],'nickname':pickFirst(_0x4276c9[_0x3e33d1(0xd4)],_0x4276c9['nickName']),'nickName':_0x4276c9[_0x3e33d1(0xfc)],'tenantCode':_0x4276c9[_0x3e33d1(0xba)],'employeeId':_0x4276c9[_0x3e33d1(0x104)]};}function usesRuntimeContext(_0x2d9089){const _0x38c08e=a39_0x38a5;return _0x2d9089[_0x38c08e(0xd8)][_0x38c08e(0x10b)](_0x35faba=>typeof _0x35faba[_0x38c08e(0xb9)]===_0x38c08e(0xcd)&&(_0x35faba[_0x38c08e(0xb9)]['startsWith'](_0x38c08e(0xe2))||_0x35faba['source'][_0x38c08e(0xca)]('ctx.')));}function pickFirst(..._0x2e19e6){const _0x3d7356=a39_0x38a5;return _0x2e19e6[_0x3d7356(0xe1)](_0x43a970=>_0x43a970!==undefined&&_0x43a970!==null);}async function executePlan(_0x5d2587,_0x2faafb,_0xa5cbed){const _0x466e9a=a39_0x38a5;if(_0x5d2587[_0x466e9a(0x101)]===_0x466e9a(0xcf)){const _0x99fa3d=await resolveDatasetCode(_0x5d2587,_0x2faafb,_0xa5cbed);return executeData(_0x99fa3d,_0x5d2587['command'],_0x5d2587[_0x466e9a(0xeb)]);}if(_0x5d2587['kind']===_0x466e9a(0xde)){if(!_0x5d2587['sqlCode'])throw CliErrors['validation'](_0x466e9a(0xed)+_0x2faafb[_0x466e9a(0xdc)]+_0x466e9a(0xda));return executeSdkSql(_0x5d2587['sqlCode'],normalizeScalarParams(_0x5d2587['params']));}if(_0x5d2587[_0x466e9a(0x101)]===_0x466e9a(0xbf)){const _0x68548f=_0x5d2587[_0x466e9a(0xf5)]||_0x5d2587[_0x466e9a(0xf0)]||(_0x5d2587['bffId']==null?'':String(_0x5d2587['bffId']));if(!_0x68548f)throw CliErrors[_0x466e9a(0xbd)]('Service\x20command\x20'+_0x2faafb['cliPath']+_0x466e9a(0x116));return executeSdkBff(_0x68548f,_0x5d2587[_0x466e9a(0xeb)]);}throw CliErrors[_0x466e9a(0xbd)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x5d2587[_0x466e9a(0x101)]);}async function resolveDatasetCode(_0x32569a,_0x303a12,_0x1f6d2c){const _0x1e0d79=a39_0x38a5;if(_0x32569a[_0x1e0d79(0xe7)])return _0x32569a[_0x1e0d79(0xe7)];if(!_0x32569a[_0x1e0d79(0x10e)])throw CliErrors[_0x1e0d79(0xbd)]('Service\x20command\x20'+_0x303a12[_0x1e0d79(0xdc)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x3f5dd8=await listDatasets(_0x1f6d2c[_0x1e0d79(0xf1)]),_0x9b2ec2=_0x3f5dd8['find'](_0x5a5900=>_0x5a5900[_0x1e0d79(0x115)]?.[_0x1e0d79(0xc4)]===_0x32569a[_0x1e0d79(0x10e)]);if(!_0x9b2ec2?.[_0x1e0d79(0x10c)])throw CliErrors[_0x1e0d79(0xbd)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x32569a[_0x1e0d79(0x10e)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x1f6d2c[_0x1e0d79(0xf1)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x9b2ec2[_0x1e0d79(0x10c)];}function applyAppBinding(_0x1bbbb3,_0x29abcc,_0x1b89f7){const _0x42aa88=a39_0x38a5,_0x3440de=_0x29abcc[_0x42aa88(0x113)]['appRef'];if(!_0x3440de)return;const _0x56e1f2=_0x1bbbb3[_0x42aa88(0xcb)][_0x3440de];if(!_0x56e1f2)throw CliErrors[_0x42aa88(0xbd)](_0x42aa88(0xff)+_0x3440de+_0x42aa88(0x117)+_0x29abcc[_0x42aa88(0xdc)]+'.',_0x42aa88(0xb8));const _0x1b9b3c=_0x56e1f2[_0x42aa88(0x110)]||_0x56e1f2[_0x42aa88(0xf1)];_0x1b9b3c&&!hasText(_0x1b89f7[_0x42aa88(0x110)])&&(_0x1b89f7[_0x42aa88(0x110)]=_0x1b9b3c),_0x56e1f2[_0x42aa88(0x114)]&&!hasText(_0x1b89f7['app'])&&!hasText(_0x1b89f7[_0x42aa88(0x110)])&&(_0x1b89f7['app']=_0x56e1f2[_0x42aa88(0x114)]),_0x56e1f2[_0x42aa88(0x111)]&&!hasText(_0x1b89f7[_0x42aa88(0x111)])&&(_0x1b89f7['env']=_0x56e1f2[_0x42aa88(0x111)]);}function renderDynamicCommandHelp(_0x54f7c6){const _0x504c0a=a39_0x38a5,_0x5b1ff7=[_0x504c0a(0xb6),_0x504c0a(0xf3)+_0x54f7c6[_0x504c0a(0x113)]['kind'],_0x504c0a(0xd0)+_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0x106)]];if(_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0xe7)])_0x5b1ff7['push']('\x20\x20\x20\x20datasetCode:\x20'+_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0xe7)]);if(_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0x10e)])_0x5b1ff7[_0x504c0a(0xfe)](_0x504c0a(0xfa)+_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0x10e)]);if(_0x54f7c6[_0x504c0a(0x113)]['sqlCode'])_0x5b1ff7['push'](_0x504c0a(0xc3)+_0x54f7c6['target'][_0x504c0a(0xdb)]);if(_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0xf5)])_0x5b1ff7[_0x504c0a(0xfe)](_0x504c0a(0xfb)+_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0xf5)]);if(_0x54f7c6['mapTo'][_0x504c0a(0xf9)]>0x0){_0x5b1ff7[_0x504c0a(0xfe)]('','\x20\x20MAP\x20TO');for(const _0x34f0cf of _0x54f7c6[_0x504c0a(0xd8)]){_0x5b1ff7[_0x504c0a(0xfe)]('\x20\x20\x20\x20'+(_0x34f0cf['source']||_0x504c0a(0xb5))+_0x504c0a(0xbe)+_0x34f0cf['target']+(_0x34f0cf[_0x504c0a(0xdf)]?'.'+_0x34f0cf['operator']:''));}}return _0x5b1ff7[_0x504c0a(0xc5)]('\x0a');}function targetPreview(_0x3509a3){const _0x1c52dd=a39_0x38a5;return{'kind':_0x3509a3[_0x1c52dd(0x101)],'command':_0x3509a3[_0x1c52dd(0x106)],'appRef':_0x3509a3['appRef'],'datasetCode':_0x3509a3['datasetCode'],'datatable':_0x3509a3[_0x1c52dd(0x10e)],'sqlCode':_0x3509a3[_0x1c52dd(0xdb)],'bffCode':_0x3509a3[_0x1c52dd(0xf0)],'bffId':_0x3509a3[_0x1c52dd(0xd6)],'functionName':_0x3509a3[_0x1c52dd(0xf5)]};}function normalizeScalarParams(_0x5b8f9c){const _0x425178=a39_0x38a5;return Object[_0x425178(0x109)](Object[_0x425178(0xcc)](_0x5b8f9c)['filter'](([,_0x542051])=>typeof _0x542051===_0x425178(0xcd)||typeof _0x542051===_0x425178(0xf2)));}function hasText(_0x5c2023){const _0x6bb6f6=a39_0x38a5;return typeof _0x5c2023===_0x6bb6f6(0xcd)&&_0x5c2023[_0x6bb6f6(0xb7)]()[_0x6bb6f6(0xf9)]>0x0;}function isPrimitiveFlagDefault(_0x2fe758){const _0x501f7c=a39_0x38a5;return _0x2fe758===undefined||typeof _0x2fe758===_0x501f7c(0xcd)||typeof _0x2fe758===_0x501f7c(0xf2)||typeof _0x2fe758===_0x501f7c(0x102);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f598f,_0x3185a9){const _0x527f54=a40_0x2929,_0x15ed97=_0x5f598f();while(!![]){try{const _0x1dade1=-parseInt(_0x527f54(0x11f))/0x1*(-parseInt(_0x527f54(0x11a))/0x2)+-parseInt(_0x527f54(0x118))/0x3*(parseInt(_0x527f54(0x104))/0x4)+parseInt(_0x527f54(0x10a))/0x5+-parseInt(_0x527f54(0x102))/0x6+-parseInt(_0x527f54(0x10b))/0x7+-parseInt(_0x527f54(0x107))/0x8+parseInt(_0x527f54(0x10c))/0x9;if(_0x1dade1===_0x3185a9)break;else _0x15ed97['push'](_0x15ed97['shift']());}catch(_0x4260bb){_0x15ed97['push'](_0x15ed97['shift']());}}}(a40_0x3ce0,0xda0f2));export function adaptServiceTreeManifestForLegacyFramework(_0x48e3fa){const _0xe5fa2f=a40_0x2929,_0x1ce15e=cloneJsonValue(_0x48e3fa),_0x345e47=[];if(!isObjectRecord(_0x1ce15e))return{'manifest':_0x1ce15e,'errors':_0x345e47};return Array[_0xe5fa2f(0x110)](_0x1ce15e[_0xe5fa2f(0x112)])&&_0x1ce15e['commands']['forEach']((_0x22744f,_0x20d5ea)=>{const _0x318d6f=_0xe5fa2f;if(!isObjectRecord(_0x22744f))return;adaptBffTarget(_0x22744f[_0x318d6f(0x106)],_0x318d6f(0x10d)+_0x20d5ea+_0x318d6f(0xfc),_0x345e47);}),adaptResources(_0x1ce15e[_0xe5fa2f(0x113)],'$.resources',_0x345e47),{'manifest':_0x1ce15e,'errors':_0x345e47};}export function toPublicServiceTreeTarget(_0x5ee723){const _0x2c9c3f=a40_0x2929,{scriptName:_0x379f4b,..._0x11a9d1}=_0x5ee723;return typeof _0x379f4b===_0x2c9c3f(0xff)&&_0x379f4b[_0x2c9c3f(0x117)]()&&(_0x11a9d1[_0x2c9c3f(0xfd)]=_0x379f4b),_0x11a9d1;}export function toPublicNormalizedServiceTree(_0x9ea1a7){const _0x1eae83=a40_0x2929;return{..._0x9ea1a7,'commands':_0x9ea1a7[_0x1eae83(0x112)][_0x1eae83(0x109)](_0x367222=>({..._0x367222,'target':toPublicServiceTreeTarget(_0x367222[_0x1eae83(0x106)])}))};}function adaptResources(_0x2c36ed,_0x375f4b,_0x40d650){const _0x332cf7=a40_0x2929;if(!isObjectRecord(_0x2c36ed))return;for(const [_0x1bec9f,_0x5150a9]of Object[_0x332cf7(0x115)](_0x2c36ed)){if(!isObjectRecord(_0x5150a9))continue;const _0x5a0138=_0x375f4b+'.'+_0x1bec9f;if(isObjectRecord(_0x5150a9[_0x332cf7(0x11d)]))for(const [_0x4217d8,_0x5bd4e7]of Object['entries'](_0x5150a9[_0x332cf7(0x11d)])){if(!isObjectRecord(_0x5bd4e7))continue;const _0x2588bc=_0x5a0138+_0x332cf7(0x108)+_0x4217d8,_0x23aa3d=isObjectRecord(_0x5bd4e7[_0x332cf7(0x106)])&&_0x5bd4e7['target'][_0x332cf7(0x10e)]==='bff';adaptBffTarget(_0x5bd4e7[_0x332cf7(0x106)],_0x2588bc+'.target',_0x40d650),(_0x23aa3d||isBffAction(_0x5bd4e7))&&adaptFunctionNameField(_0x5bd4e7,_0x2588bc,_0x40d650);}adaptResources(_0x5150a9[_0x332cf7(0x113)],_0x5a0138+_0x332cf7(0x114),_0x40d650);}}function a40_0x2929(_0x223dd8,_0x368680){_0x223dd8=_0x223dd8-0xfc;const _0x3ce043=a40_0x3ce0();let _0x292988=_0x3ce043[_0x223dd8];return _0x292988;}function adaptBffTarget(_0x56e496,_0x486a95,_0x32fe7f){const _0x152240=a40_0x2929;if(!isObjectRecord(_0x56e496)||_0x56e496[_0x152240(0x10e)]!==_0x152240(0x111))return;adaptFunctionNameField(_0x56e496,_0x486a95,_0x32fe7f);}function adaptFunctionNameField(_0x2a2183,_0x4e2db9,_0x40d447){const _0x47aa18=a40_0x2929;Object[_0x47aa18(0x101)][_0x47aa18(0xfe)]['call'](_0x2a2183,_0x47aa18(0x105))&&_0x40d447[_0x47aa18(0x10f)]({'level':_0x47aa18(0x11c),'path':_0x4e2db9+_0x47aa18(0x100),'message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object[_0x47aa18(0x101)]['hasOwnProperty'][_0x47aa18(0x119)](_0x2a2183,'functionName')){if(typeof _0x2a2183[_0x47aa18(0xfd)]!==_0x47aa18(0xff)||!_0x2a2183[_0x47aa18(0xfd)][_0x47aa18(0x117)]()){_0x40d447['push']({'level':_0x47aa18(0x11c),'path':_0x4e2db9+_0x47aa18(0x11b),'message':_0x47aa18(0x103)}),delete _0x2a2183[_0x47aa18(0xfd)];return;}_0x2a2183[_0x47aa18(0x105)]=_0x2a2183['functionName'],delete _0x2a2183['functionName'];}}function a40_0x3ce0(){const _0x43a961=['987903czAMxj','21241368veqwwY','$.commands[','kind','push','isArray','bff','commands','resources','.resources','entries','fromEntries','trim','1247907znthnj','call','1434892TtSfZe','.functionName','error','actions','bff.exec','1PlLcij','].target','functionName','hasOwnProperty','string','.scriptName','prototype','4135842FEBMHn','functionName\x20must\x20be\x20a\x20non-empty\x20string.','12JgXzUW','scriptName','target','9798904kNxoOn','.actions.','map','5593890UORiYs'];a40_0x3ce0=function(){return _0x43a961;};return a40_0x3ce0();}function isBffAction(_0x169138){const _0x5e895e=a40_0x2929;return _0x169138['kind']===_0x5e895e(0x111)||_0x169138['action']==='bff.exec'||_0x169138[_0x5e895e(0x106)]===_0x5e895e(0x11e);}function cloneJsonValue(_0x560e95){const _0x33a151=a40_0x2929;if(Array[_0x33a151(0x110)](_0x560e95))return _0x560e95[_0x33a151(0x109)](_0x2a8b22=>cloneJsonValue(_0x2a8b22));if(isObjectRecord(_0x560e95))return Object[_0x33a151(0x116)](Object[_0x33a151(0x115)](_0x560e95)['map'](([_0x2d55c6,_0x1ce3ea])=>[_0x2d55c6,cloneJsonValue(_0x1ce3ea)]));return _0x560e95;}function isObjectRecord(_0x14d5dd){const _0x5a00ae=a40_0x2929;return Boolean(_0x14d5dd)&&typeof _0x14d5dd==='object'&&!Array[_0x5a00ae(0x110)](_0x14d5dd);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x2f13ef=a41_0x31ee;(function(_0x4f3e2e,_0x52e239){const _0x3a4c94=a41_0x31ee,_0x69f690=_0x4f3e2e();while(!![]){try{const _0x59e360=-parseInt(_0x3a4c94(0x112))/0x1*(parseInt(_0x3a4c94(0x103))/0x2)+parseInt(_0x3a4c94(0x105))/0x3+parseInt(_0x3a4c94(0xdb))/0x4+-parseInt(_0x3a4c94(0xfa))/0x5+-parseInt(_0x3a4c94(0x111))/0x6+-parseInt(_0x3a4c94(0x109))/0x7+parseInt(_0x3a4c94(0xfb))/0x8*(parseInt(_0x3a4c94(0xeb))/0x9);if(_0x59e360===_0x52e239)break;else _0x69f690['push'](_0x69f690['shift']());}catch(_0x565ff0){_0x69f690['push'](_0x69f690['shift']());}}}(a41_0x1f19,0x5c56a));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a41_0x1f19(){const _0x33a7c8=['Updated','length','Local\x20service\x20code,\x20for\x20example\x20crm','WRITE','string','type','name','1505336GekfxP','registryPath','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','remove','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','\x20service(s).','risk','manifests','map','updated','source','registry','registryIndex','registryServiceCode','validate','import','999PLouXK','cliName','description','Service\x20manifest\x20validation\x20passed.','read','report','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','reduce','normalizedManifest','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Service\x20Tree\x20manifest\x20file\x20path','detail','entry','commands','imported','2262530ZMxiDI','132576UEsxni','\x20service\x20','importedAt','Removed\x20service\x20','Service\x20registry\x20validation\x20passed.','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','\x20service(s),\x20updated\x20','service','2494SIIGcm','version','1039575VAbQlK','serviceCount','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','errors','3878959CPTFss','kind','required','filePath','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','entries','str','target','4348974robGDa','363XyMjGJ','write','warnings','cliPath','hash','serviceCode','file'];a41_0x1f19=function(){return _0x33a7c8;};return a41_0x1f19();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a41_0x31ee(_0x3ae360,_0x3d3c88){_0x3ae360=_0x3ae360-0xda;const _0x1f19a0=a41_0x1f19();let _0x31ee3e=_0x1f19a0[_0x3ae360];return _0x31ee3e;}const FILE_FLAG={'name':a41_0x2f13ef(0x118),'type':a41_0x2f13ef(0x11d),'required':!![],'description':a41_0x2f13ef(0xf5)},SERVICE_FLAG={'name':'service','type':a41_0x2f13ef(0x11d),'required':!![],'description':a41_0x2f13ef(0x11b),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x1b61e3){const _0x4dd66a=a41_0x2f13ef;return{'serviceCode':_0x1b61e3[_0x4dd66a(0x117)],'name':_0x1b61e3[_0x4dd66a(0xf3)][_0x4dd66a(0x102)][_0x4dd66a(0xda)],'version':_0x1b61e3[_0x4dd66a(0x104)],'importedAt':_0x1b61e3[_0x4dd66a(0xfd)],'source':_0x1b61e3[_0x4dd66a(0xe5)],'commandCount':_0x1b61e3[_0x4dd66a(0xf3)]['commands'][_0x4dd66a(0x11a)],'commands':_0x1b61e3[_0x4dd66a(0xf3)][_0x4dd66a(0xf8)][_0x4dd66a(0xe3)](_0x4ff78a=>({'path':_0x4ff78a[_0x4dd66a(0x115)],'description':_0x4ff78a[_0x4dd66a(0xed)],'risk':_0x4ff78a[_0x4dd66a(0xe1)],'target':toPublicServiceTreeTarget(_0x4ff78a['target']),'flags':_0x4ff78a['flags'][_0x4dd66a(0xe3)](_0x3a66d0=>({'name':_0x3a66d0['name'],'cliName':_0x3a66d0[_0x4dd66a(0xec)],'type':_0x3a66d0[_0x4dd66a(0x11e)],'required':_0x3a66d0[_0x4dd66a(0x10b)]===!![]}))}))};}function summarizeLoadedManifest(_0x349236){const _0x1bb998=a41_0x2f13ef;return{'service':_0x349236[_0x1bb998(0xf3)]?.[_0x1bb998(0x102)],'version':_0x349236[_0x1bb998(0xf3)]?.[_0x1bb998(0x104)],'commandCount':_0x349236[_0x1bb998(0xf3)]?.[_0x1bb998(0xf8)][_0x1bb998(0x11a)]??0x0,'commands':_0x349236[_0x1bb998(0xf3)]?.[_0x1bb998(0xf8)][_0x1bb998(0xe3)](_0x1236c3=>({'path':_0x1236c3[_0x1bb998(0x115)],'risk':_0x1236c3[_0x1bb998(0xe1)],'target':toPublicServiceTreeTarget(_0x1236c3[_0x1bb998(0x110)])}))??[],'registryIndex':_0x349236[_0x1bb998(0xe7)],'registryServiceCode':_0x349236[_0x1bb998(0xe8)],'errors':_0x349236[_0x1bb998(0xf0)][_0x1bb998(0x108)],'warnings':_0x349236[_0x1bb998(0xf0)][_0x1bb998(0x114)]};}export const serviceDefinitions=[{'service':a41_0x2f13ef(0x102),'command':a41_0x2f13ef(0xe9),'description':a41_0x2f13ef(0xf4),'risk':a41_0x2f13ef(0xef),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x473211){const _0x533808=a41_0x2f13ef,_0x48dc20=loadServiceManifestFromFile(_0x473211[_0x533808(0x10f)](_0x533808(0x118)));if(!_0x48dc20['report']['ok'])return{'ok':![],'data':{'file':_0x48dc20[_0x533808(0x10c)],'hash':_0x48dc20[_0x533808(0x116)],'kind':_0x48dc20[_0x533808(0x10a)],'serviceCount':_0x48dc20[_0x533808(0xe2)][_0x533808(0x11a)],'services':_0x48dc20[_0x533808(0xe2)][_0x533808(0xe3)](summarizeLoadedManifest),'errors':_0x48dc20[_0x533808(0xf0)][_0x533808(0x108)],'warnings':_0x48dc20[_0x533808(0xf0)][_0x533808(0x114)]},'message':formatValidationFailure(_0x48dc20[_0x533808(0xf0)])};if(_0x48dc20[_0x533808(0x10a)]===_0x533808(0xe6)||_0x48dc20[_0x533808(0xe2)][_0x533808(0x11a)]!==0x1)return{'ok':!![],'data':{'file':_0x48dc20[_0x533808(0x10c)],'hash':_0x48dc20[_0x533808(0x116)],'kind':_0x48dc20[_0x533808(0x10a)],'serviceCount':_0x48dc20[_0x533808(0xe2)][_0x533808(0x11a)],'commandCount':_0x48dc20[_0x533808(0xe2)][_0x533808(0xf2)]((_0x23ec1b,_0x2603b8)=>_0x23ec1b+(_0x2603b8[_0x533808(0xf3)]?.[_0x533808(0xf8)][_0x533808(0x11a)]??0x0),0x0),'services':_0x48dc20[_0x533808(0xe2)][_0x533808(0xe3)](summarizeLoadedManifest),'warnings':_0x48dc20[_0x533808(0xf0)][_0x533808(0x114)]},'message':_0x533808(0xff)};return{'ok':!![],'data':{'file':_0x48dc20[_0x533808(0x10c)],'hash':_0x48dc20[_0x533808(0x116)],'kind':_0x48dc20[_0x533808(0x10a)],'service':_0x48dc20[_0x533808(0xf3)]?.[_0x533808(0x102)],'version':_0x48dc20[_0x533808(0xf3)]?.[_0x533808(0x104)],'commandCount':_0x48dc20[_0x533808(0xf3)]?.[_0x533808(0xf8)][_0x533808(0x11a)]??0x0,'commands':_0x48dc20[_0x533808(0xf3)]?.[_0x533808(0xf8)]['map'](_0x4c40ae=>({'path':_0x4c40ae[_0x533808(0x115)],'risk':_0x4c40ae[_0x533808(0xe1)],'target':toPublicServiceTreeTarget(_0x4c40ae['target'])})),'warnings':_0x48dc20[_0x533808(0xf0)][_0x533808(0x114)]},'message':_0x533808(0xee)};}},{'service':a41_0x2f13ef(0x102),'command':a41_0x2f13ef(0xea),'description':a41_0x2f13ef(0x107),'risk':a41_0x2f13ef(0x113),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x380a4d){const _0x27a4b8=a41_0x2f13ef,_0x4cd0d0=loadServiceManifestFromFile(_0x380a4d[_0x27a4b8(0x10f)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x4cd0d0['filePath'],'hash':_0x4cd0d0[_0x27a4b8(0x116)],'kind':_0x4cd0d0['kind'],'ok':_0x4cd0d0[_0x27a4b8(0xf0)]['ok'],'service':_0x4cd0d0[_0x27a4b8(0xf3)]?.[_0x27a4b8(0x102)],'version':_0x4cd0d0[_0x27a4b8(0xf3)]?.['version'],'serviceCount':_0x4cd0d0['manifests'][_0x27a4b8(0x11a)],'services':_0x4cd0d0[_0x27a4b8(0xe2)]['map'](_0x193242=>({'service':_0x193242[_0x27a4b8(0xf3)]?.[_0x27a4b8(0x102)],'version':_0x193242[_0x27a4b8(0xf3)]?.[_0x27a4b8(0x104)],'commandCount':_0x193242['normalizedManifest']?.['commands'][_0x27a4b8(0x11a)]??0x0,'errors':_0x193242[_0x27a4b8(0xf0)][_0x27a4b8(0x108)]})),'errors':_0x4cd0d0[_0x27a4b8(0xf0)][_0x27a4b8(0x108)],'commandCount':_0x4cd0d0[_0x27a4b8(0xf3)]?.[_0x27a4b8(0xf8)][_0x27a4b8(0x11a)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x1f66b3){const _0x2c204e=a41_0x2f13ef,_0x3916ac=importServiceManifest(_0x1f66b3[_0x2c204e(0x10f)](_0x2c204e(0x118)));if(_0x3916ac[_0x2c204e(0x10e)][_0x2c204e(0x11a)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x3916ac[_0x2c204e(0xdc)],'imported':_0x3916ac[_0x2c204e(0xf9)],'updated':_0x3916ac['updated'],'serviceCount':_0x3916ac[_0x2c204e(0x106)],'services':_0x3916ac[_0x2c204e(0x10e)][_0x2c204e(0xe3)](summarizeService)},'message':'Imported\x20'+_0x3916ac[_0x2c204e(0xf9)]+_0x2c204e(0x101)+_0x3916ac[_0x2c204e(0xe4)]+_0x2c204e(0xe0)};return{'ok':!![],'data':{'registryPath':_0x3916ac[_0x2c204e(0xdc)],'replaced':_0x3916ac['replaced'],'imported':_0x3916ac[_0x2c204e(0xf9)],'updated':_0x3916ac['updated'],'serviceCount':_0x3916ac[_0x2c204e(0x106)],'service':summarizeService(_0x3916ac[_0x2c204e(0xf7)])},'message':(_0x3916ac['replaced']?_0x2c204e(0x119):'Imported')+_0x2c204e(0xfc)+_0x3916ac['entry'][_0x2c204e(0x117)]+'.'};}},{'service':a41_0x2f13ef(0x102),'command':'export','description':a41_0x2f13ef(0x100),'risk':a41_0x2f13ef(0x113),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0xd2590d){const _0x192143=a41_0x2f13ef,_0x29c001=getLocalServiceEntry(_0xd2590d[_0x192143(0x10f)](_0x192143(0x102)));return{'method':_0x192143(0x11c),'url':_0xd2590d[_0x192143(0x10f)]('file'),'body':{'service':_0xd2590d[_0x192143(0x10f)]('service'),'found':Boolean(_0x29c001),'version':_0x29c001?.['version'],'source':_0x29c001?.[_0x192143(0xe5)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x1a8f31){const _0x4e45a7=a41_0x2f13ef,_0x191a5b=exportServiceManifest(_0x1a8f31[_0x4e45a7(0x10f)](_0x4e45a7(0x102)),_0x1a8f31[_0x4e45a7(0x10f)](_0x4e45a7(0x118)));return{'ok':!![],'data':{'registryPath':_0x191a5b['registryPath'],'file':_0x191a5b['filePath'],'service':summarizeService(_0x191a5b[_0x4e45a7(0xf7)])},'message':'Exported\x20service\x20'+_0x191a5b[_0x4e45a7(0xf7)][_0x4e45a7(0x117)]+'.'};}},{'service':a41_0x2f13ef(0x102),'command':'list','description':a41_0x2f13ef(0xdf),'risk':a41_0x2f13ef(0xef),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x30f303=a41_0x2f13ef,_0x55adef=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x55adef[_0x30f303(0x11a)],'services':_0x55adef[_0x30f303(0xe3)](summarizeService)}};}},{'service':'service','command':a41_0x2f13ef(0xde),'description':a41_0x2f13ef(0xdd),'risk':a41_0x2f13ef(0x113),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x859ec0){const _0x41107c=a41_0x2f13ef,_0x24793b=getLocalServiceEntry(_0x859ec0['str'](_0x41107c(0x102)));return{'method':_0x41107c(0x11c),'url':getServiceRegistryPath(),'body':{'service':_0x859ec0['str'](_0x41107c(0x102)),'found':Boolean(_0x24793b),'version':_0x24793b?.[_0x41107c(0x104)],'source':_0x24793b?.['source']},'description':_0x41107c(0xf1)};},async 'execute'(_0x3e4c76){const _0x5e80c6=a41_0x2f13ef,_0x1a5856=removeServiceManifest(_0x3e4c76[_0x5e80c6(0x10f)]('service'));return{'ok':!![],'data':{'registryPath':_0x1a5856[_0x5e80c6(0xdc)],'serviceCount':_0x1a5856[_0x5e80c6(0x106)],'service':summarizeService(_0x1a5856[_0x5e80c6(0xf7)])},'message':_0x5e80c6(0xfe)+_0x1a5856['entry'][_0x5e80c6(0x117)]+'.'};}},{'service':a41_0x2f13ef(0x102),'command':a41_0x2f13ef(0xf6),'description':a41_0x2f13ef(0x10d),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x477b7b){const _0x139ea5=a41_0x2f13ef,_0x223e2c=getLocalServiceEntry(_0x477b7b[_0x139ea5(0x10f)](_0x139ea5(0x102)));if(!_0x223e2c)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x477b7b['str']('service')},'message':'Local\x20service\x20not\x20found:\x20'+_0x477b7b[_0x139ea5(0x10f)](_0x139ea5(0x102))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x223e2c),'manifest':_0x223e2c['manifest'],'normalizedManifest':toPublicNormalizedServiceTree(_0x223e2c[_0x139ea5(0xf3)])}};}}];
|
|
1
|
+
function a41_0x3239(_0x4a2f1e,_0x379e22){_0x4a2f1e=_0x4a2f1e-0x13f;const _0x468671=a41_0x4686();let _0x32390c=_0x468671[_0x4a2f1e];return _0x32390c;}const a41_0x44be85=a41_0x3239;(function(_0x12afc9,_0x1d0c51){const _0x34c2a2=a41_0x3239,_0x754250=_0x12afc9();while(!![]){try{const _0xe1b5c=parseInt(_0x34c2a2(0x170))/0x1+parseInt(_0x34c2a2(0x173))/0x2*(-parseInt(_0x34c2a2(0x14f))/0x3)+parseInt(_0x34c2a2(0x140))/0x4+-parseInt(_0x34c2a2(0x16d))/0x5*(parseInt(_0x34c2a2(0x159))/0x6)+-parseInt(_0x34c2a2(0x143))/0x7*(-parseInt(_0x34c2a2(0x149))/0x8)+parseInt(_0x34c2a2(0x16a))/0x9*(parseInt(_0x34c2a2(0x160))/0xa)+-parseInt(_0x34c2a2(0x178))/0xb;if(_0xe1b5c===_0x1d0c51)break;else _0x754250['push'](_0x754250['shift']());}catch(_0x43d9ae){_0x754250['push'](_0x754250['shift']());}}}(a41_0x4686,0x53022));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x44be85(0x154),'type':a41_0x44be85(0x17a),'required':!![],'description':a41_0x44be85(0x14b)},SERVICE_FLAG={'name':a41_0x44be85(0x163),'type':a41_0x44be85(0x17a),'required':!![],'description':a41_0x44be85(0x16e),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x44be85(0x148)}};function summarizeService(_0x36f121){const _0x188480=a41_0x44be85;return{'serviceCode':_0x36f121[_0x188480(0x157)],'name':_0x36f121['normalizedManifest']['service']['name'],'version':_0x36f121[_0x188480(0x168)],'importedAt':_0x36f121['importedAt'],'source':_0x36f121['source'],'commandCount':_0x36f121[_0x188480(0x165)][_0x188480(0x181)][_0x188480(0x151)],'commands':_0x36f121['normalizedManifest']['commands'][_0x188480(0x15b)](_0x168e66=>({'path':_0x168e66[_0x188480(0x146)],'description':_0x168e66[_0x188480(0x169)],'risk':_0x168e66[_0x188480(0x142)],'target':toPublicServiceTreeTarget(_0x168e66[_0x188480(0x14c)]),'flags':_0x168e66['flags'][_0x188480(0x15b)](_0x1c38c6=>({'name':_0x1c38c6['name'],'cliName':_0x1c38c6[_0x188480(0x180)],'type':_0x1c38c6[_0x188480(0x164)],'required':_0x1c38c6[_0x188480(0x179)]===!![]}))}))};}function summarizeLoadedManifest(_0x486af9){const _0x780922=a41_0x44be85;return{'service':_0x486af9['normalizedManifest']?.['service'],'version':_0x486af9[_0x780922(0x165)]?.[_0x780922(0x168)],'commandCount':_0x486af9[_0x780922(0x165)]?.[_0x780922(0x181)][_0x780922(0x151)]??0x0,'commands':_0x486af9[_0x780922(0x165)]?.[_0x780922(0x181)][_0x780922(0x15b)](_0x482a2e=>({'path':_0x482a2e['cliPath'],'risk':_0x482a2e[_0x780922(0x142)],'target':toPublicServiceTreeTarget(_0x482a2e['target'])}))??[],'registryIndex':_0x486af9[_0x780922(0x156)],'registryServiceCode':_0x486af9['registryServiceCode'],'errors':_0x486af9[_0x780922(0x14a)]['errors'],'warnings':_0x486af9[_0x780922(0x14a)][_0x780922(0x162)]};}function a41_0x4686(){const _0x3be560=['service','type','normalizedManifest','export','detail','version','description','1002393apvatj','source','\x20service(s).','15erwnsK','Local\x20service\x20code,\x20for\x20example\x20crm','validate','429985cZhMJl','remove','Removed\x20service\x20','498664HlfKzq','serviceCount','import','str','read','6611066qYnoCV','required','string','errors','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','kind','\x20service\x20','entries','cliName','commands','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','reduce','hash','2241612GYczsX','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk','28ypJKbU','Imported\x20','manifests','cliPath','write','lower\x20kebab-case\x20service\x20code','587128iswuUT','report','Service\x20Tree\x20manifest\x20file\x20path','target','filePath','WRITE','3Rwoyaq','updated','length','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','file','Updated','registryIndex','serviceCode','imported','855486SsENUO','registryPath','map','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Service\x20registry\x20validation\x20passed.','Imported','manifest','30bhkQmI','entry','warnings'];a41_0x4686=function(){return _0x3be560;};return a41_0x4686();}export const serviceDefinitions=[{'service':a41_0x44be85(0x163),'command':a41_0x44be85(0x16f),'description':a41_0x44be85(0x183),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x126894){const _0x5eb8ab=a41_0x44be85,_0x4c7503=loadServiceManifestFromFile(_0x126894[_0x5eb8ab(0x176)](_0x5eb8ab(0x154)));if(!_0x4c7503[_0x5eb8ab(0x14a)]['ok'])return{'ok':![],'data':{'file':_0x4c7503['filePath'],'hash':_0x4c7503['hash'],'kind':_0x4c7503[_0x5eb8ab(0x17d)],'serviceCount':_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x151)],'services':_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x15b)](summarizeLoadedManifest),'errors':_0x4c7503[_0x5eb8ab(0x14a)][_0x5eb8ab(0x17b)],'warnings':_0x4c7503[_0x5eb8ab(0x14a)][_0x5eb8ab(0x162)]},'message':formatValidationFailure(_0x4c7503[_0x5eb8ab(0x14a)])};if(_0x4c7503[_0x5eb8ab(0x17d)]==='registry'||_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x151)]!==0x1)return{'ok':!![],'data':{'file':_0x4c7503['filePath'],'hash':_0x4c7503['hash'],'kind':_0x4c7503['kind'],'serviceCount':_0x4c7503['manifests'][_0x5eb8ab(0x151)],'commandCount':_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x184)]((_0x528511,_0x5981a9)=>_0x528511+(_0x5981a9['normalizedManifest']?.['commands'][_0x5eb8ab(0x151)]??0x0),0x0),'services':_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x15b)](summarizeLoadedManifest),'warnings':_0x4c7503['report'][_0x5eb8ab(0x162)]},'message':_0x5eb8ab(0x15d)};return{'ok':!![],'data':{'file':_0x4c7503['filePath'],'hash':_0x4c7503['hash'],'kind':_0x4c7503[_0x5eb8ab(0x17d)],'service':_0x4c7503[_0x5eb8ab(0x165)]?.[_0x5eb8ab(0x163)],'version':_0x4c7503[_0x5eb8ab(0x165)]?.[_0x5eb8ab(0x168)],'commandCount':_0x4c7503[_0x5eb8ab(0x165)]?.[_0x5eb8ab(0x181)]['length']??0x0,'commands':_0x4c7503['normalizedManifest']?.[_0x5eb8ab(0x181)][_0x5eb8ab(0x15b)](_0x2f7642=>({'path':_0x2f7642[_0x5eb8ab(0x146)],'risk':_0x2f7642['risk'],'target':toPublicServiceTreeTarget(_0x2f7642['target'])})),'warnings':_0x4c7503[_0x5eb8ab(0x14a)][_0x5eb8ab(0x162)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a41_0x44be85(0x163),'command':a41_0x44be85(0x175),'description':a41_0x44be85(0x141),'risk':a41_0x44be85(0x147),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x3e21b5){const _0x1b948a=a41_0x44be85,_0x3a6693=loadServiceManifestFromFile(_0x3e21b5[_0x1b948a(0x176)](_0x1b948a(0x154)));return{'method':_0x1b948a(0x14e),'url':getServiceRegistryPath(),'body':{'file':_0x3a6693[_0x1b948a(0x14d)],'hash':_0x3a6693[_0x1b948a(0x13f)],'kind':_0x3a6693[_0x1b948a(0x17d)],'ok':_0x3a6693[_0x1b948a(0x14a)]['ok'],'service':_0x3a6693[_0x1b948a(0x165)]?.[_0x1b948a(0x163)],'version':_0x3a6693[_0x1b948a(0x165)]?.['version'],'serviceCount':_0x3a6693[_0x1b948a(0x145)]['length'],'services':_0x3a6693[_0x1b948a(0x145)][_0x1b948a(0x15b)](_0xf4a6e4=>({'service':_0xf4a6e4[_0x1b948a(0x165)]?.[_0x1b948a(0x163)],'version':_0xf4a6e4['normalizedManifest']?.[_0x1b948a(0x168)],'commandCount':_0xf4a6e4['normalizedManifest']?.['commands'][_0x1b948a(0x151)]??0x0,'errors':_0xf4a6e4[_0x1b948a(0x14a)][_0x1b948a(0x17b)]})),'errors':_0x3a6693['report']['errors'],'commandCount':_0x3a6693[_0x1b948a(0x165)]?.[_0x1b948a(0x181)][_0x1b948a(0x151)]??0x0},'description':_0x1b948a(0x182)};},async 'execute'(_0x36a24c){const _0x5e76d5=a41_0x44be85,_0x498d41=importServiceManifest(_0x36a24c[_0x5e76d5(0x176)](_0x5e76d5(0x154)));if(_0x498d41[_0x5e76d5(0x17f)][_0x5e76d5(0x151)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x498d41[_0x5e76d5(0x15a)],'imported':_0x498d41[_0x5e76d5(0x158)],'updated':_0x498d41['updated'],'serviceCount':_0x498d41[_0x5e76d5(0x174)],'services':_0x498d41[_0x5e76d5(0x17f)]['map'](summarizeService)},'message':_0x5e76d5(0x144)+_0x498d41[_0x5e76d5(0x158)]+'\x20service(s),\x20updated\x20'+_0x498d41[_0x5e76d5(0x150)]+_0x5e76d5(0x16c)};return{'ok':!![],'data':{'registryPath':_0x498d41['registryPath'],'replaced':_0x498d41['replaced'],'imported':_0x498d41[_0x5e76d5(0x158)],'updated':_0x498d41[_0x5e76d5(0x150)],'serviceCount':_0x498d41[_0x5e76d5(0x174)],'service':summarizeService(_0x498d41[_0x5e76d5(0x161)])},'message':(_0x498d41['replaced']?_0x5e76d5(0x155):_0x5e76d5(0x15e))+_0x5e76d5(0x17e)+_0x498d41[_0x5e76d5(0x161)]['serviceCode']+'.'};}},{'service':a41_0x44be85(0x163),'command':a41_0x44be85(0x166),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a41_0x44be85(0x147),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x492b06){const _0x5428e4=a41_0x44be85,_0x3fea5f=getLocalServiceEntry(_0x492b06['str'](_0x5428e4(0x163)));return{'method':_0x5428e4(0x14e),'url':_0x492b06[_0x5428e4(0x176)](_0x5428e4(0x154)),'body':{'service':_0x492b06[_0x5428e4(0x176)](_0x5428e4(0x163)),'found':Boolean(_0x3fea5f),'version':_0x3fea5f?.[_0x5428e4(0x168)],'source':_0x3fea5f?.[_0x5428e4(0x16b)]},'description':_0x5428e4(0x17c)};},async 'execute'(_0x208c3d){const _0xe2f87c=a41_0x44be85,_0x515788=exportServiceManifest(_0x208c3d['str'](_0xe2f87c(0x163)),_0x208c3d[_0xe2f87c(0x176)](_0xe2f87c(0x154)));return{'ok':!![],'data':{'registryPath':_0x515788[_0xe2f87c(0x15a)],'file':_0x515788[_0xe2f87c(0x14d)],'service':summarizeService(_0x515788[_0xe2f87c(0x161)])},'message':'Exported\x20service\x20'+_0x515788[_0xe2f87c(0x161)][_0xe2f87c(0x157)]+'.'};}},{'service':'service','command':'list','description':a41_0x44be85(0x15c),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x333ef0=a41_0x44be85,_0x5373f8=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x5373f8[_0x333ef0(0x151)],'services':_0x5373f8[_0x333ef0(0x15b)](summarizeService)}};}},{'service':'service','command':a41_0x44be85(0x171),'description':a41_0x44be85(0x153),'risk':a41_0x44be85(0x147),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x1b545b){const _0x3743ca=a41_0x44be85,_0x16aa43=getLocalServiceEntry(_0x1b545b[_0x3743ca(0x176)](_0x3743ca(0x163)));return{'method':_0x3743ca(0x14e),'url':getServiceRegistryPath(),'body':{'service':_0x1b545b[_0x3743ca(0x176)]('service'),'found':Boolean(_0x16aa43),'version':_0x16aa43?.[_0x3743ca(0x168)],'source':_0x16aa43?.[_0x3743ca(0x16b)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x1c9d4c){const _0x5cefd7=a41_0x44be85,_0x332377=removeServiceManifest(_0x1c9d4c[_0x5cefd7(0x176)](_0x5cefd7(0x163)));return{'ok':!![],'data':{'registryPath':_0x332377[_0x5cefd7(0x15a)],'serviceCount':_0x332377[_0x5cefd7(0x174)],'service':summarizeService(_0x332377[_0x5cefd7(0x161)])},'message':_0x5cefd7(0x172)+_0x332377['entry']['serviceCode']+'.'};}},{'service':'service','command':a41_0x44be85(0x167),'description':a41_0x44be85(0x152),'risk':a41_0x44be85(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x22278b){const _0x3e1f30=a41_0x44be85,_0x2889e9=getLocalServiceEntry(_0x22278b[_0x3e1f30(0x176)]('service'));if(!_0x2889e9)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x22278b[_0x3e1f30(0x176)](_0x3e1f30(0x163))},'message':'Local\x20service\x20not\x20found:\x20'+_0x22278b[_0x3e1f30(0x176)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2889e9),'manifest':_0x2889e9[_0x3e1f30(0x15f)],'normalizedManifest':toPublicNormalizedServiceTree(_0x2889e9[_0x3e1f30(0x165)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x14f98a=a42_0x115a;(function(_0x1676c1,_0x2ada09){const _0x3e0c95=a42_0x115a,_0x10bff7=_0x1676c1();while(!![]){try{const _0x2444b7=-parseInt(_0x3e0c95(0xe5))/0x1*(-parseInt(_0x3e0c95(0xb2))/0x2)+-parseInt(_0x3e0c95(0xe4))/0x3+-parseInt(_0x3e0c95(0xf0))/0x4+parseInt(_0x3e0c95(0xc4))/0x5+-parseInt(_0x3e0c95(0xb5))/0x6+parseInt(_0x3e0c95(0xdb))/0x7+parseInt(_0x3e0c95(0xbd))/0x8*(parseInt(_0x3e0c95(0xe7))/0x9);if(_0x2444b7===_0x2ada09)break;else _0x10bff7['push'](_0x10bff7['shift']());}catch(_0x4dbaf7){_0x10bff7['push'](_0x10bff7['shift']());}}}(a42_0x38d7,0xc92fe));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x14f98a(0xd7);export function getServiceRegistryPath(_0x4ffc2f={}){const _0x59ca84=a42_0x14f98a;return resolve(_0x4ffc2f[_0x59ca84(0xca)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x3dc6b0={}){const _0x195e2d=a42_0x14f98a,_0x16e7d6=getServiceRegistryPath(_0x3dc6b0);if(!existsSync(_0x16e7d6))return emptyServiceRegistry();try{const _0x578693=readFileSync(_0x16e7d6,'utf8');if(!_0x578693[_0x195e2d(0xda)]())return emptyServiceRegistry();const _0x325e40=JSON['parse'](_0x578693);if(_0x325e40[_0x195e2d(0xf6)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x195e2d(0xd0)+String(_0x325e40[_0x195e2d(0xf6)]),'Remove\x20or\x20migrate\x20'+_0x16e7d6+'.');if(!Array[_0x195e2d(0xc9)](_0x325e40['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x325e40[_0x195e2d(0xba)],'services':_0x325e40[_0x195e2d(0xd6)]};}catch(_0x455a81){if(_0x455a81 instanceof Error&&_0x455a81[_0x195e2d(0xf7)]==='CliError')throw _0x455a81;throw CliErrors['validation'](_0x195e2d(0xf1)+_0x16e7d6,_0x195e2d(0xde));}}export function writeServiceRegistry(_0x22ca30,_0x2b6c78={}){const _0x13557e=a42_0x14f98a,_0x5dd5ba=getServiceRegistryPath(_0x2b6c78),_0x33cb8d=dirname(_0x5dd5ba);!existsSync(_0x33cb8d)&&mkdirSync(_0x33cb8d,{'recursive':!![]});const _0x4e72e4=_0x5dd5ba+_0x13557e(0xd9);try{writeFileSync(_0x4e72e4,JSON[_0x13557e(0xbb)](_0x22ca30,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x4e72e4,_0x5dd5ba);}catch(_0x9f7dfd){try{unlinkSync(_0x4e72e4);}catch{}if(_0x9f7dfd?.[_0x13557e(0xb1)]==='ENOENT')throw CliErrors['validation'](_0x13557e(0xc2)+_0x5dd5ba);throw _0x9f7dfd;}return _0x5dd5ba;}export function loadServiceManifestFromFile(_0x18bfab){const _0x1ab3ab=a42_0x14f98a,_0x1eaa42=resolve(_0x18bfab);if(!existsSync(_0x1eaa42))throw CliErrors[_0x1ab3ab(0xdf)](_0x1ab3ab(0xef)+_0x18bfab);let _0x5b2eb2;const _0x17e619=readFileSync(_0x1eaa42,_0x1ab3ab(0xe0));try{_0x5b2eb2=JSON[_0x1ab3ab(0xec)](_0x17e619);}catch{throw CliErrors[_0x1ab3ab(0xdf)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x18bfab,_0x1ab3ab(0xeb));}const _0x64eb13=sha256(_0x17e619),_0x5e8799=extractLoadedServiceManifests(_0x5b2eb2,_0x64eb13),_0x39f3a6=aggregateValidationReports(_0x5e8799),_0x3c6a6b=_0x5e8799[0x0];return{'filePath':_0x1eaa42,'hash':_0x64eb13,'kind':isServiceRegistryLike(_0x5b2eb2)?'registry':_0x1ab3ab(0xb4),'manifest':_0x3c6a6b?.[_0x1ab3ab(0xb4)]??_0x5b2eb2,'report':_0x39f3a6,'normalizedManifest':_0x5e8799[_0x1ab3ab(0xcc)]===0x1?_0x3c6a6b?.[_0x1ab3ab(0xce)]:undefined,'manifests':_0x5e8799};}export function importServiceManifest(_0x49fc9a,_0x1c6203={}){const _0x5821fd=a42_0x14f98a,_0x21ae4f=loadServiceManifestFromFile(_0x49fc9a);if(!_0x21ae4f[_0x5821fd(0xac)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x21ae4f[_0x5821fd(0xac)]),_0x5821fd(0xd1));if(_0x21ae4f[_0x5821fd(0xb8)][_0x5821fd(0xcc)]===0x0)throw CliErrors['validation'](_0x5821fd(0xcf),_0x5821fd(0xc7));const _0x3a89ee=readServiceRegistry(_0x1c6203),_0x331cdd=(_0x1c6203[_0x5821fd(0xf5)]??(()=>new Date()))()['toISOString'](),_0x167b5f=[];let _0x4feed9=0x0,_0x3f8868=0x0;for(const _0x499738 of _0x21ae4f['manifests']){if(!_0x499738['normalizedManifest'])continue;const _0x249795=_0x499738[_0x5821fd(0xce)][_0x5821fd(0xe3)]['code'],_0x2aa873={'serviceCode':_0x249795,'version':_0x499738[_0x5821fd(0xce)]['version'],'importedAt':_0x331cdd,'source':{'type':_0x5821fd(0xe1),'path':_0x21ae4f['filePath'],'hash':_0x499738[_0x5821fd(0xb3)]},'manifest':_0x499738[_0x5821fd(0xb4)],'normalizedManifest':_0x499738['normalizedManifest']},_0x1d632c=_0x3a89ee['services'][_0x5821fd(0xea)](_0x23fdbf=>_0x23fdbf['serviceCode']===_0x249795);_0x1d632c>=0x0?(_0x3a89ee[_0x5821fd(0xd6)][_0x1d632c]=_0x2aa873,_0x3f8868++):(_0x3a89ee[_0x5821fd(0xd6)][_0x5821fd(0xb9)](_0x2aa873),_0x4feed9++),_0x167b5f[_0x5821fd(0xb9)](_0x2aa873);}_0x3a89ee[_0x5821fd(0xd6)]['sort']((_0x6a02a,_0x288d10)=>_0x6a02a['serviceCode']['localeCompare'](_0x288d10['serviceCode'])),_0x3a89ee[_0x5821fd(0xba)]=_0x331cdd;const _0x2c126a=writeServiceRegistry(_0x3a89ee,_0x1c6203);return{'registryPath':_0x2c126a,'entry':_0x167b5f[0x0],'replaced':_0x167b5f['length']===0x1?_0x3f8868===0x1:_0x3f8868>0x0,'entries':_0x167b5f,'imported':_0x4feed9,'updated':_0x3f8868,'serviceCount':_0x3a89ee['services'][_0x5821fd(0xcc)]};}export function exportServiceManifest(_0x562ab8,_0x5261ac,_0x57eca7={}){const _0x37cf5c=a42_0x14f98a,_0x4f7906=getServiceRegistryPath(_0x57eca7),_0x4f96ac=getLocalServiceEntry(_0x562ab8,_0x57eca7);if(!_0x4f96ac)throw CliErrors['validation'](_0x37cf5c(0xf3)+_0x562ab8,_0x37cf5c(0xb7));const _0x383106=resolve(_0x5261ac),_0x5d04e8=dirname(_0x383106);return!existsSync(_0x5d04e8)&&mkdirSync(_0x5d04e8,{'recursive':!![]}),writeFileSync(_0x383106,JSON['stringify'](_0x4f96ac[_0x37cf5c(0xb4)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0x4f7906,'filePath':_0x383106,'entry':_0x4f96ac};}export function removeServiceManifest(_0x25ffa9,_0x24254c={}){const _0x21301f=a42_0x14f98a,_0x224d52=readServiceRegistry(_0x24254c),_0x166b9f=_0x25ffa9[_0x21301f(0xda)](),_0x5e718c=_0x224d52['services'][_0x21301f(0xea)](_0x4e9924=>_0x4e9924['serviceCode']===_0x166b9f);if(_0x5e718c<0x0)throw CliErrors[_0x21301f(0xdf)](_0x21301f(0xf3)+_0x166b9f,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x3bd59c]=_0x224d52[_0x21301f(0xd6)]['splice'](_0x5e718c,0x1),_0x2f6a78=(_0x24254c['now']??(()=>new Date()))()['toISOString']();_0x224d52[_0x21301f(0xba)]=_0x2f6a78;const _0x51419d=writeServiceRegistry(_0x224d52,_0x24254c);return{'registryPath':_0x51419d,'entry':_0x3bd59c,'serviceCount':_0x224d52[_0x21301f(0xd6)][_0x21301f(0xcc)]};}export function listLocalServices(_0x4aa523={}){const _0x56ebb5=a42_0x14f98a;return readServiceRegistry(_0x4aa523)[_0x56ebb5(0xd6)];}export function getLocalServiceEntry(_0x4758d7,_0x4fe42e={}){const _0x33028c=a42_0x14f98a;return readServiceRegistry(_0x4fe42e)[_0x33028c(0xd6)]['find'](_0x1e7b0c=>_0x1e7b0c[_0x33028c(0xed)]===_0x4758d7[_0x33028c(0xda)]());}export function listLocalServiceTrees(_0x1888d1={}){const _0x5313c1=a42_0x14f98a;return readServiceRegistry(_0x1888d1)['services'][_0x5313c1(0xe6)](_0x1f3d04=>_0x1f3d04[_0x5313c1(0xce)]);}export function inspectServiceRegistry(_0x4be558={}){const _0x3ad03e=a42_0x14f98a,_0x4ecaf3=getServiceRegistryPath(_0x4be558);if(!existsSync(_0x4ecaf3))return emptyServiceRegistryInspection(_0x4ecaf3,_0x3ad03e(0xc5),![]);try{const _0x19252d=readFileSync(_0x4ecaf3,_0x3ad03e(0xe0));if(!_0x19252d[_0x3ad03e(0xda)]())return emptyServiceRegistryInspection(_0x4ecaf3,_0x3ad03e(0xdc),!![]);const _0x3387bc=JSON[_0x3ad03e(0xec)](_0x19252d);if(_0x3387bc[_0x3ad03e(0xf6)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x4ecaf3,'invalid',!![]),'schemaVersion':_0x3387bc['schemaVersion'],'message':_0x3ad03e(0xc1)+String(_0x3387bc['schemaVersion'])};if(!Array[_0x3ad03e(0xc9)](_0x3387bc[_0x3ad03e(0xd6)]))return{...emptyServiceRegistryInspection(_0x4ecaf3,_0x3ad03e(0xc0),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3387bc['updatedAt'],'message':'services\x20must\x20be\x20an\x20array'};const _0x1aa647=_0x3387bc[_0x3ad03e(0xd6)][_0x3ad03e(0xe6)](summarizeLocalServiceEntry);return{'registryPath':_0x4ecaf3,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3387bc[_0x3ad03e(0xba)],'serviceCount':_0x1aa647[_0x3ad03e(0xcc)],'commandCount':_0x1aa647[_0x3ad03e(0xd2)]((_0xa30e2f,_0x2d250e)=>_0xa30e2f+_0x2d250e[_0x3ad03e(0xb0)],0x0),'services':_0x1aa647};}catch(_0x83e87b){return{...emptyServiceRegistryInspection(_0x4ecaf3,_0x3ad03e(0xc0),!![]),'message':_0x83e87b instanceof Error?_0x83e87b['message']:String(_0x83e87b)};}}export function formatValidationFailure(_0x9b77d0){const _0x3a8f68=a42_0x14f98a,_0x60433c=_0x9b77d0[_0x3a8f68(0xe8)]['map'](_0x2698d0=>_0x2698d0[_0x3a8f68(0xe9)]+':\x20'+_0x2698d0[_0x3a8f68(0xb6)]);return _0x3a8f68(0xf4)+_0x60433c[_0x3a8f68(0xd4)]('\x0a');}function extractLoadedServiceManifests(_0x1c0d00,_0xef4567){const _0x4d9302=a42_0x14f98a;if(!isServiceRegistryLike(_0x1c0d00)){const _0x3cf306=_0x1c0d00,{manifest:_0x277899,errors:_0x516b4f}=adaptServiceTreeManifestForLegacyFramework(_0x3cf306),_0x185fcd=validateServiceTreeManifest(_0x277899),_0x33983e=mergeValidationErrors(_0x185fcd,_0x516b4f);return[{'manifest':_0x3cf306,'report':_0x33983e,'normalizedManifest':_0x33983e['ok']?normalizeServiceTreeManifest(_0x277899):undefined,'sourceHash':_0xef4567}];}return _0x1c0d00['services'][_0x4d9302(0xe6)]((_0x418b2e,_0xe3a6bf)=>{const _0x9b310b=_0x4d9302,_0x1a6560=isObjectRecord(_0x418b2e)?_0x418b2e[_0x9b310b(0xb4)]:undefined,{manifest:_0x2b7e62,errors:_0x5b713b}=adaptServiceTreeManifestForLegacyFramework(_0x1a6560),_0x41227c=validateServiceTreeManifest(_0x2b7e62),_0x55815f=mergeValidationErrors(_0x41227c,_0x5b713b),_0x3baf00=isObjectRecord(_0x418b2e)&&typeof _0x418b2e['serviceCode']===_0x9b310b(0xee)?_0x418b2e['serviceCode']:undefined;return{'manifest':_0x1a6560,'report':_0x55815f,'normalizedManifest':_0x55815f['ok']?normalizeServiceTreeManifest(_0x2b7e62):undefined,'sourceHash':sha256(JSON[_0x9b310b(0xbb)](_0x1a6560,null,0x2)+'\x0a'),'registryIndex':_0xe3a6bf,'registryServiceCode':_0x3baf00};});}function mergeValidationErrors(_0x95ff19,_0x2492e5){const _0x289038=a42_0x14f98a,_0x3f3f8e=_0x95ff19[_0x289038(0xe8)]['map'](_0x72cb52=>_0x72cb52[_0x289038(0xb6)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x72cb52,'message':_0x289038(0xcb)}:_0x72cb52),_0x1f51b1=[..._0x2492e5,..._0x3f3f8e];return{'ok':_0x1f51b1['length']===0x0,'errors':_0x1f51b1,'warnings':_0x95ff19[_0x289038(0xaf)]};}function a42_0x115a(_0x4e4187,_0x3bec70){_0x4e4187=_0x4e4187-0xac;const _0x38d765=a42_0x38d7();let _0x115a8c=_0x38d765[_0x4e4187];return _0x115a8c;}function aggregateValidationReports(_0x2569f0){const _0x1d7e5f=a42_0x14f98a,_0x376358=_0x2569f0['flatMap'](_0xe2e7dd=>_0xe2e7dd[_0x1d7e5f(0xc8)]===undefined?_0xe2e7dd[_0x1d7e5f(0xac)]['errors']:_0xe2e7dd['report']['errors']['map'](_0x3b91fd=>({..._0x3b91fd,'path':prefixRegistryIssuePath(_0xe2e7dd[_0x1d7e5f(0xc8)],_0x3b91fd[_0x1d7e5f(0xe9)])}))),_0x38cea0=_0x2569f0['flatMap'](_0x43e36d=>_0x43e36d[_0x1d7e5f(0xc8)]===undefined?_0x43e36d['report'][_0x1d7e5f(0xaf)]:_0x43e36d[_0x1d7e5f(0xac)][_0x1d7e5f(0xaf)][_0x1d7e5f(0xe6)](_0x1c6584=>({..._0x1c6584,'path':prefixRegistryIssuePath(_0x43e36d['registryIndex'],_0x1c6584[_0x1d7e5f(0xe9)])})));return{'ok':_0x376358['length']===0x0,'errors':_0x376358,'warnings':_0x38cea0};}function prefixRegistryIssuePath(_0xb771b2,_0x5021ff){const _0xb438de=a42_0x14f98a;if(_0x5021ff==='$')return _0xb438de(0xd5)+_0xb771b2+_0xb438de(0xad);if(_0x5021ff['startsWith']('$.'))return _0xb438de(0xd5)+_0xb771b2+'].manifest'+_0x5021ff[_0xb438de(0xc3)](0x1);if(_0x5021ff[_0xb438de(0xf2)]('$['))return _0xb438de(0xd5)+_0xb771b2+_0xb438de(0xad)+_0x5021ff[_0xb438de(0xc3)](0x1);return _0xb438de(0xd5)+_0xb771b2+_0xb438de(0xe2)+_0x5021ff;}function isServiceRegistryLike(_0x1232b6){const _0x31938a=a42_0x14f98a;return isObjectRecord(_0x1232b6)&&_0x1232b6[_0x31938a(0xf6)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x31938a(0xc9)](_0x1232b6['services']);}function a42_0x38d7(){const _0x16da23=['.tmp','trim','4105192PlumQe','empty','target','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','validation','utf8','file','].manifest.','service','3939819vJwkZW','2824ZoVCtU','map','9051102OvQthY','errors','path','findIndex','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','parse','serviceCode','string','Service\x20manifest\x20file\x20not\x20found:\x20','2060796kujPly','Invalid\x20service\x20registry\x20JSON:\x20','startsWith','Local\x20service\x20not\x20found:\x20','Service\x20manifest\x20validation\x20failed:\x0a','now','schemaVersion','name','report','].manifest','source','warnings','commandCount','code','912Eogshc','sourceHash','manifest','1501218SYdoUd','message','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','manifests','push','updatedAt','stringify','risk','8EwEpdo','sha256','object','invalid','Unsupported\x20schemaVersion:\x20','Cannot\x20write\x20service\x20registry:\x20','slice','114295ycbVHf','missing','command','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','registryIndex','isArray','homeDir','bff\x20target\x20requires\x20functionName.','length','version','normalizedManifest','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Unsupported\x20service\x20registry\x20schemaVersion:\x20','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','reduce','importedAt','join','$.services[','services','service.json','cliPath'];a42_0x38d7=function(){return _0x16da23;};return a42_0x38d7();}function isObjectRecord(_0x37b7d3){const _0x456471=a42_0x14f98a;return Boolean(_0x37b7d3)&&typeof _0x37b7d3===_0x456471(0xbf)&&!Array[_0x456471(0xc9)](_0x37b7d3);}function emptyServiceRegistryInspection(_0x733e13,_0x1eb9dc,_0x1045d2){return{'registryPath':_0x733e13,'exists':_0x1045d2,'status':_0x1eb9dc,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x10ad44){const _0x4263ec=a42_0x14f98a,_0x39b3d3=_0x10ad44['normalizedManifest'],_0x12de14=_0x39b3d3['commands'][_0x4263ec(0xe6)](_0x24e4b2=>({'path':_0x24e4b2[_0x4263ec(0xd8)],'description':_0x24e4b2['description'],'risk':_0x24e4b2[_0x4263ec(0xbc)],'targetKind':_0x24e4b2[_0x4263ec(0xdd)]['kind'],'targetCommand':_0x24e4b2[_0x4263ec(0xdd)][_0x4263ec(0xc6)]}));return{'serviceCode':_0x10ad44[_0x4263ec(0xed)],'name':_0x39b3d3[_0x4263ec(0xe3)][_0x4263ec(0xf7)],'description':_0x39b3d3['service']['description'],'version':_0x10ad44[_0x4263ec(0xcd)],'importedAt':_0x10ad44[_0x4263ec(0xd3)],'source':_0x10ad44[_0x4263ec(0xae)],'commandCount':_0x12de14[_0x4263ec(0xcc)],'commands':_0x12de14};}function sha256(_0x17101b){const _0x4cbbd5=a42_0x14f98a;return createHash(_0x4cbbd5(0xbe))['update'](_0x17101b)['digest']('hex');}
|
|
1
|
+
function a42_0x2a62(){const _0x4f35a0=['50SvKIac','findIndex','missing','ENOENT','service','filePath','$.services[','startsWith','services','registryIndex','214227wPxntD','importedAt','risk','update','digest','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','503288EuuFGP','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','map','message','Invalid\x20service\x20manifest\x20JSON:\x20','cliPath','utf8','isArray','trim','241845GfTFKk','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','].manifest','hex','validation','path','serviceCode','toISOString','normalizedManifest','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','360156BGeRME','schemaVersion','target','empty','4JoXPEq','parse','warnings','report','homeDir','sourceHash','slice','Unsupported\x20schemaVersion:\x20','7230zZHcBe','invalid','1972912gFsEZQ','Local\x20service\x20not\x20found:\x20','stringify','553xuwQet','length','homeDirName','join','reduce','].manifest.','Service\x20manifest\x20validation\x20failed:\x0a','find','localeCompare','command','now','updatedAt','push','description','bff\x20target\x20requires\x20functionName.','splice','sha256','.tmp','version','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','services\x20must\x20be\x20an\x20array','errors','name','Unsupported\x20service\x20registry\x20schemaVersion:\x20','flatMap','commandCount','Cannot\x20write\x20service\x20registry:\x20','manifest','1458890EgKzEU'];a42_0x2a62=function(){return _0x4f35a0;};return a42_0x2a62();}(function(_0x3dd9b8,_0x9be4ef){const _0x2b1387=a42_0x57fb,_0x1370e2=_0x3dd9b8();while(!![]){try{const _0x49c613=-parseInt(_0x2b1387(0x1c8))/0x1+parseInt(_0x2b1387(0x1bf))/0x2+parseInt(_0x2b1387(0x1d2))/0x3+parseInt(_0x2b1387(0x1d6))/0x4*(parseInt(_0x2b1387(0x1ae))/0x5)+parseInt(_0x2b1387(0x1de))/0x6*(parseInt(_0x2b1387(0x192))/0x7)+-parseInt(_0x2b1387(0x1e0))/0x8+-parseInt(_0x2b1387(0x1b9))/0x9*(parseInt(_0x2b1387(0x1af))/0xa);if(_0x49c613===_0x9be4ef)break;else _0x1370e2['push'](_0x1370e2['shift']());}catch(_0x5d4a94){_0x1370e2['push'](_0x1370e2['shift']());}}}(a42_0x2a62,0x24e9b));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';function a42_0x57fb(_0x5c5b3d,_0x196bc5){_0x5c5b3d=_0x5c5b3d-0x192;const _0x2a629e=a42_0x2a62();let _0x57fb76=_0x2a629e[_0x5c5b3d];return _0x57fb76;}import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';export function getServiceRegistryPath(_0x30d118={}){const _0x421572=a42_0x57fb;return resolve(_0x30d118[_0x421572(0x1da)]??homedir(),PRODUCT_CONFIG[_0x421572(0x194)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x16ee48={}){const _0x159d30=a42_0x57fb,_0x574b03=getServiceRegistryPath(_0x16ee48);if(!existsSync(_0x574b03))return emptyServiceRegistry();try{const _0xec468c=readFileSync(_0x574b03,'utf8');if(!_0xec468c[_0x159d30(0x1c7)]())return emptyServiceRegistry();const _0x4f7058=JSON[_0x159d30(0x1d7)](_0xec468c);if(_0x4f7058[_0x159d30(0x1d3)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x159d30(0x1a9)+String(_0x4f7058[_0x159d30(0x1d3)]),'Remove\x20or\x20migrate\x20'+_0x574b03+'.');if(!Array[_0x159d30(0x1c6)](_0x4f7058[_0x159d30(0x1b7)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x4f7058[_0x159d30(0x19d)],'services':_0x4f7058[_0x159d30(0x1b7)]};}catch(_0x346c33){if(_0x346c33 instanceof Error&&_0x346c33[_0x159d30(0x1a8)]==='CliError')throw _0x346c33;throw CliErrors[_0x159d30(0x1cc)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0x574b03,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x170a35,_0x26ef31={}){const _0x3b87c7=a42_0x57fb,_0x26f5e3=getServiceRegistryPath(_0x26ef31),_0x5bb9c5=dirname(_0x26f5e3);!existsSync(_0x5bb9c5)&&mkdirSync(_0x5bb9c5,{'recursive':!![]});const _0x390d76=_0x26f5e3+_0x3b87c7(0x1a3);try{writeFileSync(_0x390d76,JSON['stringify'](_0x170a35,null,0x2)+'\x0a',{'encoding':_0x3b87c7(0x1c5),'mode':0x180}),renameSync(_0x390d76,_0x26f5e3);}catch(_0x39b521){try{unlinkSync(_0x390d76);}catch{}if(_0x39b521?.['code']===_0x3b87c7(0x1b2))throw CliErrors[_0x3b87c7(0x1cc)](_0x3b87c7(0x1ac)+_0x26f5e3);throw _0x39b521;}return _0x26f5e3;}export function loadServiceManifestFromFile(_0xbf01c4){const _0xf65848=a42_0x57fb,_0xd5cacf=resolve(_0xbf01c4);if(!existsSync(_0xd5cacf))throw CliErrors['validation']('Service\x20manifest\x20file\x20not\x20found:\x20'+_0xbf01c4);let _0x4736fb;const _0xe1d372=readFileSync(_0xd5cacf,_0xf65848(0x1c5));try{_0x4736fb=JSON[_0xf65848(0x1d7)](_0xe1d372);}catch{throw CliErrors[_0xf65848(0x1cc)](_0xf65848(0x1c3)+_0xbf01c4,_0xf65848(0x1c0));}const _0x469bf7=sha256(_0xe1d372),_0x3e7451=extractLoadedServiceManifests(_0x4736fb,_0x469bf7),_0x6187f8=aggregateValidationReports(_0x3e7451),_0x5dacdf=_0x3e7451[0x0];return{'filePath':_0xd5cacf,'hash':_0x469bf7,'kind':isServiceRegistryLike(_0x4736fb)?'registry':_0xf65848(0x1ad),'manifest':_0x5dacdf?.[_0xf65848(0x1ad)]??_0x4736fb,'report':_0x6187f8,'normalizedManifest':_0x3e7451['length']===0x1?_0x5dacdf?.['normalizedManifest']:undefined,'manifests':_0x3e7451};}export function importServiceManifest(_0x230884,_0x1baa4b={}){const _0x387e6d=a42_0x57fb,_0xae6bbc=loadServiceManifestFromFile(_0x230884);if(!_0xae6bbc[_0x387e6d(0x1d9)]['ok'])throw CliErrors[_0x387e6d(0x1cc)](formatValidationFailure(_0xae6bbc[_0x387e6d(0x1d9)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0xae6bbc['manifests'][_0x387e6d(0x193)]===0x0)throw CliErrors[_0x387e6d(0x1cc)](_0x387e6d(0x1c9),_0x387e6d(0x1d1));const _0x208703=readServiceRegistry(_0x1baa4b),_0x1b0f46=(_0x1baa4b['now']??(()=>new Date()))()[_0x387e6d(0x1cf)](),_0x3a1026=[];let _0x356d8=0x0,_0x293657=0x0;for(const _0x482c90 of _0xae6bbc['manifests']){if(!_0x482c90[_0x387e6d(0x1d0)])continue;const _0x48a0c7=_0x482c90['normalizedManifest']['service']['code'],_0xb27eb5={'serviceCode':_0x48a0c7,'version':_0x482c90[_0x387e6d(0x1d0)]['version'],'importedAt':_0x1b0f46,'source':{'type':'file','path':_0xae6bbc[_0x387e6d(0x1b4)],'hash':_0x482c90[_0x387e6d(0x1db)]},'manifest':_0x482c90[_0x387e6d(0x1ad)],'normalizedManifest':_0x482c90['normalizedManifest']},_0x4166ea=_0x208703[_0x387e6d(0x1b7)][_0x387e6d(0x1b0)](_0x1876f1=>_0x1876f1[_0x387e6d(0x1ce)]===_0x48a0c7);_0x4166ea>=0x0?(_0x208703[_0x387e6d(0x1b7)][_0x4166ea]=_0xb27eb5,_0x293657++):(_0x208703[_0x387e6d(0x1b7)][_0x387e6d(0x19e)](_0xb27eb5),_0x356d8++),_0x3a1026[_0x387e6d(0x19e)](_0xb27eb5);}_0x208703['services']['sort']((_0x592fa2,_0x2a9827)=>_0x592fa2[_0x387e6d(0x1ce)][_0x387e6d(0x19a)](_0x2a9827[_0x387e6d(0x1ce)])),_0x208703[_0x387e6d(0x19d)]=_0x1b0f46;const _0x59a8f1=writeServiceRegistry(_0x208703,_0x1baa4b);return{'registryPath':_0x59a8f1,'entry':_0x3a1026[0x0],'replaced':_0x3a1026[_0x387e6d(0x193)]===0x1?_0x293657===0x1:_0x293657>0x0,'entries':_0x3a1026,'imported':_0x356d8,'updated':_0x293657,'serviceCount':_0x208703[_0x387e6d(0x1b7)][_0x387e6d(0x193)]};}export function exportServiceManifest(_0x45e710,_0x42bc37,_0x2bb3e0={}){const _0x33ae7f=a42_0x57fb,_0x5c1f00=getServiceRegistryPath(_0x2bb3e0),_0x435897=getLocalServiceEntry(_0x45e710,_0x2bb3e0);if(!_0x435897)throw CliErrors['validation'](_0x33ae7f(0x1e1)+_0x45e710,_0x33ae7f(0x1a5));const _0x54a99a=resolve(_0x42bc37),_0xa303a8=dirname(_0x54a99a);return!existsSync(_0xa303a8)&&mkdirSync(_0xa303a8,{'recursive':!![]}),writeFileSync(_0x54a99a,JSON[_0x33ae7f(0x1e2)](_0x435897[_0x33ae7f(0x1ad)],null,0x2)+'\x0a',{'encoding':_0x33ae7f(0x1c5),'mode':0x180}),{'registryPath':_0x5c1f00,'filePath':_0x54a99a,'entry':_0x435897};}export function removeServiceManifest(_0x504e99,_0x3f9874={}){const _0x1baf36=a42_0x57fb,_0x1529b4=readServiceRegistry(_0x3f9874),_0x2dae64=_0x504e99[_0x1baf36(0x1c7)](),_0x4d5f94=_0x1529b4[_0x1baf36(0x1b7)]['findIndex'](_0x32fd67=>_0x32fd67[_0x1baf36(0x1ce)]===_0x2dae64);if(_0x4d5f94<0x0)throw CliErrors[_0x1baf36(0x1cc)]('Local\x20service\x20not\x20found:\x20'+_0x2dae64,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x46fa57]=_0x1529b4['services'][_0x1baf36(0x1a1)](_0x4d5f94,0x1),_0x2a3f0b=(_0x3f9874[_0x1baf36(0x19c)]??(()=>new Date()))()[_0x1baf36(0x1cf)]();_0x1529b4['updatedAt']=_0x2a3f0b;const _0x3c17bf=writeServiceRegistry(_0x1529b4,_0x3f9874);return{'registryPath':_0x3c17bf,'entry':_0x46fa57,'serviceCount':_0x1529b4['services'][_0x1baf36(0x193)]};}export function listLocalServices(_0xa13bd3={}){const _0x3d763b=a42_0x57fb;return readServiceRegistry(_0xa13bd3)[_0x3d763b(0x1b7)];}export function getLocalServiceEntry(_0x459690,_0x231312={}){const _0x23b21a=a42_0x57fb;return readServiceRegistry(_0x231312)[_0x23b21a(0x1b7)][_0x23b21a(0x199)](_0x1c5b24=>_0x1c5b24[_0x23b21a(0x1ce)]===_0x459690['trim']());}export function listLocalServiceTrees(_0x3f330e={}){const _0x331c1b=a42_0x57fb;return readServiceRegistry(_0x3f330e)[_0x331c1b(0x1b7)][_0x331c1b(0x1c1)](_0x3dbb19=>_0x3dbb19[_0x331c1b(0x1d0)]);}export function inspectServiceRegistry(_0x57dabe={}){const _0x4153bc=a42_0x57fb,_0x1ce515=getServiceRegistryPath(_0x57dabe);if(!existsSync(_0x1ce515))return emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1b1),![]);try{const _0x4ad50d=readFileSync(_0x1ce515,_0x4153bc(0x1c5));if(!_0x4ad50d[_0x4153bc(0x1c7)]())return emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1d5),!![]);const _0x5a03ee=JSON[_0x4153bc(0x1d7)](_0x4ad50d);if(_0x5a03ee['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1df),!![]),'schemaVersion':_0x5a03ee[_0x4153bc(0x1d3)],'message':_0x4153bc(0x1dd)+String(_0x5a03ee[_0x4153bc(0x1d3)])};if(!Array['isArray'](_0x5a03ee[_0x4153bc(0x1b7)]))return{...emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1df),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5a03ee[_0x4153bc(0x19d)],'message':_0x4153bc(0x1a6)};const _0x300010=_0x5a03ee[_0x4153bc(0x1b7)][_0x4153bc(0x1c1)](summarizeLocalServiceEntry);return{'registryPath':_0x1ce515,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5a03ee[_0x4153bc(0x19d)],'serviceCount':_0x300010[_0x4153bc(0x193)],'commandCount':_0x300010[_0x4153bc(0x196)]((_0x153e61,_0x491b37)=>_0x153e61+_0x491b37[_0x4153bc(0x1ab)],0x0),'services':_0x300010};}catch(_0x2d6269){return{...emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1df),!![]),'message':_0x2d6269 instanceof Error?_0x2d6269[_0x4153bc(0x1c2)]:String(_0x2d6269)};}}export function formatValidationFailure(_0xe37e42){const _0x3b780e=a42_0x57fb,_0x3986cc=_0xe37e42[_0x3b780e(0x1a7)][_0x3b780e(0x1c1)](_0x2886b2=>_0x2886b2[_0x3b780e(0x1cd)]+':\x20'+_0x2886b2[_0x3b780e(0x1c2)]);return _0x3b780e(0x198)+_0x3986cc[_0x3b780e(0x195)]('\x0a');}function extractLoadedServiceManifests(_0x522057,_0x369cbb){const _0x3144ab=a42_0x57fb;if(!isServiceRegistryLike(_0x522057)){const _0x38f3cc=_0x522057,{manifest:_0x30d453,errors:_0x3728fa}=adaptServiceTreeManifestForLegacyFramework(_0x38f3cc),_0x438396=validateServiceTreeManifest(_0x30d453),_0x5ccc2e=mergeValidationErrors(_0x438396,_0x3728fa);return[{'manifest':_0x38f3cc,'report':_0x5ccc2e,'normalizedManifest':_0x5ccc2e['ok']?normalizeServiceTreeManifest(_0x30d453):undefined,'sourceHash':_0x369cbb}];}return _0x522057[_0x3144ab(0x1b7)][_0x3144ab(0x1c1)]((_0x51838d,_0x12d6f1)=>{const _0x1f562e=_0x3144ab,_0x9d7e9d=isObjectRecord(_0x51838d)?_0x51838d[_0x1f562e(0x1ad)]:undefined,{manifest:_0x2e3840,errors:_0x21ccc3}=adaptServiceTreeManifestForLegacyFramework(_0x9d7e9d),_0x4cbbcd=validateServiceTreeManifest(_0x2e3840),_0x4ac3da=mergeValidationErrors(_0x4cbbcd,_0x21ccc3),_0x4ecc7c=isObjectRecord(_0x51838d)&&typeof _0x51838d[_0x1f562e(0x1ce)]==='string'?_0x51838d[_0x1f562e(0x1ce)]:undefined;return{'manifest':_0x9d7e9d,'report':_0x4ac3da,'normalizedManifest':_0x4ac3da['ok']?normalizeServiceTreeManifest(_0x2e3840):undefined,'sourceHash':sha256(JSON[_0x1f562e(0x1e2)](_0x9d7e9d,null,0x2)+'\x0a'),'registryIndex':_0x12d6f1,'registryServiceCode':_0x4ecc7c};});}function mergeValidationErrors(_0x551fcd,_0x3b3f62){const _0x24144a=a42_0x57fb,_0x18054b=_0x551fcd[_0x24144a(0x1a7)][_0x24144a(0x1c1)](_0x42d20f=>_0x42d20f[_0x24144a(0x1c2)]===_0x24144a(0x1be)?{..._0x42d20f,'message':_0x24144a(0x1a0)}:_0x42d20f),_0x4855e4=[..._0x3b3f62,..._0x18054b];return{'ok':_0x4855e4['length']===0x0,'errors':_0x4855e4,'warnings':_0x551fcd[_0x24144a(0x1d8)]};}function aggregateValidationReports(_0x546e5b){const _0x1573a1=a42_0x57fb,_0xa9d5bc=_0x546e5b[_0x1573a1(0x1aa)](_0x225b08=>_0x225b08['registryIndex']===undefined?_0x225b08[_0x1573a1(0x1d9)][_0x1573a1(0x1a7)]:_0x225b08[_0x1573a1(0x1d9)][_0x1573a1(0x1a7)]['map'](_0x5afc3b=>({..._0x5afc3b,'path':prefixRegistryIssuePath(_0x225b08['registryIndex'],_0x5afc3b[_0x1573a1(0x1cd)])}))),_0x3df592=_0x546e5b[_0x1573a1(0x1aa)](_0x47503f=>_0x47503f[_0x1573a1(0x1b8)]===undefined?_0x47503f[_0x1573a1(0x1d9)]['warnings']:_0x47503f[_0x1573a1(0x1d9)][_0x1573a1(0x1d8)]['map'](_0x205259=>({..._0x205259,'path':prefixRegistryIssuePath(_0x47503f[_0x1573a1(0x1b8)],_0x205259[_0x1573a1(0x1cd)])})));return{'ok':_0xa9d5bc[_0x1573a1(0x193)]===0x0,'errors':_0xa9d5bc,'warnings':_0x3df592};}function prefixRegistryIssuePath(_0x4f4f5e,_0x4a6545){const _0x4176f9=a42_0x57fb;if(_0x4a6545==='$')return'$.services['+_0x4f4f5e+'].manifest';if(_0x4a6545[_0x4176f9(0x1b6)]('$.'))return'$.services['+_0x4f4f5e+_0x4176f9(0x1ca)+_0x4a6545[_0x4176f9(0x1dc)](0x1);if(_0x4a6545['startsWith']('$['))return _0x4176f9(0x1b5)+_0x4f4f5e+_0x4176f9(0x1ca)+_0x4a6545['slice'](0x1);return _0x4176f9(0x1b5)+_0x4f4f5e+_0x4176f9(0x197)+_0x4a6545;}function isServiceRegistryLike(_0x144d5d){const _0x7a7be3=a42_0x57fb;return isObjectRecord(_0x144d5d)&&_0x144d5d[_0x7a7be3(0x1d3)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x7a7be3(0x1c6)](_0x144d5d[_0x7a7be3(0x1b7)]);}function isObjectRecord(_0x150cb8){const _0x2b5502=a42_0x57fb;return Boolean(_0x150cb8)&&typeof _0x150cb8==='object'&&!Array[_0x2b5502(0x1c6)](_0x150cb8);}function emptyServiceRegistryInspection(_0x198753,_0x482cc3,_0x2104c9){return{'registryPath':_0x198753,'exists':_0x2104c9,'status':_0x482cc3,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x427b00){const _0x76650b=a42_0x57fb,_0x2ba136=_0x427b00['normalizedManifest'],_0x45c134=_0x2ba136['commands']['map'](_0x3cf6e4=>({'path':_0x3cf6e4[_0x76650b(0x1c4)],'description':_0x3cf6e4[_0x76650b(0x19f)],'risk':_0x3cf6e4[_0x76650b(0x1bb)],'targetKind':_0x3cf6e4[_0x76650b(0x1d4)]['kind'],'targetCommand':_0x3cf6e4[_0x76650b(0x1d4)][_0x76650b(0x19b)]}));return{'serviceCode':_0x427b00[_0x76650b(0x1ce)],'name':_0x2ba136[_0x76650b(0x1b3)][_0x76650b(0x1a8)],'description':_0x2ba136[_0x76650b(0x1b3)][_0x76650b(0x19f)],'version':_0x427b00[_0x76650b(0x1a4)],'importedAt':_0x427b00[_0x76650b(0x1ba)],'source':_0x427b00['source'],'commandCount':_0x45c134[_0x76650b(0x193)],'commands':_0x45c134};}function sha256(_0x148cfc){const _0x29fe03=a42_0x57fb;return createHash(_0x29fe03(0x1a2))[_0x29fe03(0x1bc)](_0x148cfc)[_0x29fe03(0x1bd)](_0x29fe03(0x1cb));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0xae52a7=a43_0x1c94;(function(_0x4629b4,_0x5285da){const _0x531452=a43_0x1c94,_0x59b3a2=_0x4629b4();while(!![]){try{const _0x2b5d03=parseInt(_0x531452(0x128))/0x1+parseInt(_0x531452(0x126))/0x2+-parseInt(_0x531452(0x123))/0x3*(parseInt(_0x531452(0x125))/0x4)+parseInt(_0x531452(0x132))/0x5*(-parseInt(_0x531452(0x11b))/0x6)+-parseInt(_0x531452(0x122))/0x7+parseInt(_0x531452(0x136))/0x8*(-parseInt(_0x531452(0x13b))/0x9)+parseInt(_0x531452(0x130))/0xa*(parseInt(_0x531452(0x12f))/0xb);if(_0x2b5d03===_0x5285da)break;else _0x59b3a2['push'](_0x59b3a2['shift']());}catch(_0x437f06){_0x59b3a2['push'](_0x59b3a2['shift']());}}}(a43_0x1df7,0x341bf));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';function a43_0x1c94(_0x4af27a,_0x5d9ed9){_0x4af27a=_0x4af27a-0x118;const _0x1df7b8=a43_0x1df7();let _0x1c94c9=_0x1df7b8[_0x4af27a];return _0x1c94c9;}import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';function a43_0x1df7(){const _0x28f635=['path','map','skillName','validation','28503yzgVUC','utf8','force','target','24HIUJcn','create','isSymbolicLink','name','isDirectory','files','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','2796759GEkBXk','183kLSNsM','trim','23444cQRKSC','743582GuBuxJ','Created\x20local\x20Skill\x20draft\x20','34582TlqRdz','bool','type','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','str','content','skillDir','11RKVtdJ','8687010ygNtUj','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','273835APiTgq','rendered','Refusing\x20to\x20overwrite\x20symlink:\x20','Skill\x20directory\x20already\x20exists:\x20','216yMbCGM'];a43_0x1df7=function(){return _0x28f635;};return a43_0x1df7();}import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':'skill','command':a43_0xae52a7(0x11c),'description':'Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x2771c8){const _0x158559=a43_0xae52a7,_0x166020=buildSkillCreatePlan(_0x2771c8[_0x158559(0x12c)](_0x158559(0x11e)),_0x2771c8[_0x158559(0x12c)]('type'),_0x2771c8[_0x158559(0x12c)](_0x158559(0x11a)));return{'method':'WRITE','url':_0x166020[_0x158559(0x12e)],'body':{'skillName':_0x166020['rendered'][_0x158559(0x139)],'type':_0x166020['rendered']['type'],'selfContained':!![],'files':_0x166020['rendered']['files'][_0x158559(0x138)](_0x34cc48=>_0x34cc48[_0x158559(0x137)])},'description':'Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.'};},async 'execute'(_0x38f664){const _0x3922ec=a43_0xae52a7,_0x4c311f=buildSkillCreatePlan(_0x38f664['str'](_0x3922ec(0x11e)),_0x38f664[_0x3922ec(0x12c)]('type'),_0x38f664[_0x3922ec(0x12c)](_0x3922ec(0x11a)));return writeSkillDraft(_0x4c311f,_0x38f664[_0x3922ec(0x129)](_0x3922ec(0x119))),{'ok':!![],'data':{'skillName':_0x4c311f[_0x3922ec(0x133)]['skillName'],'type':_0x4c311f[_0x3922ec(0x133)][_0x3922ec(0x12a)],'dir':_0x4c311f[_0x3922ec(0x12e)],'files':_0x4c311f[_0x3922ec(0x133)][_0x3922ec(0x120)][_0x3922ec(0x138)](_0x5d730a=>_0x5d730a[_0x3922ec(0x137)])},'message':_0x3922ec(0x127)+_0x4c311f[_0x3922ec(0x133)]['skillName']};}};function buildSkillCreatePlan(_0x3d6d40,_0x4b81b5,_0x19a321){const _0x124371=a43_0xae52a7,_0x55aebf=_0x4b81b5[_0x124371(0x124)](),_0x9b4cbc=renderSkillTemplate({'skillName':_0x3d6d40,'type':_0x55aebf});!_0x55aebf&&writeCliSideChannelLine(_0x124371(0x131));const _0x53283a=resolve(normalizeSkillTarget(_0x19a321));return{'rendered':_0x9b4cbc,'targetRoot':_0x53283a,'skillDir':resolve(_0x53283a,_0x9b4cbc[_0x124371(0x139)])};}function normalizeSkillTarget(_0xb82a2b){const _0x60836b=a43_0xae52a7;return(_0xb82a2b||DEFAULT_SKILL_TARGET)[_0x60836b(0x124)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x39b1c4,_0x616225){const _0x4ff27d=a43_0xae52a7;if(existsSync(_0x39b1c4[_0x4ff27d(0x12e)])){const _0x5059aa=lstatSync(_0x39b1c4[_0x4ff27d(0x12e)]);if(!_0x5059aa[_0x4ff27d(0x11f)]()||_0x5059aa[_0x4ff27d(0x11d)]())throw CliErrors['validation'](_0x4ff27d(0x121)+_0x39b1c4[_0x4ff27d(0x12e)]);if(!_0x616225)throw CliErrors[_0x4ff27d(0x13a)](_0x4ff27d(0x135)+_0x39b1c4['skillDir'],_0x4ff27d(0x12b));}for(const _0x348c47 of _0x39b1c4['rendered'][_0x4ff27d(0x120)]){const _0x3a6bb1=resolve(_0x39b1c4[_0x4ff27d(0x12e)],_0x348c47['path']),_0xe04eef=dirname(_0x3a6bb1);mkdirSync(_0xe04eef,{'recursive':!![]});if(existsSync(_0x3a6bb1)&&lstatSync(_0x3a6bb1)[_0x4ff27d(0x11d)]())throw CliErrors[_0x4ff27d(0x13a)](_0x4ff27d(0x134)+_0x3a6bb1);writeFileSync(_0x3a6bb1,_0x348c47[_0x4ff27d(0x12d)],_0x4ff27d(0x118));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x5b20c0=a44_0x3345;(function(_0x14cd8a,_0x16a9b5){const _0x1e722e=a44_0x3345,_0x2390dd=_0x14cd8a();while(!![]){try{const _0x2320a5=parseInt(_0x1e722e(0x92))/0x1*(-parseInt(_0x1e722e(0x95))/0x2)+parseInt(_0x1e722e(0xa1))/0x3+parseInt(_0x1e722e(0x9b))/0x4+parseInt(_0x1e722e(0xa7))/0x5+parseInt(_0x1e722e(0x9c))/0x6*(parseInt(_0x1e722e(0xab))/0x7)+parseInt(_0x1e722e(0xb0))/0x8+-parseInt(_0x1e722e(0x9d))/0x9;if(_0x2320a5===_0x16a9b5)break;else _0x2390dd['push'](_0x2390dd['shift']());}catch(_0x307c6c){_0x2390dd['push'](_0x2390dd['shift']());}}}(a44_0x3c4e,0xd32d9));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';function a44_0x3c4e(){const _0x9e8eba=['expected-diagram-revision','version','source-fingerprint',';\x20first\x20write\x20expects\x20revision\x20','6580564VoxeHo','267978JGcjKJ','46507635vtdknD','diagram-show','action','\x20Skill\x20diagram\x20for\x20','3653754NQxyyY','scope','Skill\x20diagram\x20for\x20','Updated','read','expectedDiagramRevision','8442620lsURlx','diagram-file','trim','Created','231wBRYXY','\x20is\x20unchanged.','appCode','Found\x20Skill\x20diagram\x20for\x20','skill','12018504aOCdEO','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','test','skillCode','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','skill-code','diagram-validate','created','str','299055uQXqqH',';\x20next\x20write\x20expects\x20revision\x20','unchanged','10nxfRgW','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version'];a44_0x3c4e=function(){return _0x9e8eba;};return a44_0x3c4e();}import{readRequiredSkillDiagram}from'../diagram.js';function a44_0x3345(_0x4ed878,_0x3c0db3){_0x4ed878=_0x4ed878-0x8f;const _0x3c4e11=a44_0x3c4e();let _0x334598=_0x3c4e11[_0x4ed878];return _0x334598;}import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x1a4e22){const _0x2e143d=a44_0x3345,_0x496c20=_0x1a4e22[_0x2e143d(0x91)](_0x2e143d(0xb7))[_0x2e143d(0xa9)](),_0x54cb87=_0x1a4e22[_0x2e143d(0x91)](_0x2e143d(0x98))['trim'](),_0x116472=_0x1a4e22[_0x2e143d(0x91)](_0x2e143d(0xa2));if(!_0x496c20||!_0x54cb87||_0x116472!=='personal'&&_0x116472!=='company')throw CliErrors['validation']('--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.');return{'skillCode':_0x496c20,'version':_0x54cb87,'scope':_0x116472};}async function readDiagramWriteInput(_0x1feeec){const _0x3fd247=a44_0x3345,_0x59b6c9=_0x1feeec['num'](_0x3fd247(0x97)),_0x536642=_0x1feeec[_0x3fd247(0x91)](_0x3fd247(0x99))['trim']();if(!Number['isInteger'](_0x59b6c9)||_0x59b6c9<0x0)throw CliErrors['validation'](_0x3fd247(0xb2));if(!/^sha256:[0-9a-f]{64}$/[_0x3fd247(0xb3)](_0x536642))throw CliErrors['validation'](_0x3fd247(0xb6));return{'expectedDiagramRevision':_0x59b6c9,'sourceFingerprint':_0x536642,'diagram':await readRequiredSkillDiagram(_0x1feeec['str'](_0x3fd247(0xa8)))};}export const diagramValidateCommand={'service':a44_0x5b20c0(0xaf),'command':a44_0x5b20c0(0x8f),'description':a44_0x5b20c0(0x96),'risk':a44_0x5b20c0(0xa5),'flags':WRITE_FLAGS,async 'execute'(_0x39c6be){const _0x5e40fa=a44_0x5b20c0,_0x7de0ca=readDiagramTarget(_0x39c6be),_0x38041e=await validateRuntimeSkillVersionDiagram(_0x39c6be[_0x5e40fa(0xad)],_0x7de0ca[_0x5e40fa(0xb4)],_0x7de0ca[_0x5e40fa(0x98)],_0x7de0ca[_0x5e40fa(0xa2)],await readDiagramWriteInput(_0x39c6be));return{'ok':!![],'data':_0x38041e,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0x7de0ca['skillCode']+'@'+_0x7de0ca['version']+'.'};}};export const diagramPushCommand={'service':a44_0x5b20c0(0xaf),'command':'diagram-push','description':'Create\x20or\x20replace\x20the\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':'write','flags':WRITE_FLAGS,async 'execute'(_0x34a267){const _0x48369a=a44_0x5b20c0,_0x1fb2fa=readDiagramTarget(_0x34a267),_0x4d170f=await putRuntimeSkillVersionDiagram(_0x34a267['appCode'],_0x1fb2fa[_0x48369a(0xb4)],_0x1fb2fa[_0x48369a(0x98)],_0x1fb2fa[_0x48369a(0xa2)],await readDiagramWriteInput(_0x34a267));return{'ok':!![],'data':_0x4d170f,'message':_0x4d170f[_0x48369a(0x9f)]===_0x48369a(0x94)?_0x48369a(0xa3)+_0x1fb2fa[_0x48369a(0xb4)]+'@'+_0x1fb2fa[_0x48369a(0x98)]+_0x48369a(0xac):(_0x4d170f['action']===_0x48369a(0x90)?_0x48369a(0xaa):_0x48369a(0xa4))+_0x48369a(0xa0)+_0x1fb2fa[_0x48369a(0xb4)]+'@'+_0x1fb2fa[_0x48369a(0x98)]+'.'};}};export const diagramShowCommand={'service':a44_0x5b20c0(0xaf),'command':a44_0x5b20c0(0x9e),'description':a44_0x5b20c0(0xb1),'risk':'read','flags':TARGET_FLAGS,async 'execute'(_0x195489){const _0x486fa4=a44_0x5b20c0,_0x16d1e0=readDiagramTarget(_0x195489),_0x107621=await getRuntimeSkillVersionDiagram(_0x195489[_0x486fa4(0xad)],_0x16d1e0['skillCode'],_0x16d1e0[_0x486fa4(0x98)],_0x16d1e0['scope']);return{'ok':!![],'data':_0x107621,'message':_0x107621['found']?_0x486fa4(0xae)+_0x16d1e0[_0x486fa4(0xb4)]+'@'+_0x16d1e0[_0x486fa4(0x98)]+_0x486fa4(0x93)+_0x107621['expectedDiagramRevision']+'.':_0x486fa4(0xb5)+_0x16d1e0[_0x486fa4(0xb4)]+'@'+_0x16d1e0[_0x486fa4(0x98)]+_0x486fa4(0x9a)+_0x107621[_0x486fa4(0xa6)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x30d846=a45_0x72f8;(function(_0x46a634,_0x35d46e){const _0x3e9d91=a45_0x72f8,_0x5e7a92=_0x46a634();while(!![]){try{const _0x48b144=-parseInt(_0x3e9d91(0x19e))/0x1+-parseInt(_0x3e9d91(0x1b5))/0x2*(parseInt(_0x3e9d91(0x1ae))/0x3)+-parseInt(_0x3e9d91(0x1a7))/0x4*(-parseInt(_0x3e9d91(0x1bd))/0x5)+-parseInt(_0x3e9d91(0x1ad))/0x6*(-parseInt(_0x3e9d91(0x1ab))/0x7)+-parseInt(_0x3e9d91(0x1bc))/0x8+-parseInt(_0x3e9d91(0x199))/0x9+-parseInt(_0x3e9d91(0x1a6))/0xa*(-parseInt(_0x3e9d91(0x1a2))/0xb);if(_0x48b144===_0x35d46e)break;else _0x5e7a92['push'](_0x5e7a92['shift']());}catch(_0xe66116){_0x5e7a92['push'](_0x5e7a92['shift']());}}}(a45_0x5e51,0xc8bbe));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';function a45_0x5e51(){const _0x2dc9ef=['global','1408lIkDuJ','appCode','created','bool','125540zjmIRs','1416myQpQY','reduce','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','trim','388521dQwGIz','personal','6MHXfKo','183pmmTxj','project','skipped','str','production','read','includes','11282PtBjSA','\x20company\x20Skill(s).','updated','../../../core/api-client.js','length','action','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','3779448wIWrUs','8050HgehPo','skillRoots','\x20personal\x20and\x20','envName','skill','unchanged','code','accessKey','scope','all','version','company','authRequired','skillCode','3476367gPLMev','filter','flatMap','Installed\x20','../../../skills/runtime-skill-sync.js','207354iaKRNY','map','install'];a45_0x5e51=function(){return _0x2dc9ef;};return a45_0x5e51();}import{normalizeSyncScopes}from'../scopes.js';function a45_0x72f8(_0x553943,_0x46208b){_0x553943=_0x553943-0x197;const _0x5e51d0=a45_0x5e51();let _0x72f89d=_0x5e51d0[_0x553943];return _0x72f89d;}import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a45_0x30d846(0x1c1),'command':a45_0x30d846(0x1a0),'description':a45_0x30d846(0x1a9),'risk':a45_0x30d846(0x1b3),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x245a46){return syncRuntimeSkills(_0x245a46);}};async function syncRuntimeSkills(_0x150e42){const _0x1ba9a3=a45_0x30d846,{downloadRuntimeSkillPackage:_0x451c31,listRuntimeSkills:_0x26a47a}=await import(_0x1ba9a3(0x1b8)),{linkEffectiveRuntimeSkills:_0x1552a0,materializeRuntimeSkill:_0x21d353,pruneStaleRuntimeSkillCache:_0x3cd479,pruneStaleRuntimeSkillLinks:_0x347ed3,resolveRuntimeSkillInstallTarget:_0x5c00ce}=await import(_0x1ba9a3(0x19d)),_0x2bfa77=_0x150e42[_0x1ba9a3(0x1b1)](_0x1ba9a3(0x1c3)),_0x30cbd3=normalizeSyncScopes(_0x150e42[_0x1ba9a3(0x1b1)](_0x1ba9a3(0x1c5))),_0x29c97a=_0x150e42[_0x1ba9a3(0x1c0)]??_0x1ba9a3(0x1b2),_0x25050e=_0x150e42[_0x1ba9a3(0x1c4)],_0x5542bf=_0x150e42[_0x1ba9a3(0x1a5)]('force');if(!_0x25050e)throw CliErrors[_0x1ba9a3(0x197)](_0x1ba9a3(0x1bb));const _0x38aeb2=_0x5c00ce(_0x150e42['appCode'],_0x150e42['bool'](_0x1ba9a3(0x1af))?'project':_0x1ba9a3(0x1a1)),_0x1554de=_0x5c00ce(_0x150e42['appCode'],_0x38aeb2[_0x1ba9a3(0x1c5)]==='project'?_0x1ba9a3(0x1a1):'project'),_0x320280=await Promise[_0x1ba9a3(0x1c6)](_0x30cbd3[_0x1ba9a3(0x19f)](_0x566f43=>_0x26a47a({'appCode':_0x150e42[_0x1ba9a3(0x1a3)],'scope':_0x566f43,'code':_0x2bfa77['trim']()||undefined}))),_0x2b92b3=_0x30cbd3[_0x1ba9a3(0x1b4)](_0x1ba9a3(0x1ac))?_0x320280[_0x1ba9a3(0x19b)]((_0x774abf,_0xac022c)=>_0x30cbd3[_0xac022c]===_0x1ba9a3(0x1ac)?_0x774abf['personal']:[]):[],_0x41c1d4=_0x30cbd3[_0x1ba9a3(0x1b4)](_0x1ba9a3(0x1c8))?_0x320280[_0x1ba9a3(0x19b)]((_0x1875c2,_0x525461)=>_0x30cbd3[_0x525461]===_0x1ba9a3(0x1c8)?_0x1875c2[_0x1ba9a3(0x1c8)]:[]):[],_0x437522=new Set([..._0x2b92b3[_0x1ba9a3(0x19f)](_0x222da6=>_0x222da6[_0x1ba9a3(0x198)]?.[_0x1ba9a3(0x1aa)]())['filter'](_0xe37153=>Boolean(_0xe37153)),..._0x41c1d4['map'](_0x2ed2f9=>_0x2ed2f9[_0x1ba9a3(0x198)]?.[_0x1ba9a3(0x1aa)]())[_0x1ba9a3(0x19a)](_0x2eaf59=>Boolean(_0x2eaf59))]),_0x200903=_0x2bfa77[_0x1ba9a3(0x1aa)]()?[_0x2bfa77[_0x1ba9a3(0x1aa)]()]:undefined,_0x39d0cc=_0x30cbd3[_0x1ba9a3(0x1b9)]===0x2&&_0x30cbd3[_0x1ba9a3(0x1b4)](_0x1ba9a3(0x1ac))&&_0x30cbd3[_0x1ba9a3(0x1b4)]('company'),_0x572199=_0x39d0cc?_0x347ed3(_0x38aeb2,_0x437522,_0x200903):[],_0x13cdaf=_0x3cd479({'env':_0x29c97a,'accessKey':_0x25050e,'appCode':_0x150e42[_0x1ba9a3(0x1a3)],'activeSkillCodes':_0x437522,'pruneSkillCodes':_0x200903,'scopes':_0x30cbd3,'protectedLinkRoots':_0x1554de[_0x1ba9a3(0x1be)]}),_0x249f86=[];for(const _0x1a83f4 of _0x2b92b3){_0x249f86['push'](_0x21d353(_0x1a83f4,_0x1ba9a3(0x1ac),{'env':_0x29c97a,'accessKey':_0x25050e,'appCode':_0x150e42['appCode'],'force':_0x5542bf,'packageBytes':await downloadSkillPackage(_0x1a83f4,_0x1ba9a3(0x1ac),_0x150e42[_0x1ba9a3(0x1a3)],_0x451c31)}));}for(const _0x19e2cd of _0x41c1d4){_0x249f86['push'](_0x21d353(_0x19e2cd,_0x1ba9a3(0x1c8),{'env':_0x29c97a,'accessKey':_0x25050e,'appCode':_0x150e42[_0x1ba9a3(0x1a3)],'force':_0x5542bf,'packageBytes':await downloadSkillPackage(_0x19e2cd,'company',_0x150e42[_0x1ba9a3(0x1a3)],_0x451c31)}));}const _0x59a8e1=_0x1552a0(_0x249f86,_0x38aeb2),_0x221c73=countLinkActions(_0x59a8e1);return{'ok':!![],'data':{'appCode':_0x150e42[_0x1ba9a3(0x1a3)],..._0x38aeb2[_0x1ba9a3(0x1c5)]===_0x1ba9a3(0x1af)?{'installTarget':{'scope':_0x38aeb2[_0x1ba9a3(0x1c5)],'skillRoots':[..._0x38aeb2[_0x1ba9a3(0x1be)]]}}:{},'personal':_0x2b92b3[_0x1ba9a3(0x1b9)],'company':_0x41c1d4[_0x1ba9a3(0x1b9)],'materialized':_0x249f86['length'],'links':{'total':_0x59a8e1[_0x1ba9a3(0x1b9)],'created':_0x221c73[_0x1ba9a3(0x1a4)]??0x0,'updated':_0x221c73[_0x1ba9a3(0x1b7)]??0x0,'unchanged':_0x221c73[_0x1ba9a3(0x1c2)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x572199[_0x1ba9a3(0x19a)](_0x337ca7=>_0x337ca7[_0x1ba9a3(0x1ba)]==='removed')[_0x1ba9a3(0x1b9)],'cacheDirs':_0x13cdaf[_0x1ba9a3(0x19a)](_0x4ea96c=>_0x4ea96c[_0x1ba9a3(0x1ba)]==='removed')[_0x1ba9a3(0x1b9)],'skipped':[..._0x572199,..._0x13cdaf][_0x1ba9a3(0x19a)](_0x347451=>_0x347451['action']===_0x1ba9a3(0x1b0))['length']},'skills':{'personal':_0x2b92b3[_0x1ba9a3(0x19f)](summarizeRuntimeSkill),'company':_0x41c1d4[_0x1ba9a3(0x19f)](summarizeRuntimeSkill)}},'message':_0x1ba9a3(0x19c)+_0x2b92b3[_0x1ba9a3(0x1b9)]+_0x1ba9a3(0x1bf)+_0x41c1d4[_0x1ba9a3(0x1b9)]+_0x1ba9a3(0x1b6)};}async function downloadSkillPackage(_0x3839fe,_0x116a08,_0x57cd81,_0xaa7a75){const _0x5738ac=a45_0x30d846,_0x230f2e=_0x3839fe[_0x5738ac(0x1c7)]?.[_0x5738ac(0x1aa)]();return _0x230f2e?_0xaa7a75(_0x116a08,_0x3839fe[_0x5738ac(0x198)],_0x57cd81,_0x230f2e):_0xaa7a75(_0x116a08,_0x3839fe['skillCode'],_0x57cd81);}function countLinkActions(_0x4715ed){const _0xaba6b9=a45_0x30d846;return _0x4715ed[_0xaba6b9(0x1a8)]((_0x6caaeb,_0x10fe16)=>{const _0x27193a=_0xaba6b9;return _0x6caaeb[_0x10fe16[_0x27193a(0x1ba)]]=(_0x6caaeb[_0x10fe16[_0x27193a(0x1ba)]]??0x0)+0x1,_0x6caaeb;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a46_0x2f94(){const _0x55a145=['project','appCode','map','trim','production','19645bdaNpu','length','envName','Listed\x20','1108neWZOO','global','code','read','str','builtin','../../../core/api-client.js','2185694zVnePw','remote','personal','company','scope','3983226MrVcOW','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','2800120lJrpmz','\x20local\x20Skill(s).','list','97750vAWIoP','filter','accessKey','3490938VsCOUs','../../../skills/runtime-skill-sync.js','717094kEHnKN','bool'];a46_0x2f94=function(){return _0x55a145;};return a46_0x2f94();}const a46_0x2adb7a=a46_0x17f6;(function(_0x3cc045,_0x1655cd){const _0x2dc76d=a46_0x17f6,_0x2a259c=_0x3cc045();while(!![]){try{const _0x2f3f4b=parseInt(_0x2dc76d(0x1c5))/0x1+-parseInt(_0x2dc76d(0x1c0))/0x2+-parseInt(_0x2dc76d(0x1c3))/0x3+parseInt(_0x2dc76d(0x1af))/0x4*(parseInt(_0x2dc76d(0x1ab))/0x5)+parseInt(_0x2dc76d(0x1bb))/0x6+-parseInt(_0x2dc76d(0x1b6))/0x7+-parseInt(_0x2dc76d(0x1bd))/0x8;if(_0x2f3f4b===_0x1655cd)break;else _0x2a259c['push'](_0x2a259c['shift']());}catch(_0xc1b83c){_0x2a259c['push'](_0x2a259c['shift']());}}}(a46_0x2f94,0x91258));import{CliErrors}from'../../../errors.js';function a46_0x17f6(_0x353fc9,_0x126cd2){_0x353fc9=_0x353fc9-0x1a7;const _0x2f9437=a46_0x2f94();let _0x17f6f9=_0x2f9437[_0x353fc9];return _0x17f6f9;}import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':'skill','command':a46_0x2adb7a(0x1bf),'description':a46_0x2adb7a(0x1bc),'risk':a46_0x2adb7a(0x1b2),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x1a1c4f){const _0x90c8c3=a46_0x2adb7a,_0x5db0c2=_0x1a1c4f[_0x90c8c3(0x1b3)](_0x90c8c3(0x1b1)),_0x11b064=normalizeListScope(_0x1a1c4f[_0x90c8c3(0x1b3)](_0x90c8c3(0x1ba)));if(_0x1a1c4f[_0x90c8c3(0x1c6)]('local')){const _0x3d1359=_0x1a1c4f[_0x90c8c3(0x1c2)];if(!_0x3d1359)throw CliErrors['authRequired']();const {listLocalRuntimeSkills:_0x2c197a,resolveRuntimeSkillInstallTarget:_0x19f947}=await import(_0x90c8c3(0x1c4)),_0x38226a=_0x19f947(_0x1a1c4f['appCode'],_0x1a1c4f[_0x90c8c3(0x1c6)](_0x90c8c3(0x1c7))?'project':_0x90c8c3(0x1b0)),_0x229117=_0x2c197a({'env':_0x1a1c4f[_0x90c8c3(0x1ad)]??_0x90c8c3(0x1aa),'accessKey':_0x3d1359,'appCode':_0x1a1c4f[_0x90c8c3(0x1a7)],'scopes':listScopeToRuntimeScopes(_0x11b064),'code':_0x5db0c2[_0x90c8c3(0x1a9)]()||undefined},_0x38226a),_0x1aed23=groupLocalRuntimeSkills(_0x229117);return{'ok':!![],'data':{'appCode':_0x1a1c4f[_0x90c8c3(0x1a7)],'source':'local',..._0x38226a[_0x90c8c3(0x1ba)]===_0x90c8c3(0x1c7)?{'installScope':_0x38226a[_0x90c8c3(0x1ba)]}:{},'scope':_0x11b064,'total':_0x229117['length'],'personal':_0x1aed23['personal']['length'],'company':_0x1aed23[_0x90c8c3(0x1b9)][_0x90c8c3(0x1ac)],'items':_0x229117[_0x90c8c3(0x1a8)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x1aed23[_0x90c8c3(0x1b8)][_0x90c8c3(0x1a8)](summarizeLocalRuntimeSkill),'company':_0x1aed23[_0x90c8c3(0x1b9)][_0x90c8c3(0x1a8)](summarizeLocalRuntimeSkill)}},'message':_0x90c8c3(0x1ae)+_0x229117[_0x90c8c3(0x1ac)]+_0x90c8c3(0x1be)};}const {listRuntimeSkills:_0x22d889}=await import(_0x90c8c3(0x1b5)),_0x3081dd=await _0x22d889({'appCode':_0x1a1c4f[_0x90c8c3(0x1a7)],'scope':listScopeToRemoteScope(_0x11b064),'code':_0x5db0c2[_0x90c8c3(0x1a9)]()||undefined}),_0x973706=shouldListScope(_0x11b064,_0x90c8c3(0x1b8))?_0x3081dd[_0x90c8c3(0x1b8)]??[]:[],_0x4c93e5=shouldListScope(_0x11b064,_0x90c8c3(0x1b9))?_0x3081dd[_0x90c8c3(0x1b9)]??[]:[],_0x246ddb=[..._0x973706,..._0x4c93e5];return{'ok':!![],'data':{'appCode':_0x1a1c4f[_0x90c8c3(0x1a7)],'source':_0x90c8c3(0x1b7),'scope':_0x11b064,'total':_0x246ddb[_0x90c8c3(0x1ac)],'personal':_0x973706[_0x90c8c3(0x1ac)],'company':_0x4c93e5[_0x90c8c3(0x1ac)],'items':_0x246ddb['map'](summarizeRuntimeSkill),'skills':{'personal':_0x973706[_0x90c8c3(0x1a8)](summarizeRuntimeSkill),'company':_0x4c93e5['map'](summarizeRuntimeSkill)}},'message':_0x90c8c3(0x1ae)+_0x246ddb[_0x90c8c3(0x1ac)]+'\x20remote\x20Skill(s).'};}};function groupLocalRuntimeSkills(_0x3e9afb){const _0x2e5086=a46_0x2adb7a;return{'personal':_0x3e9afb[_0x2e5086(0x1c1)](_0x1cd0d3=>_0x1cd0d3[_0x2e5086(0x1ba)]===_0x2e5086(0x1b8)),'company':_0x3e9afb[_0x2e5086(0x1c1)](_0x3e3caa=>_0x3e3caa['scope']===_0x2e5086(0x1b9)),'builtin':_0x3e9afb[_0x2e5086(0x1c1)](_0x56aa76=>_0x56aa76[_0x2e5086(0x1ba)]===_0x2e5086(0x1b4))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0xad67(){const _0x3af32e=['433132IkIYSH','3136OtfHxr','306237NNZMcr','12cAPInX','skill','2481973uYlyrX','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20scope\x20or\x20submit\x20company\x20scope\x20for\x20review','642YhjlGI','560358jwuXEH','push','4654397PRzVYO','write','2kfbyjW','72unmjSl','3245KgADyg','10vjZIyj','1152MjSemX'];a47_0xad67=function(){return _0x3af32e;};return a47_0xad67();}const a47_0x1c84e1=a47_0x57bd;function a47_0x57bd(_0x6665d9,_0x3f1bac){_0x6665d9=_0x6665d9-0x107;const _0xad67ff=a47_0xad67();let _0x57bdbe=_0xad67ff[_0x6665d9];return _0x57bdbe;}(function(_0x481758,_0x42aa66){const _0x3099a9=a47_0x57bd,_0x690fd=_0x481758();while(!![]){try{const _0x5e7784=parseInt(_0x3099a9(0x108))/0x1*(parseInt(_0x3099a9(0x112))/0x2)+parseInt(_0x3099a9(0x116))/0x3*(parseInt(_0x3099a9(0x107))/0x4)+-parseInt(_0x3099a9(0x114))/0x5*(-parseInt(_0x3099a9(0x10d))/0x6)+-parseInt(_0x3099a9(0x117))/0x7+parseInt(_0x3099a9(0x113))/0x8*(-parseInt(_0x3099a9(0x10e))/0x9)+parseInt(_0x3099a9(0x115))/0xa*(parseInt(_0x3099a9(0x110))/0xb)+-parseInt(_0x3099a9(0x109))/0xc*(parseInt(_0x3099a9(0x10b))/0xd);if(_0x5e7784===_0x42aa66)break;else _0x690fd['push'](_0x690fd['shift']());}catch(_0x1452fa){_0x690fd['push'](_0x690fd['shift']());}}}(a47_0xad67,0x45ff4));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';export const pushCommand={'service':a47_0x1c84e1(0x10a),'command':a47_0x1c84e1(0x10f),'description':a47_0x1c84e1(0x10c),'risk':a47_0x1c84e1(0x111),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x31baa6=a48_0x33c7;(function(_0x4c7d9b,_0x423cd8){const _0x3afc5a=a48_0x33c7,_0x216b29=_0x4c7d9b();while(!![]){try{const _0x27b7e5=-parseInt(_0x3afc5a(0xd2))/0x1+parseInt(_0x3afc5a(0xce))/0x2*(-parseInt(_0x3afc5a(0xc5))/0x3)+parseInt(_0x3afc5a(0xc6))/0x4*(parseInt(_0x3afc5a(0xc9))/0x5)+parseInt(_0x3afc5a(0xc8))/0x6+parseInt(_0x3afc5a(0xcb))/0x7+parseInt(_0x3afc5a(0xd6))/0x8*(parseInt(_0x3afc5a(0xd0))/0x9)+-parseInt(_0x3afc5a(0xd7))/0xa*(parseInt(_0x3afc5a(0xcf))/0xb);if(_0x27b7e5===_0x423cd8)break;else _0x216b29['push'](_0x216b29['shift']());}catch(_0x365652){_0x216b29['push'](_0x216b29['shift']());}}}(a48_0x5173,0xc0f6d));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a48_0x33c7(_0x10c3ea,_0x53d542){_0x10c3ea=_0x10c3ea-0xc5;const _0x517368=a48_0x5173();let _0x33c793=_0x517368[_0x10c3ea];return _0x33c793;}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';function a48_0x5173(){const _0x331bd3=['Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','7100934HyQnnx','146045XLApds','strict','4993758XSPUVk','Skill\x20validation\x20passed.','errors','18214HyqfFs','4301341CLPUPk','607491BBvQMj','bool','302496KgHEZJ','warnings','dir','validate','24VoZwwG','30KuyvYe','skill','330pVeura','160pCnSKo'];a48_0x5173=function(){return _0x331bd3;};return a48_0x5173();}export const validateCommand={'service':a48_0x31baa6(0xd8),'command':a48_0x31baa6(0xd5),'description':a48_0x31baa6(0xc7),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x1e21b1){const _0x17bb4a=a48_0x31baa6,_0x40915b=_0x1e21b1[_0x17bb4a(0xd1)](_0x17bb4a(0xca)),_0x4b04f5=validateSkillDirectory(_0x1e21b1['str'](_0x17bb4a(0xd4)),{'strict':_0x40915b});return throwIfSkillValidationFailed(_0x4b04f5,_0x40915b),{'ok':!![],'data':{'dir':_0x4b04f5[_0x17bb4a(0xd4)],'type':_0x4b04f5['type'],'errors':_0x4b04f5[_0x17bb4a(0xcd)],'warnings':_0x4b04f5[_0x17bb4a(0xd3)]},'message':_0x17bb4a(0xcc)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a49_0x3513(){const _0x2a6a5a=['trim','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','690224lTuDTl','6WyRTyn','validation','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','18kxNmMt','document','4238680FYDORx','451450QnmcyT','isFile','2937TiKSMj','12970jfWUwm','mermaid','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','2342512eylxLq','defineProperties','443531iMgumR','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','replace','939064AWxRWv','utf8','parse','12WzGjCf','window','default','Mermaid\x20flowchart\x20file\x20not\x20found:\x20'];a49_0x3513=function(){return _0x2a6a5a;};return a49_0x3513();}(function(_0x32f8ea,_0x34a09d){const _0x5b4baa=a49_0x5d9d,_0x2ca795=_0x32f8ea();while(!![]){try{const _0xb974cd=parseInt(_0x5b4baa(0x106))/0x1+parseInt(_0x5b4baa(0xfe))/0x2*(-parseInt(_0x5b4baa(0xf8))/0x3)+parseInt(_0x5b4baa(0x112))/0x4+parseInt(_0x5b4baa(0xfd))/0x5+-parseInt(_0x5b4baa(0x10c))/0x6*(parseInt(_0x5b4baa(0x109))/0x7)+-parseInt(_0x5b4baa(0x104))/0x8*(parseInt(_0x5b4baa(0xfb))/0x9)+-parseInt(_0x5b4baa(0x101))/0xa*(-parseInt(_0x5b4baa(0x100))/0xb);if(_0xb974cd===_0x34a09d)break;else _0x2ca795['push'](_0x2ca795['shift']());}catch(_0x36e1e3){_0x2ca795['push'](_0x2ca795['shift']());}}}(a49_0x3513,0x7b3a4));import{existsSync,readFileSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x4a7535){const _0x5816d3=a49_0x5d9d,_0x4cb75c=_0x4a7535[_0x5816d3(0x110)]();if(!_0x4cb75c)throw CliErrors['validation'](_0x5816d3(0x103),_0x5816d3(0xfa));let _0x4dc426;if(_0x4cb75c==='-')try{_0x4dc426=readFileSync(0x0,_0x5816d3(0x10a));}catch{throw CliErrors[_0x5816d3(0xf9)](_0x5816d3(0x111));}else{const _0x2df0ea=resolve(_0x4cb75c);if(!existsSync(_0x2df0ea))throw CliErrors[_0x5816d3(0xf9)](_0x5816d3(0x10f)+_0x2df0ea);if(!statSync(_0x2df0ea)[_0x5816d3(0xff)]())throw CliErrors['validation'](_0x5816d3(0x107)+_0x2df0ea);_0x4dc426=readFileSync(_0x2df0ea,'utf8');}return{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x4dc426)};}export async function validateAndCanonicalizeMermaid(_0x237637){const _0x5ac407=a49_0x5d9d,_0x10e549=_0x237637[_0x5ac407(0x108)](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a')[_0x5ac407(0x108)](/\n+$/,'')+'\x0a';try{const _0x1563b7=await loadMermaidApi();await _0x1563b7[_0x5ac407(0x10b)](_0x10e549);}catch{throw diagramValidationError();}return _0x10e549;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x4dcb43=a49_0x5d9d;if(!(_0x4dcb43(0x10d)in globalThis)||!('document'in globalThis)){const _0x4ca3e7=new JSDOM('');Object[_0x4dcb43(0x105)](globalThis,{'window':{'configurable':!![],'value':_0x4ca3e7[_0x4dcb43(0x10d)]},'document':{'configurable':!![],'value':_0x4ca3e7[_0x4dcb43(0x10d)][_0x4dcb43(0xfc)]}});}return(await import(_0x4dcb43(0x102)))[_0x4dcb43(0x10e)];})()),mermaidApiPromise;}function a49_0x5d9d(_0x31a32b,_0x53e199){_0x31a32b=_0x31a32b-0xf8;const _0x351354=a49_0x3513();let _0x5d9ddb=_0x351354[_0x31a32b];return _0x5d9ddb;}function diagramValidationError(){const _0x20379d=a49_0x5d9d;return CliErrors[_0x20379d(0xf9)]('Mermaid\x20syntax\x20validation\x20failed.','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.');}
|