@lovrabet/lovrabet-cli 2.1.22-beta.1 → 2.1.22-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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.d.ts +4 -0
- package/lib/commands/skill/commands/diagram.js +1 -0
- 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.d.ts +5 -0
- package/lib/commands/skill/diagram.js +1 -0
- package/lib/commands/skill/flags.d.ts +6 -0
- 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.d.ts +4 -0
- 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.d.ts +52 -0
- 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 +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3f605e,_0x46a149){const _0x12b8c3=a39_0x746a,_0x59790e=_0x3f605e();while(!![]){try{const _0x5c563e=-parseInt(_0x12b8c3(0xb7))/0x1+-parseInt(_0x12b8c3(0xee))/0x2*(-parseInt(_0x12b8c3(0xd6))/0x3)+parseInt(_0x12b8c3(0xdb))/0x4+parseInt(_0x12b8c3(0xc8))/0x5*(-parseInt(_0x12b8c3(0xe7))/0x6)+-parseInt(_0x12b8c3(0xb6))/0x7+-parseInt(_0x12b8c3(0xd3))/0x8+-parseInt(_0x12b8c3(0xa1))/0x9*(-parseInt(_0x12b8c3(0xaa))/0xa);if(_0x5c563e===_0x46a149)break;else _0x59790e['push'](_0x59790e['shift']());}catch(_0x337224){_0x59790e['push'](_0x59790e['shift']());}}}(a39_0x34db,0x62c5d));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_0x34db(){const _0xeff7b0=['1450vBkgjT','name','Run\x20service\x20command\x20','mapTo','Commands:','find','\x20\x20MAP\x20TO','\x22\x20in\x20service\x20command\x20','userId','filter','startsWith','tableName','4313631PnUIxI','7514pKKgqn','fullPath','flags','envName','join','\x20requires\x20target.functionName.','type','app','Service\x20command\x20','appRef','env','\x20\x20\x20\x20kind:\x20\x20\x20\x20','Cannot\x20resolve\x20datatable\x20\x22','SERVICE_TREE','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','target','datasetCode','1895VuJLlB','\x20\x20\x20\x20command:\x20','rawFlags','nickname','json','context.','bff','commands','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20\x20\x20datatable:\x20','map','5014560xLgTtM','risk','nickName','305931mBiHNm','validation','scriptName','enum','appCode','99908SXkRXl','\x20->\x20','appcode','\x20<command>\x20[flags]','username','params','string','code','sqlCode','bffId','required','ctx.','10938agkwEN','service','Preview\x20dynamic\x20service\x20command:\x20','now','remainingArgs','Unsupported\x20service\x20target\x20kind:\x20','\x20\x20\x20\x20sqlCode:\x20','10NZbpRr','boolean','\x20\x20\x20\x20datasetCode:\x20','Unknown\x20appRef\x20\x22','\x20completed\x20in\x20','const','datatable','operator','entries','push','trim','tenantCode','appBindings','description','length','flatMap','normalizedManifest','some','command','source','cliPath','\x20\x20SERVICE\x20TREE\x20TARGET','number','slice','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','kind','\x20\x20\x20\x20','fromEntries','112419EAGAep','\x20\x20[','userName','\x20\x20\x20\x20functionName:\x20','padEnd','default','read','Use\x20`','tree'];a39_0x34db=function(){return _0xeff7b0;};return a39_0x34db();}export function resolveDynamicServiceCommand(_0x1d54a2,_0x3de1a9){const _0x19d233=a39_0x746a,_0x120df4=listLocalServiceTrees();let _0x306c3e;for(const _0x44113c of _0x120df4){const _0x46d127=matchServiceTreeCommand(_0x44113c,_0x1d54a2);if(!_0x46d127)continue;(!_0x306c3e||_0x46d127[_0x19d233(0x97)][_0x19d233(0xb8)][_0x19d233(0x93)]>_0x306c3e[_0x19d233(0x97)][_0x19d233(0xb8)][_0x19d233(0x93)])&&(_0x306c3e={'tree':_0x44113c,'command':_0x46d127[_0x19d233(0x97)],'remainingArgs':_0x46d127[_0x19d233(0xeb)]});}if(!_0x306c3e)return undefined;const _0x34ad42={..._0x3de1a9};return applyAppBinding(_0x306c3e[_0x19d233(0xa9)],_0x306c3e['command'],_0x34ad42),{'definition':buildDynamicCommandDefinition(_0x306c3e['tree'],_0x306c3e[_0x19d233(0x97)]),'args':_0x306c3e[_0x19d233(0xeb)],'flags':_0x34ad42,'tree':_0x306c3e[_0x19d233(0xa9)],'command':_0x306c3e[_0x19d233(0x97)]};}export function generateDynamicServiceHelp(_0x5582e1){const _0x43eeee=a39_0x746a,_0x39783e=listLocalServiceTrees()['find'](_0x1afe2f=>_0x1afe2f[_0x43eeee(0xe8)][_0x43eeee(0xe2)]===_0x5582e1);if(!_0x39783e)return undefined;const _0x4f8c60=[CLI_BIN_NAME+'\x20'+_0x5582e1+_0x43eeee(0xde),'',_0x39783e[_0x43eeee(0xe8)]['name']||_0x5582e1,_0x39783e[_0x43eeee(0xe8)][_0x43eeee(0x92)]?'\x20\x20'+_0x39783e[_0x43eeee(0xe8)][_0x43eeee(0x92)]:'','',_0x43eeee(0xae),..._0x39783e[_0x43eeee(0xcf)][_0x43eeee(0xd2)](_0x549430=>{const _0x505241=_0x43eeee,_0x37f174=_0x549430['fullPath'][_0x505241(0x9c)](0x1)[_0x505241(0xbb)]('\x20'),_0x344b54=_0x549430[_0x505241(0xd4)]===_0x505241(0xa7)?'':'\x20['+_0x549430[_0x505241(0xd4)]+']';return'\x20\x20'+_0x37f174[_0x505241(0xa5)](0x18)+'\x20'+(_0x549430[_0x505241(0x92)]||'')+_0x344b54;}),'',_0x43eeee(0xa8)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x5582e1+'`\x20to\x20inspect\x20the\x20manifest.'][_0x43eeee(0xb3)](Boolean);return _0x4f8c60[_0x43eeee(0xbb)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x192dec=>{const _0x51c67c=a39_0x746a,_0x52d80a=_0x192dec[_0x51c67c(0x95)];return{'service':_0x52d80a['service'][_0x51c67c(0xe2)],'label':_0x52d80a['service'][_0x51c67c(0xab)]||_0x52d80a['service'][_0x51c67c(0xe2)],'commands':_0x52d80a['commands'][_0x51c67c(0xd2)](_0x385a6b=>({'command':dynamicCommandName(_0x385a6b),'description':_0x385a6b[_0x51c67c(0x92)]||_0x51c67c(0xac)+_0x385a6b[_0x51c67c(0x99)],'tag':riskTag(_0x385a6b[_0x51c67c(0xd4)])}))};});}export function getDynamicServiceEntry(_0x1aa3fd){return listDynamicServiceEntries()['find'](_0xb94008=>_0xb94008['service']===_0x1aa3fd);}export function listDynamicServiceDefinitions(_0x1ee463){const _0x5e41d8=a39_0x746a;return listLocalServiceTrees()[_0x5e41d8(0xb3)](_0x5db3b7=>!_0x1ee463||_0x5db3b7[_0x5e41d8(0xe8)][_0x5e41d8(0xe2)]===_0x1ee463)[_0x5e41d8(0x94)](_0x2932c5=>_0x2932c5[_0x5e41d8(0xcf)]['map'](_0x41c875=>buildDynamicCommandDefinition(_0x2932c5,_0x41c875)));}export function getDynamicServiceDefinitions(_0x544229){const _0x319020=a39_0x746a,_0x2a4aa7=listDynamicServiceDefinitions(_0x544229);return _0x2a4aa7[_0x319020(0x93)]>0x0?_0x2a4aa7:undefined;}export function findDynamicServiceDefinition(_0x1220b7,_0x37ff1d){const _0x53729c=a39_0x746a;return listDynamicServiceDefinitions(_0x1220b7)[_0x53729c(0xaf)](_0x460855=>_0x460855['command']===_0x37ff1d);}export function buildDynamicCommandDefinition(_0x3e0910,_0x3dc767){const _0x238175=a39_0x746a;return{'service':_0x3e0910[_0x238175(0xe8)][_0x238175(0xe2)],'command':dynamicCommandName(_0x3dc767),'description':_0x3dc767[_0x238175(0x92)]||_0x238175(0xac)+_0x3dc767[_0x238175(0x99)],'risk':_0x3dc767[_0x238175(0xd4)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3dc767['args'][_0x238175(0xd2)](_0x5a3eea=>({'name':_0x5a3eea['name'],'description':_0x5a3eea[_0x238175(0x92)]||_0x5a3eea[_0x238175(0xab)],'required':_0x5a3eea[_0x238175(0xe5)]})),'flags':_0x3dc767[_0x238175(0xb9)][_0x238175(0xd2)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3dc767),async 'dryRun'(_0x34f0ae){const _0xae7aed=_0x238175,_0x1d45f4=await compilePlan(_0x3dc767,_0x34f0ae);return{'method':_0xae7aed(0xc4),'url':_0x3dc767[_0xae7aed(0x99)],'body':{'target':targetPreview(_0x1d45f4),'params':_0x1d45f4['params']},'description':_0xae7aed(0xe9)+_0x3dc767[_0xae7aed(0x99)]};},async 'execute'(_0x50b137){const _0x3adeea=_0x238175,_0x4d81d8=await compilePlan(_0x3dc767,_0x50b137),_0x56d0df=Date[_0x3adeea(0xea)](),_0x5a1e12=await executePlan(_0x4d81d8,_0x3dc767,_0x50b137),_0x3f0597=Date[_0x3adeea(0xea)]()-_0x56d0df;return{'ok':!![],'data':{'service':_0x3e0910[_0x3adeea(0xe8)],'command':_0x3dc767[_0x3adeea(0x99)],'target':targetPreview(_0x4d81d8),'result':_0x5a1e12,'elapsed':_0x3f0597},'message':_0x3adeea(0xbf)+_0x3dc767[_0x3adeea(0x99)]+_0x3adeea(0xf2)+_0x3f0597+'ms'};}};}function dynamicCommandName(_0x1b70ca){const _0x351021=a39_0x746a;return _0x1b70ca[_0x351021(0xb8)][_0x351021(0x9c)](0x1)[_0x351021(0xbb)]('\x20');}function riskTag(_0x381b80){const _0x459855=a39_0x746a;return _0x381b80==='read'?'':_0x459855(0xa2)+_0x381b80+']';}function a39_0x746a(_0x45e70e,_0x22b0d0){_0x45e70e=_0x45e70e-0x8a;const _0x34dbbd=a39_0x34db();let _0x746ade=_0x34dbbd[_0x45e70e];return _0x746ade;}function flagToCommandFlag(_0x3a8e31){const _0x3873c1=a39_0x746a;return{'name':_0x3a8e31['cliName'],'type':_0x3a8e31[_0x3873c1(0xbd)]===_0x3873c1(0xcc)?_0x3873c1(0xe1):_0x3a8e31[_0x3873c1(0xbd)],'description':_0x3a8e31[_0x3873c1(0x92)]||_0x3a8e31[_0x3873c1(0xab)],'required':_0x3a8e31[_0x3873c1(0xe5)],'default':isPrimitiveFlagDefault(_0x3a8e31[_0x3873c1(0xa6)])?_0x3a8e31[_0x3873c1(0xa6)]:undefined,'enum':_0x3a8e31[_0x3873c1(0xd9)]};}async function compilePlan(_0x41ffbc,_0x1636ab){const _0x330a0a=a39_0x746a;return compileServiceTreeCommand(_0x41ffbc,{'flags':_0x1636ab[_0x330a0a(0xca)],'args':_0x1636ab['args'],'context':await buildServiceContext(_0x41ffbc,_0x1636ab)});}async function buildServiceContext(_0x2637ac,_0x35c144){const _0x114c7f=a39_0x746a,_0xcc09ee={'appCode':_0x35c144[_0x114c7f(0xda)],'env':_0x35c144[_0x114c7f(0xba)],'envName':_0x35c144['envName']};if(!usesRuntimeContext(_0x2637ac))return _0xcc09ee;const _0x5ad32f=await getLoginUserInfo(),_0x4db487=pickFirst(_0x5ad32f[_0x114c7f(0xb2)],_0x5ad32f['id']);return{..._0xcc09ee,'user':_0x5ad32f,'userId':_0x4db487,'id':_0x5ad32f['id'],'username':pickFirst(_0x5ad32f[_0x114c7f(0xdf)],_0x5ad32f['userName'],_0x5ad32f['loginName']),'userName':_0x5ad32f[_0x114c7f(0xa3)],'nickname':pickFirst(_0x5ad32f[_0x114c7f(0xcb)],_0x5ad32f[_0x114c7f(0xd5)]),'nickName':_0x5ad32f[_0x114c7f(0xd5)],'tenantCode':_0x5ad32f[_0x114c7f(0x90)],'employeeId':_0x5ad32f['employeeId']};}function usesRuntimeContext(_0x56b011){const _0x4c2446=a39_0x746a;return _0x56b011[_0x4c2446(0xad)][_0x4c2446(0x96)](_0x378fca=>typeof _0x378fca[_0x4c2446(0x98)]==='string'&&(_0x378fca[_0x4c2446(0x98)][_0x4c2446(0xb4)](_0x4c2446(0xcd))||_0x378fca[_0x4c2446(0x98)]['startsWith'](_0x4c2446(0xe6))));}function pickFirst(..._0x28f6b5){const _0xaac4c1=a39_0x746a;return _0x28f6b5[_0xaac4c1(0xaf)](_0x291a1c=>_0x291a1c!==undefined&&_0x291a1c!==null);}async function executePlan(_0x35ca3e,_0x352183,_0xdae7f0){const _0x5b679b=a39_0x746a;if(_0x35ca3e[_0x5b679b(0x9e)]==='data'){const _0x2565b4=await resolveDatasetCode(_0x35ca3e,_0x352183,_0xdae7f0);return executeData(_0x2565b4,_0x35ca3e['command'],_0x35ca3e[_0x5b679b(0xe0)]);}if(_0x35ca3e['kind']==='sql'){if(!_0x35ca3e[_0x5b679b(0xe3)])throw CliErrors[_0x5b679b(0xd7)](_0x5b679b(0xbf)+_0x352183[_0x5b679b(0x99)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x35ca3e[_0x5b679b(0xe3)],normalizeScalarParams(_0x35ca3e[_0x5b679b(0xe0)]));}if(_0x35ca3e[_0x5b679b(0x9e)]===_0x5b679b(0xce)){const _0x153fbb=_0x35ca3e[_0x5b679b(0xd8)]||_0x35ca3e['bffCode']||(_0x35ca3e[_0x5b679b(0xe4)]==null?'':String(_0x35ca3e[_0x5b679b(0xe4)]));if(!_0x153fbb)throw CliErrors[_0x5b679b(0xd7)](_0x5b679b(0xbf)+_0x352183[_0x5b679b(0x99)]+_0x5b679b(0xbc));return executeSdkBff(_0x153fbb,_0x35ca3e[_0x5b679b(0xe0)]);}throw CliErrors[_0x5b679b(0xd7)](_0x5b679b(0xec)+_0x35ca3e[_0x5b679b(0x9e)]);}async function resolveDatasetCode(_0x2c1f3d,_0x221af8,_0x1b0ca8){const _0x3f1bed=a39_0x746a;if(_0x2c1f3d['datasetCode'])return _0x2c1f3d[_0x3f1bed(0xc7)];if(!_0x2c1f3d[_0x3f1bed(0x8b)])throw CliErrors[_0x3f1bed(0xd7)]('Service\x20command\x20'+_0x221af8[_0x3f1bed(0x99)]+_0x3f1bed(0x9d));const _0x41be12=await listDatasets(_0x1b0ca8[_0x3f1bed(0xda)]),_0xc8d938=_0x41be12[_0x3f1bed(0xaf)](_0x51af9f=>_0x51af9f['dbtableConfig']?.[_0x3f1bed(0xb5)]===_0x2c1f3d[_0x3f1bed(0x8b)]);if(!_0xc8d938?.['code'])throw CliErrors[_0x3f1bed(0xd7)](_0x3f1bed(0xc3)+_0x2c1f3d[_0x3f1bed(0x8b)]+_0x3f1bed(0xd0)+_0x1b0ca8[_0x3f1bed(0xda)]+'.',_0x3f1bed(0xc5));return _0xc8d938[_0x3f1bed(0xe2)];}function applyAppBinding(_0x792da1,_0xf263a0,_0x58bf74){const _0x54c611=a39_0x746a,_0x420c28=_0xf263a0['target'][_0x54c611(0xc0)];if(!_0x420c28)return;const _0x4ad150=_0x792da1[_0x54c611(0x91)][_0x420c28];if(!_0x4ad150)throw CliErrors[_0x54c611(0xd7)](_0x54c611(0xf1)+_0x420c28+_0x54c611(0xb1)+_0xf263a0[_0x54c611(0x99)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x5f31b0=_0x4ad150[_0x54c611(0xdd)]||_0x4ad150[_0x54c611(0xda)];_0x5f31b0&&!hasText(_0x58bf74[_0x54c611(0xdd)])&&(_0x58bf74['appcode']=_0x5f31b0),_0x4ad150['app']&&!hasText(_0x58bf74[_0x54c611(0xbe)])&&!hasText(_0x58bf74[_0x54c611(0xdd)])&&(_0x58bf74['app']=_0x4ad150['app']),_0x4ad150['env']&&!hasText(_0x58bf74[_0x54c611(0xc1)])&&(_0x58bf74['env']=_0x4ad150[_0x54c611(0xc1)]);}function renderDynamicCommandHelp(_0x2d2bff){const _0x29fb90=a39_0x746a,_0x4e298e=[_0x29fb90(0x9a),_0x29fb90(0xc2)+_0x2d2bff[_0x29fb90(0xc6)][_0x29fb90(0x9e)],_0x29fb90(0xc9)+_0x2d2bff[_0x29fb90(0xc6)][_0x29fb90(0x97)]];if(_0x2d2bff[_0x29fb90(0xc6)][_0x29fb90(0xc7)])_0x4e298e[_0x29fb90(0x8e)](_0x29fb90(0xf0)+_0x2d2bff[_0x29fb90(0xc6)][_0x29fb90(0xc7)]);if(_0x2d2bff[_0x29fb90(0xc6)]['datatable'])_0x4e298e[_0x29fb90(0x8e)](_0x29fb90(0xd1)+_0x2d2bff['target'][_0x29fb90(0x8b)]);if(_0x2d2bff[_0x29fb90(0xc6)]['sqlCode'])_0x4e298e[_0x29fb90(0x8e)](_0x29fb90(0xed)+_0x2d2bff['target'][_0x29fb90(0xe3)]);if(_0x2d2bff['target'][_0x29fb90(0xd8)])_0x4e298e['push'](_0x29fb90(0xa4)+_0x2d2bff['target'][_0x29fb90(0xd8)]);if(_0x2d2bff[_0x29fb90(0xad)]['length']>0x0){_0x4e298e[_0x29fb90(0x8e)]('',_0x29fb90(0xb0));for(const _0x493db4 of _0x2d2bff[_0x29fb90(0xad)]){_0x4e298e['push'](_0x29fb90(0x9f)+(_0x493db4[_0x29fb90(0x98)]||_0x29fb90(0x8a))+_0x29fb90(0xdc)+_0x493db4['target']+(_0x493db4[_0x29fb90(0x8c)]?'.'+_0x493db4[_0x29fb90(0x8c)]:''));}}return _0x4e298e[_0x29fb90(0xbb)]('\x0a');}function targetPreview(_0x55e64d){const _0x28543f=a39_0x746a;return{'kind':_0x55e64d['kind'],'command':_0x55e64d['command'],'appRef':_0x55e64d[_0x28543f(0xc0)],'datasetCode':_0x55e64d[_0x28543f(0xc7)],'datatable':_0x55e64d[_0x28543f(0x8b)],'sqlCode':_0x55e64d[_0x28543f(0xe3)],'bffCode':_0x55e64d['bffCode'],'bffId':_0x55e64d[_0x28543f(0xe4)],'functionName':_0x55e64d[_0x28543f(0xd8)]};}function normalizeScalarParams(_0x4357f1){const _0x3f1cf3=a39_0x746a;return Object[_0x3f1cf3(0xa0)](Object[_0x3f1cf3(0x8d)](_0x4357f1)[_0x3f1cf3(0xb3)](([,_0xed5cb3])=>typeof _0xed5cb3===_0x3f1cf3(0xe1)||typeof _0xed5cb3===_0x3f1cf3(0x9b)));}function hasText(_0x1adb24){const _0x580b4f=a39_0x746a;return typeof _0x1adb24===_0x580b4f(0xe1)&&_0x1adb24[_0x580b4f(0x8f)]()[_0x580b4f(0x93)]>0x0;}function isPrimitiveFlagDefault(_0x149443){const _0xfbabfe=a39_0x746a;return _0x149443===undefined||typeof _0x149443===_0xfbabfe(0xe1)||typeof _0x149443==='number'||typeof _0x149443===_0xfbabfe(0xef);}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d2def,_0x5861e7){const _0x146b6e=a40_0x4e6f,_0x5013d1=_0x2d2def();while(!![]){try{const _0x22c611=parseInt(_0x146b6e(0xca))/0x1+-parseInt(_0x146b6e(0xbd))/0x2*(-parseInt(_0x146b6e(0xbc))/0x3)+parseInt(_0x146b6e(0xcf))/0x4+parseInt(_0x146b6e(0xdf))/0x5*(-parseInt(_0x146b6e(0xd5))/0x6)+-parseInt(_0x146b6e(0xbe))/0x7*(parseInt(_0x146b6e(0xc2))/0x8)+parseInt(_0x146b6e(0xe3))/0x9*(-parseInt(_0x146b6e(0xc0))/0xa)+parseInt(_0x146b6e(0xd7))/0xb*(-parseInt(_0x146b6e(0xd9))/0xc);if(_0x22c611===_0x5861e7)break;else _0x5013d1['push'](_0x5013d1['shift']());}catch(_0x131fcc){_0x5013d1['push'](_0x5013d1['shift']());}}}(a40_0x4a8b,0x4d1e7));export function adaptServiceTreeManifestForLegacyFramework(_0x2b473d){const _0x1a9c14=a40_0x4e6f,_0x5a5ecb=cloneJsonValue(_0x2b473d),_0x1cb4f0=[];if(!isObjectRecord(_0x5a5ecb))return{'manifest':_0x5a5ecb,'errors':_0x1cb4f0};return Array[_0x1a9c14(0xcb)](_0x5a5ecb['commands'])&&_0x5a5ecb[_0x1a9c14(0xe1)][_0x1a9c14(0xe0)]((_0x811dcf,_0x385f3d)=>{const _0x46d8a5=_0x1a9c14;if(!isObjectRecord(_0x811dcf))return;adaptBffTarget(_0x811dcf['target'],_0x46d8a5(0xde)+_0x385f3d+'].target',_0x1cb4f0);}),adaptResources(_0x5a5ecb[_0x1a9c14(0xd4)],_0x1a9c14(0xe2),_0x1cb4f0),{'manifest':_0x5a5ecb,'errors':_0x1cb4f0};}function a40_0x4a8b(){const _0x8a3d60=['bff.exec','bff','string','resources','12IkuDEW','target','1007677Hlaniq','.functionName','12RWEgbH','error','hasOwnProperty','.actions.','fromEntries','$.commands[','1086995GtLXiX','forEach','commands','$.resources','2718DebBeh','push','functionName','1563RlmdBM','1434oJoCJl','394569xkFErQ','action','3730TpVOtq','actions','56ZfZmWM','.resources','trim','prototype','kind','entries','scriptName','call','551826uMcrMi','isArray','map','functionName\x20must\x20be\x20a\x20non-empty\x20string.','object','1696464VBLSwN','.scriptName'];a40_0x4a8b=function(){return _0x8a3d60;};return a40_0x4a8b();}export function toPublicServiceTreeTarget(_0x2a0f0d){const _0x4bbddc=a40_0x4e6f,{scriptName:_0x1b0bf2,..._0x5c3e08}=_0x2a0f0d;return typeof _0x1b0bf2===_0x4bbddc(0xd3)&&_0x1b0bf2[_0x4bbddc(0xc4)]()&&(_0x5c3e08[_0x4bbddc(0xe5)]=_0x1b0bf2),_0x5c3e08;}function a40_0x4e6f(_0x1a072c,_0x10fd66){_0x1a072c=_0x1a072c-0xbc;const _0x4a8b35=a40_0x4a8b();let _0x4e6fa4=_0x4a8b35[_0x1a072c];return _0x4e6fa4;}export function toPublicNormalizedServiceTree(_0x1eb8f5){const _0x3d7c15=a40_0x4e6f;return{..._0x1eb8f5,'commands':_0x1eb8f5[_0x3d7c15(0xe1)][_0x3d7c15(0xcc)](_0x585787=>({..._0x585787,'target':toPublicServiceTreeTarget(_0x585787[_0x3d7c15(0xd6)])}))};}function adaptResources(_0x40f782,_0x4be949,_0x164b93){const _0x49c684=a40_0x4e6f;if(!isObjectRecord(_0x40f782))return;for(const [_0x5b862f,_0xf8b80f]of Object[_0x49c684(0xc7)](_0x40f782)){if(!isObjectRecord(_0xf8b80f))continue;const _0x30ac62=_0x4be949+'.'+_0x5b862f;if(isObjectRecord(_0xf8b80f[_0x49c684(0xc1)]))for(const [_0x1cad8b,_0x5869ba]of Object['entries'](_0xf8b80f[_0x49c684(0xc1)])){if(!isObjectRecord(_0x5869ba))continue;const _0x1aaaa0=_0x30ac62+_0x49c684(0xdc)+_0x1cad8b,_0x155b8a=isObjectRecord(_0x5869ba[_0x49c684(0xd6)])&&_0x5869ba[_0x49c684(0xd6)][_0x49c684(0xc6)]===_0x49c684(0xd2);adaptBffTarget(_0x5869ba[_0x49c684(0xd6)],_0x1aaaa0+'.target',_0x164b93),(_0x155b8a||isBffAction(_0x5869ba))&&adaptFunctionNameField(_0x5869ba,_0x1aaaa0,_0x164b93);}adaptResources(_0xf8b80f[_0x49c684(0xd4)],_0x30ac62+_0x49c684(0xc3),_0x164b93);}}function adaptBffTarget(_0x4bc313,_0x210ef0,_0x4cb9ec){const _0x3b287d=a40_0x4e6f;if(!isObjectRecord(_0x4bc313)||_0x4bc313[_0x3b287d(0xc6)]!==_0x3b287d(0xd2))return;adaptFunctionNameField(_0x4bc313,_0x210ef0,_0x4cb9ec);}function adaptFunctionNameField(_0x4bc96b,_0x29dab4,_0x320410){const _0x1a42c7=a40_0x4e6f;Object[_0x1a42c7(0xc5)][_0x1a42c7(0xdb)][_0x1a42c7(0xc9)](_0x4bc96b,_0x1a42c7(0xc8))&&_0x320410[_0x1a42c7(0xe4)]({'level':_0x1a42c7(0xda),'path':_0x29dab4+_0x1a42c7(0xd0),'message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object[_0x1a42c7(0xc5)][_0x1a42c7(0xdb)][_0x1a42c7(0xc9)](_0x4bc96b,'functionName')){if(typeof _0x4bc96b[_0x1a42c7(0xe5)]!==_0x1a42c7(0xd3)||!_0x4bc96b[_0x1a42c7(0xe5)][_0x1a42c7(0xc4)]()){_0x320410['push']({'level':_0x1a42c7(0xda),'path':_0x29dab4+_0x1a42c7(0xd8),'message':_0x1a42c7(0xcd)}),delete _0x4bc96b[_0x1a42c7(0xe5)];return;}_0x4bc96b['scriptName']=_0x4bc96b['functionName'],delete _0x4bc96b[_0x1a42c7(0xe5)];}}function isBffAction(_0x327652){const _0x3321f8=a40_0x4e6f;return _0x327652[_0x3321f8(0xc6)]===_0x3321f8(0xd2)||_0x327652[_0x3321f8(0xbf)]===_0x3321f8(0xd1)||_0x327652[_0x3321f8(0xd6)]===_0x3321f8(0xd1);}function cloneJsonValue(_0x28f991){const _0x4c86e7=a40_0x4e6f;if(Array[_0x4c86e7(0xcb)](_0x28f991))return _0x28f991['map'](_0x194973=>cloneJsonValue(_0x194973));if(isObjectRecord(_0x28f991))return Object[_0x4c86e7(0xdd)](Object[_0x4c86e7(0xc7)](_0x28f991)[_0x4c86e7(0xcc)](([_0x35ab6e,_0x175ca5])=>[_0x35ab6e,cloneJsonValue(_0x175ca5)]));return _0x28f991;}function isObjectRecord(_0x9a1a99){const _0x342d3f=a40_0x4e6f;return Boolean(_0x9a1a99)&&typeof _0x9a1a99===_0x342d3f(0xce)&&!Array[_0x342d3f(0xcb)](_0x9a1a99);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x707eb7=a41_0x396f;function a41_0x396f(_0x393f61,_0x288ca7){_0x393f61=_0x393f61-0x7d;const _0x594263=a41_0x5942();let _0x396fa1=_0x594263[_0x393f61];return _0x396fa1;}(function(_0x36ba54,_0x56408a){const _0x9f1af8=a41_0x396f,_0x3123df=_0x36ba54();while(!![]){try{const _0x3a071f=-parseInt(_0x9f1af8(0x86))/0x1+-parseInt(_0x9f1af8(0xb7))/0x2+-parseInt(_0x9f1af8(0xaf))/0x3+-parseInt(_0x9f1af8(0xa0))/0x4*(parseInt(_0x9f1af8(0x9d))/0x5)+parseInt(_0x9f1af8(0x9b))/0x6+-parseInt(_0x9f1af8(0x8f))/0x7+parseInt(_0x9f1af8(0xac))/0x8;if(_0x3a071f===_0x56408a)break;else _0x3123df['push'](_0x3123df['shift']());}catch(_0x9f57eb){_0x3123df['push'](_0x3123df['shift']());}}}(a41_0x5942,0x4319c));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_0x707eb7(0x7e),'type':'string','required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':'service','type':a41_0x707eb7(0x7d),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x707eb7(0xbe)}};function summarizeService(_0x44c4a0){const _0x2f40e7=a41_0x707eb7;return{'serviceCode':_0x44c4a0['serviceCode'],'name':_0x44c4a0[_0x2f40e7(0x93)]['service']['name'],'version':_0x44c4a0[_0x2f40e7(0x80)],'importedAt':_0x44c4a0[_0x2f40e7(0xbc)],'source':_0x44c4a0[_0x2f40e7(0x83)],'commandCount':_0x44c4a0[_0x2f40e7(0x93)][_0x2f40e7(0x99)][_0x2f40e7(0x8b)],'commands':_0x44c4a0[_0x2f40e7(0x93)][_0x2f40e7(0x99)][_0x2f40e7(0x90)](_0x275dc1=>({'path':_0x275dc1[_0x2f40e7(0x9a)],'description':_0x275dc1[_0x2f40e7(0x81)],'risk':_0x275dc1[_0x2f40e7(0xab)],'target':toPublicServiceTreeTarget(_0x275dc1[_0x2f40e7(0xbd)]),'flags':_0x275dc1[_0x2f40e7(0xa2)][_0x2f40e7(0x90)](_0x1883ea=>({'name':_0x1883ea[_0x2f40e7(0x9e)],'cliName':_0x1883ea[_0x2f40e7(0xa4)],'type':_0x1883ea[_0x2f40e7(0xa3)],'required':_0x1883ea[_0x2f40e7(0x94)]===!![]}))}))};}function a41_0x5942(){const _0x5980a9=['version','description','Service\x20manifest\x20validation\x20passed.','source','errors','imported','334275eiVOSQ','import','manifests','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Local\x20service\x20not\x20found:\x20','length','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','\x20service\x20','Updated','393057aFLmyZ','map','detail','warnings','normalizedManifest','required','validate','registryPath','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Exported\x20service\x20','commands','cliPath','1018356ExniLV','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','1250kGFcxo','name','updated','7992zIMNOZ','entries','flags','type','cliName','Imported\x20','report','manifest','str','read','kind','risk','11564920dmpUXE','service','filePath','418086TheesL','serviceCount','serviceCode','Imported','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','write','remove','WRITE','622418YTKpGw','replaced','hash','\x20service(s).','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','importedAt','target','lower\x20kebab-case\x20service\x20code','string','file','entry'];a41_0x5942=function(){return _0x5980a9;};return a41_0x5942();}function summarizeLoadedManifest(_0x4785fe){const _0x136012=a41_0x707eb7;return{'service':_0x4785fe['normalizedManifest']?.[_0x136012(0xad)],'version':_0x4785fe[_0x136012(0x93)]?.[_0x136012(0x80)],'commandCount':_0x4785fe[_0x136012(0x93)]?.[_0x136012(0x99)][_0x136012(0x8b)]??0x0,'commands':_0x4785fe['normalizedManifest']?.['commands'][_0x136012(0x90)](_0x3f1234=>({'path':_0x3f1234[_0x136012(0x9a)],'risk':_0x3f1234[_0x136012(0xab)],'target':toPublicServiceTreeTarget(_0x3f1234[_0x136012(0xbd)])}))??[],'registryIndex':_0x4785fe['registryIndex'],'registryServiceCode':_0x4785fe['registryServiceCode'],'errors':_0x4785fe['report']['errors'],'warnings':_0x4785fe[_0x136012(0xa6)][_0x136012(0x92)]};}export const serviceDefinitions=[{'service':a41_0x707eb7(0xad),'command':a41_0x707eb7(0x95),'description':a41_0x707eb7(0xbb),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x1dee36){const _0x2a908c=a41_0x707eb7,_0x5cd20f=loadServiceManifestFromFile(_0x1dee36[_0x2a908c(0xa8)](_0x2a908c(0x7e)));if(!_0x5cd20f[_0x2a908c(0xa6)]['ok'])return{'ok':![],'data':{'file':_0x5cd20f[_0x2a908c(0xae)],'hash':_0x5cd20f[_0x2a908c(0xb9)],'kind':_0x5cd20f[_0x2a908c(0xaa)],'serviceCount':_0x5cd20f['manifests'][_0x2a908c(0x8b)],'services':_0x5cd20f[_0x2a908c(0x88)]['map'](summarizeLoadedManifest),'errors':_0x5cd20f[_0x2a908c(0xa6)][_0x2a908c(0x84)],'warnings':_0x5cd20f[_0x2a908c(0xa6)][_0x2a908c(0x92)]},'message':formatValidationFailure(_0x5cd20f[_0x2a908c(0xa6)])};if(_0x5cd20f[_0x2a908c(0xaa)]==='registry'||_0x5cd20f[_0x2a908c(0x88)][_0x2a908c(0x8b)]!==0x1)return{'ok':!![],'data':{'file':_0x5cd20f[_0x2a908c(0xae)],'hash':_0x5cd20f['hash'],'kind':_0x5cd20f[_0x2a908c(0xaa)],'serviceCount':_0x5cd20f['manifests']['length'],'commandCount':_0x5cd20f['manifests']['reduce']((_0x481791,_0x45bc95)=>_0x481791+(_0x45bc95[_0x2a908c(0x93)]?.['commands']['length']??0x0),0x0),'services':_0x5cd20f[_0x2a908c(0x88)]['map'](summarizeLoadedManifest),'warnings':_0x5cd20f[_0x2a908c(0xa6)][_0x2a908c(0x92)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x5cd20f[_0x2a908c(0xae)],'hash':_0x5cd20f['hash'],'kind':_0x5cd20f['kind'],'service':_0x5cd20f[_0x2a908c(0x93)]?.[_0x2a908c(0xad)],'version':_0x5cd20f[_0x2a908c(0x93)]?.[_0x2a908c(0x80)],'commandCount':_0x5cd20f[_0x2a908c(0x93)]?.[_0x2a908c(0x99)]['length']??0x0,'commands':_0x5cd20f['normalizedManifest']?.[_0x2a908c(0x99)]['map'](_0x1b99c3=>({'path':_0x1b99c3[_0x2a908c(0x9a)],'risk':_0x1b99c3[_0x2a908c(0xab)],'target':toPublicServiceTreeTarget(_0x1b99c3[_0x2a908c(0xbd)])})),'warnings':_0x5cd20f['report']['warnings']},'message':_0x2a908c(0x82)};}},{'service':a41_0x707eb7(0xad),'command':a41_0x707eb7(0x87),'description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':a41_0x707eb7(0xb4),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x5979df){const _0x309684=a41_0x707eb7,_0x1f6482=loadServiceManifestFromFile(_0x5979df[_0x309684(0xa8)]('file'));return{'method':_0x309684(0xb6),'url':getServiceRegistryPath(),'body':{'file':_0x1f6482['filePath'],'hash':_0x1f6482[_0x309684(0xb9)],'kind':_0x1f6482[_0x309684(0xaa)],'ok':_0x1f6482[_0x309684(0xa6)]['ok'],'service':_0x1f6482[_0x309684(0x93)]?.[_0x309684(0xad)],'version':_0x1f6482['normalizedManifest']?.[_0x309684(0x80)],'serviceCount':_0x1f6482[_0x309684(0x88)][_0x309684(0x8b)],'services':_0x1f6482['manifests'][_0x309684(0x90)](_0xa4d013=>({'service':_0xa4d013[_0x309684(0x93)]?.[_0x309684(0xad)],'version':_0xa4d013[_0x309684(0x93)]?.[_0x309684(0x80)],'commandCount':_0xa4d013['normalizedManifest']?.[_0x309684(0x99)][_0x309684(0x8b)]??0x0,'errors':_0xa4d013[_0x309684(0xa6)][_0x309684(0x84)]})),'errors':_0x1f6482[_0x309684(0xa6)][_0x309684(0x84)],'commandCount':_0x1f6482[_0x309684(0x93)]?.['commands'][_0x309684(0x8b)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x22c1d7){const _0x4eeb11=a41_0x707eb7,_0x19d4dd=importServiceManifest(_0x22c1d7[_0x4eeb11(0xa8)](_0x4eeb11(0x7e)));if(_0x19d4dd[_0x4eeb11(0xa1)][_0x4eeb11(0x8b)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x19d4dd[_0x4eeb11(0x96)],'imported':_0x19d4dd['imported'],'updated':_0x19d4dd[_0x4eeb11(0x9f)],'serviceCount':_0x19d4dd['serviceCount'],'services':_0x19d4dd[_0x4eeb11(0xa1)][_0x4eeb11(0x90)](summarizeService)},'message':_0x4eeb11(0xa5)+_0x19d4dd[_0x4eeb11(0x85)]+'\x20service(s),\x20updated\x20'+_0x19d4dd[_0x4eeb11(0x9f)]+_0x4eeb11(0xba)};return{'ok':!![],'data':{'registryPath':_0x19d4dd[_0x4eeb11(0x96)],'replaced':_0x19d4dd[_0x4eeb11(0xb8)],'imported':_0x19d4dd[_0x4eeb11(0x85)],'updated':_0x19d4dd[_0x4eeb11(0x9f)],'serviceCount':_0x19d4dd[_0x4eeb11(0xb0)],'service':summarizeService(_0x19d4dd[_0x4eeb11(0x7f)])},'message':(_0x19d4dd[_0x4eeb11(0xb8)]?_0x4eeb11(0x8e):_0x4eeb11(0xb2))+_0x4eeb11(0x8d)+_0x19d4dd[_0x4eeb11(0x7f)][_0x4eeb11(0xb1)]+'.'};}},{'service':a41_0x707eb7(0xad),'command':'export','description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a41_0x707eb7(0xb4),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x355261){const _0x17cac0=a41_0x707eb7,_0x2c07f6=getLocalServiceEntry(_0x355261['str'](_0x17cac0(0xad)));return{'method':_0x17cac0(0xb6),'url':_0x355261[_0x17cac0(0xa8)]('file'),'body':{'service':_0x355261[_0x17cac0(0xa8)](_0x17cac0(0xad)),'found':Boolean(_0x2c07f6),'version':_0x2c07f6?.[_0x17cac0(0x80)],'source':_0x2c07f6?.[_0x17cac0(0x83)]},'description':_0x17cac0(0x97)};},async 'execute'(_0x553e1){const _0xf98c6=a41_0x707eb7,_0x72b375=exportServiceManifest(_0x553e1[_0xf98c6(0xa8)](_0xf98c6(0xad)),_0x553e1[_0xf98c6(0xa8)](_0xf98c6(0x7e)));return{'ok':!![],'data':{'registryPath':_0x72b375[_0xf98c6(0x96)],'file':_0x72b375['filePath'],'service':summarizeService(_0x72b375[_0xf98c6(0x7f)])},'message':_0xf98c6(0x98)+_0x72b375['entry']['serviceCode']+'.'};}},{'service':a41_0x707eb7(0xad),'command':'list','description':a41_0x707eb7(0x9c),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5204f7=a41_0x707eb7,_0x250b8b=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x250b8b['length'],'services':_0x250b8b[_0x5204f7(0x90)](summarizeService)}};}},{'service':a41_0x707eb7(0xad),'command':a41_0x707eb7(0xb5),'description':a41_0x707eb7(0xb3),'risk':a41_0x707eb7(0xb4),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x137d28){const _0x27fd30=a41_0x707eb7,_0x5bf490=getLocalServiceEntry(_0x137d28[_0x27fd30(0xa8)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x137d28[_0x27fd30(0xa8)](_0x27fd30(0xad)),'found':Boolean(_0x5bf490),'version':_0x5bf490?.[_0x27fd30(0x80)],'source':_0x5bf490?.[_0x27fd30(0x83)]},'description':_0x27fd30(0x8c)};},async 'execute'(_0x5ac7a9){const _0x106722=a41_0x707eb7,_0x5aec62=removeServiceManifest(_0x5ac7a9['str'](_0x106722(0xad)));return{'ok':!![],'data':{'registryPath':_0x5aec62[_0x106722(0x96)],'serviceCount':_0x5aec62['serviceCount'],'service':summarizeService(_0x5aec62[_0x106722(0x7f)])},'message':'Removed\x20service\x20'+_0x5aec62[_0x106722(0x7f)][_0x106722(0xb1)]+'.'};}},{'service':'service','command':a41_0x707eb7(0x91),'description':a41_0x707eb7(0x89),'risk':a41_0x707eb7(0xa9),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x7ff6e0){const _0x238cc6=a41_0x707eb7,_0x15a92d=getLocalServiceEntry(_0x7ff6e0[_0x238cc6(0xa8)](_0x238cc6(0xad)));if(!_0x15a92d)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x7ff6e0[_0x238cc6(0xa8)](_0x238cc6(0xad))},'message':_0x238cc6(0x8a)+_0x7ff6e0['str'](_0x238cc6(0xad))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x15a92d),'manifest':_0x15a92d[_0x238cc6(0xa7)],'normalizedManifest':toPublicNormalizedServiceTree(_0x15a92d[_0x238cc6(0x93)])}};}}];
|
|
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 +1 @@
|
|
|
1
|
-
const a42_0x106f25=a42_0x1754;(function(_0x55d242,_0x258875){const _0x4360f1=a42_0x1754,_0x82eea=_0x55d242();while(!![]){try{const _0x138b20=parseInt(_0x4360f1(0x110))/0x1*(-parseInt(_0x4360f1(0x137))/0x2)+parseInt(_0x4360f1(0x12c))/0x3+parseInt(_0x4360f1(0xf3))/0x4*(-parseInt(_0x4360f1(0x10e))/0x5)+-parseInt(_0x4360f1(0x121))/0x6+-parseInt(_0x4360f1(0xf2))/0x7*(-parseInt(_0x4360f1(0x11c))/0x8)+-parseInt(_0x4360f1(0x12d))/0x9+parseInt(_0x4360f1(0xfb))/0xa;if(_0x138b20===_0x258875)break;else _0x82eea['push'](_0x82eea['shift']());}catch(_0x5a0e80){_0x82eea['push'](_0x82eea['shift']());}}}(a42_0x3579,0x8a8f0));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_0x106f25(0xfa);export function getServiceRegistryPath(_0x4acaf0={}){const _0x144cea=a42_0x106f25;return resolve(_0x4acaf0[_0x144cea(0x139)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x121a26={}){const _0xcacc72=a42_0x106f25,_0x2fa0b4=getServiceRegistryPath(_0x121a26);if(!existsSync(_0x2fa0b4))return emptyServiceRegistry();try{const _0x38a2c2=readFileSync(_0x2fa0b4,_0xcacc72(0x109));if(!_0x38a2c2[_0xcacc72(0xfd)]())return emptyServiceRegistry();const _0x1860e4=JSON[_0xcacc72(0xf8)](_0x38a2c2);if(_0x1860e4[_0xcacc72(0x113)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0xcacc72(0x116)](_0xcacc72(0xf4)+String(_0x1860e4[_0xcacc72(0x113)]),_0xcacc72(0xe8)+_0x2fa0b4+'.');if(!Array['isArray'](_0x1860e4[_0xcacc72(0x12b)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1860e4[_0xcacc72(0x13a)],'services':_0x1860e4[_0xcacc72(0x12b)]};}catch(_0x575c20){if(_0x575c20 instanceof Error&&_0x575c20[_0xcacc72(0x11b)]===_0xcacc72(0xf7))throw _0x575c20;throw CliErrors['validation']('Invalid\x20service\x20registry\x20JSON:\x20'+_0x2fa0b4,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x97fd9,_0x37f105={}){const _0x2b327a=a42_0x106f25,_0x4655aa=getServiceRegistryPath(_0x37f105),_0x3b8c0e=dirname(_0x4655aa);!existsSync(_0x3b8c0e)&&mkdirSync(_0x3b8c0e,{'recursive':!![]});const _0x12316c=_0x4655aa+'.tmp';try{writeFileSync(_0x12316c,JSON[_0x2b327a(0x124)](_0x97fd9,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x12316c,_0x4655aa);}catch(_0x427ca5){try{unlinkSync(_0x12316c);}catch{}if(_0x427ca5?.[_0x2b327a(0xef)]===_0x2b327a(0xe5))throw CliErrors['validation'](_0x2b327a(0xe9)+_0x4655aa);throw _0x427ca5;}return _0x4655aa;}export function loadServiceManifestFromFile(_0x5516c8){const _0x52211a=a42_0x106f25,_0x17f18f=resolve(_0x5516c8);if(!existsSync(_0x17f18f))throw CliErrors[_0x52211a(0x116)](_0x52211a(0xf0)+_0x5516c8);let _0x3081dc;const _0x1e5bfa=readFileSync(_0x17f18f,'utf8');try{_0x3081dc=JSON[_0x52211a(0xf8)](_0x1e5bfa);}catch{throw CliErrors['validation'](_0x52211a(0xe6)+_0x5516c8,_0x52211a(0x117));}const _0x48b287=sha256(_0x1e5bfa),_0xeeaf40=extractLoadedServiceManifests(_0x3081dc,_0x48b287),_0x21be3a=aggregateValidationReports(_0xeeaf40),_0x2fddf9=_0xeeaf40[0x0];return{'filePath':_0x17f18f,'hash':_0x48b287,'kind':isServiceRegistryLike(_0x3081dc)?_0x52211a(0x134):_0x52211a(0x127),'manifest':_0x2fddf9?.['manifest']??_0x3081dc,'report':_0x21be3a,'normalizedManifest':_0xeeaf40['length']===0x1?_0x2fddf9?.[_0x52211a(0xe4)]:undefined,'manifests':_0xeeaf40};}export function importServiceManifest(_0x2cd1c7,_0x5d755a={}){const _0x1aaec1=a42_0x106f25,_0x148f3c=loadServiceManifestFromFile(_0x2cd1c7);if(!_0x148f3c['report']['ok'])throw CliErrors[_0x1aaec1(0x116)](formatValidationFailure(_0x148f3c[_0x1aaec1(0xeb)]),_0x1aaec1(0xea));if(_0x148f3c[_0x1aaec1(0x138)]['length']===0x0)throw CliErrors['validation'](_0x1aaec1(0xf5),_0x1aaec1(0x106));const _0x55ca97=readServiceRegistry(_0x5d755a),_0x1b7270=(_0x5d755a[_0x1aaec1(0x118)]??(()=>new Date()))()[_0x1aaec1(0x130)](),_0x4f91a6=[];let _0x4b68d9=0x0,_0x4e6a3a=0x0;for(const _0x4009a0 of _0x148f3c['manifests']){if(!_0x4009a0[_0x1aaec1(0xe4)])continue;const _0x3ebbfb=_0x4009a0[_0x1aaec1(0xe4)][_0x1aaec1(0x10c)][_0x1aaec1(0xef)],_0x1bf8df={'serviceCode':_0x3ebbfb,'version':_0x4009a0['normalizedManifest'][_0x1aaec1(0x11a)],'importedAt':_0x1b7270,'source':{'type':_0x1aaec1(0x105),'path':_0x148f3c[_0x1aaec1(0x10a)],'hash':_0x4009a0[_0x1aaec1(0x123)]},'manifest':_0x4009a0[_0x1aaec1(0x127)],'normalizedManifest':_0x4009a0[_0x1aaec1(0xe4)]},_0x4b4ae8=_0x55ca97['services'][_0x1aaec1(0xf9)](_0x288f64=>_0x288f64[_0x1aaec1(0x12e)]===_0x3ebbfb);_0x4b4ae8>=0x0?(_0x55ca97[_0x1aaec1(0x12b)][_0x4b4ae8]=_0x1bf8df,_0x4e6a3a++):(_0x55ca97['services'][_0x1aaec1(0x104)](_0x1bf8df),_0x4b68d9++),_0x4f91a6['push'](_0x1bf8df);}_0x55ca97[_0x1aaec1(0x12b)][_0x1aaec1(0xff)]((_0x2a9596,_0x2b1788)=>_0x2a9596['serviceCode'][_0x1aaec1(0x128)](_0x2b1788[_0x1aaec1(0x12e)])),_0x55ca97[_0x1aaec1(0x13a)]=_0x1b7270;const _0x3271c4=writeServiceRegistry(_0x55ca97,_0x5d755a);return{'registryPath':_0x3271c4,'entry':_0x4f91a6[0x0],'replaced':_0x4f91a6['length']===0x1?_0x4e6a3a===0x1:_0x4e6a3a>0x0,'entries':_0x4f91a6,'imported':_0x4b68d9,'updated':_0x4e6a3a,'serviceCount':_0x55ca97['services']['length']};}export function exportServiceManifest(_0x2d2df7,_0x10918c,_0x572518={}){const _0x4f71b5=a42_0x106f25,_0x53b0d5=getServiceRegistryPath(_0x572518),_0x3fcaa8=getLocalServiceEntry(_0x2d2df7,_0x572518);if(!_0x3fcaa8)throw CliErrors[_0x4f71b5(0x116)](_0x4f71b5(0x129)+_0x2d2df7,_0x4f71b5(0x125));const _0x245295=resolve(_0x10918c),_0xedaf9d=dirname(_0x245295);return!existsSync(_0xedaf9d)&&mkdirSync(_0xedaf9d,{'recursive':!![]}),writeFileSync(_0x245295,JSON['stringify'](_0x3fcaa8[_0x4f71b5(0x127)],null,0x2)+'\x0a',{'encoding':_0x4f71b5(0x109),'mode':0x180}),{'registryPath':_0x53b0d5,'filePath':_0x245295,'entry':_0x3fcaa8};}export function removeServiceManifest(_0x290202,_0x40d48a={}){const _0x3825db=a42_0x106f25,_0x2cd08f=readServiceRegistry(_0x40d48a),_0x46843c=_0x290202['trim'](),_0x2ae439=_0x2cd08f['services'][_0x3825db(0xf9)](_0x174203=>_0x174203[_0x3825db(0x12e)]===_0x46843c);if(_0x2ae439<0x0)throw CliErrors['validation'](_0x3825db(0x129)+_0x46843c,_0x3825db(0x125));const [_0xd5cc24]=_0x2cd08f['services'][_0x3825db(0x132)](_0x2ae439,0x1),_0x4e879e=(_0x40d48a[_0x3825db(0x118)]??(()=>new Date()))()['toISOString']();_0x2cd08f[_0x3825db(0x13a)]=_0x4e879e;const _0x335cf=writeServiceRegistry(_0x2cd08f,_0x40d48a);return{'registryPath':_0x335cf,'entry':_0xd5cc24,'serviceCount':_0x2cd08f[_0x3825db(0x12b)]['length']};}export function listLocalServices(_0x56d703={}){const _0x5255c1=a42_0x106f25;return readServiceRegistry(_0x56d703)[_0x5255c1(0x12b)];}export function getLocalServiceEntry(_0x27dc3b,_0x50961a={}){const _0x46b159=a42_0x106f25;return readServiceRegistry(_0x50961a)[_0x46b159(0x12b)][_0x46b159(0xe2)](_0x5f41ba=>_0x5f41ba['serviceCode']===_0x27dc3b[_0x46b159(0xfd)]());}export function listLocalServiceTrees(_0x5c458c={}){const _0x3d97ba=a42_0x106f25;return readServiceRegistry(_0x5c458c)[_0x3d97ba(0x12b)]['map'](_0x225488=>_0x225488[_0x3d97ba(0xe4)]);}export function inspectServiceRegistry(_0x4c9c5e={}){const _0x10b5fd=a42_0x106f25,_0x1f4ee4=getServiceRegistryPath(_0x4c9c5e);if(!existsSync(_0x1f4ee4))return emptyServiceRegistryInspection(_0x1f4ee4,_0x10b5fd(0x108),![]);try{const _0x389266=readFileSync(_0x1f4ee4,_0x10b5fd(0x109));if(!_0x389266[_0x10b5fd(0xfd)]())return emptyServiceRegistryInspection(_0x1f4ee4,_0x10b5fd(0xfe),!![]);const _0x15394e=JSON[_0x10b5fd(0xf8)](_0x389266);if(_0x15394e[_0x10b5fd(0x113)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1f4ee4,_0x10b5fd(0x10b),!![]),'schemaVersion':_0x15394e[_0x10b5fd(0x113)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x15394e[_0x10b5fd(0x113)])};if(!Array[_0x10b5fd(0xfc)](_0x15394e['services']))return{...emptyServiceRegistryInspection(_0x1f4ee4,_0x10b5fd(0x10b),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x15394e[_0x10b5fd(0x13a)],'message':'services\x20must\x20be\x20an\x20array'};const _0x40ef45=_0x15394e['services'][_0x10b5fd(0x101)](summarizeLocalServiceEntry);return{'registryPath':_0x1f4ee4,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x15394e[_0x10b5fd(0x13a)],'serviceCount':_0x40ef45[_0x10b5fd(0x120)],'commandCount':_0x40ef45[_0x10b5fd(0xec)]((_0x100f3e,_0x3dcc0d)=>_0x100f3e+_0x3dcc0d[_0x10b5fd(0x102)],0x0),'services':_0x40ef45};}catch(_0x134932){return{...emptyServiceRegistryInspection(_0x1f4ee4,_0x10b5fd(0x10b),!![]),'message':_0x134932 instanceof Error?_0x134932['message']:String(_0x134932)};}}export function formatValidationFailure(_0x2b23cb){const _0x1c4192=a42_0x106f25,_0x15a245=_0x2b23cb[_0x1c4192(0x100)][_0x1c4192(0x101)](_0x1168db=>_0x1168db['path']+':\x20'+_0x1168db[_0x1c4192(0x112)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x15a245[_0x1c4192(0xf6)]('\x0a');}function extractLoadedServiceManifests(_0xdcb7f4,_0x1c77d3){const _0x2b27d3=a42_0x106f25;if(!isServiceRegistryLike(_0xdcb7f4)){const _0x33a341=_0xdcb7f4,{manifest:_0x4df4b6,errors:_0x370321}=adaptServiceTreeManifestForLegacyFramework(_0x33a341),_0x388f87=validateServiceTreeManifest(_0x4df4b6),_0x4c6799=mergeValidationErrors(_0x388f87,_0x370321);return[{'manifest':_0x33a341,'report':_0x4c6799,'normalizedManifest':_0x4c6799['ok']?normalizeServiceTreeManifest(_0x4df4b6):undefined,'sourceHash':_0x1c77d3}];}return _0xdcb7f4[_0x2b27d3(0x12b)][_0x2b27d3(0x101)]((_0xab7d1e,_0x4eb993)=>{const _0x4d02ac=_0x2b27d3,_0x1946f7=isObjectRecord(_0xab7d1e)?_0xab7d1e['manifest']:undefined,{manifest:_0x3996cf,errors:_0x5cbb9d}=adaptServiceTreeManifestForLegacyFramework(_0x1946f7),_0x4dd713=validateServiceTreeManifest(_0x3996cf),_0xf201d=mergeValidationErrors(_0x4dd713,_0x5cbb9d),_0x415925=isObjectRecord(_0xab7d1e)&&typeof _0xab7d1e[_0x4d02ac(0x12e)]===_0x4d02ac(0x10f)?_0xab7d1e[_0x4d02ac(0x12e)]:undefined;return{'manifest':_0x1946f7,'report':_0xf201d,'normalizedManifest':_0xf201d['ok']?normalizeServiceTreeManifest(_0x3996cf):undefined,'sourceHash':sha256(JSON[_0x4d02ac(0x124)](_0x1946f7,null,0x2)+'\x0a'),'registryIndex':_0x4eb993,'registryServiceCode':_0x415925};});}function a42_0x1754(_0x4ed709,_0x353296){_0x4ed709=_0x4ed709-0xe2;const _0x357935=a42_0x3579();let _0x175483=_0x357935[_0x4ed709];return _0x175483;}function mergeValidationErrors(_0xb3d037,_0x30ffcb){const _0x4d2794=a42_0x106f25,_0x536a88=_0xb3d037['errors'][_0x4d2794(0x101)](_0x256352=>_0x256352[_0x4d2794(0x112)]===_0x4d2794(0xe3)?{..._0x256352,'message':_0x4d2794(0xee)}:_0x256352),_0x2d5cec=[..._0x30ffcb,..._0x536a88];return{'ok':_0x2d5cec[_0x4d2794(0x120)]===0x0,'errors':_0x2d5cec,'warnings':_0xb3d037[_0x4d2794(0x11f)]};}function aggregateValidationReports(_0x3d942f){const _0x148223=a42_0x106f25,_0x80c4b9=_0x3d942f[_0x148223(0x103)](_0x47bd67=>_0x47bd67[_0x148223(0x111)]===undefined?_0x47bd67['report'][_0x148223(0x100)]:_0x47bd67[_0x148223(0xeb)]['errors']['map'](_0x29afdd=>({..._0x29afdd,'path':prefixRegistryIssuePath(_0x47bd67['registryIndex'],_0x29afdd[_0x148223(0x122)])}))),_0x45e6c6=_0x3d942f['flatMap'](_0x2f19a1=>_0x2f19a1['registryIndex']===undefined?_0x2f19a1[_0x148223(0xeb)][_0x148223(0x11f)]:_0x2f19a1[_0x148223(0xeb)][_0x148223(0x11f)][_0x148223(0x101)](_0x48ff34=>({..._0x48ff34,'path':prefixRegistryIssuePath(_0x2f19a1['registryIndex'],_0x48ff34[_0x148223(0x122)])})));return{'ok':_0x80c4b9['length']===0x0,'errors':_0x80c4b9,'warnings':_0x45e6c6};}function prefixRegistryIssuePath(_0x4bcb80,_0x21c572){const _0x53c7d2=a42_0x106f25;if(_0x21c572==='$')return _0x53c7d2(0x131)+_0x4bcb80+_0x53c7d2(0x114);if(_0x21c572['startsWith']('$.'))return _0x53c7d2(0x131)+_0x4bcb80+_0x53c7d2(0x114)+_0x21c572[_0x53c7d2(0xf1)](0x1);if(_0x21c572[_0x53c7d2(0x133)]('$['))return _0x53c7d2(0x131)+_0x4bcb80+_0x53c7d2(0x114)+_0x21c572[_0x53c7d2(0xf1)](0x1);return _0x53c7d2(0x131)+_0x4bcb80+_0x53c7d2(0x10d)+_0x21c572;}function isServiceRegistryLike(_0x405093){const _0x3e7401=a42_0x106f25;return isObjectRecord(_0x405093)&&_0x405093[_0x3e7401(0x113)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x405093[_0x3e7401(0x12b)]);}function isObjectRecord(_0x5a5d1f){const _0x247868=a42_0x106f25;return Boolean(_0x5a5d1f)&&typeof _0x5a5d1f===_0x247868(0x11d)&&!Array[_0x247868(0xfc)](_0x5a5d1f);}function emptyServiceRegistryInspection(_0x5e36d8,_0x2035aa,_0x21a849){return{'registryPath':_0x5e36d8,'exists':_0x21a849,'status':_0x2035aa,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x294a7b){const _0x42c7a0=a42_0x106f25,_0x1dcdd5=_0x294a7b[_0x42c7a0(0xe4)],_0x1373ef=_0x1dcdd5['commands'][_0x42c7a0(0x101)](_0x2db177=>({'path':_0x2db177[_0x42c7a0(0x12f)],'description':_0x2db177[_0x42c7a0(0x135)],'risk':_0x2db177[_0x42c7a0(0x107)],'targetKind':_0x2db177[_0x42c7a0(0x115)][_0x42c7a0(0xed)],'targetCommand':_0x2db177['target'][_0x42c7a0(0x119)]}));return{'serviceCode':_0x294a7b[_0x42c7a0(0x12e)],'name':_0x1dcdd5[_0x42c7a0(0x10c)][_0x42c7a0(0x11b)],'description':_0x1dcdd5[_0x42c7a0(0x10c)][_0x42c7a0(0x135)],'version':_0x294a7b[_0x42c7a0(0x11a)],'importedAt':_0x294a7b[_0x42c7a0(0x11e)],'source':_0x294a7b[_0x42c7a0(0x136)],'commandCount':_0x1373ef[_0x42c7a0(0x120)],'commands':_0x1373ef};}function a42_0x3579(){const _0x3a8bf6=['22996DkvWxh','Unsupported\x20service\x20registry\x20schemaVersion:\x20','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','join','CliError','parse','findIndex','service.json','32514700KZFzqh','isArray','trim','empty','sort','errors','map','commandCount','flatMap','push','file','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','risk','missing','utf8','filePath','invalid','service','].manifest.','905saLPEq','string','1xXdpzG','registryIndex','message','schemaVersion','].manifest','target','validation','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','now','command','version','name','62344ZarQtC','object','importedAt','warnings','length','5237250JTUhmQ','path','sourceHash','stringify','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','sha256','manifest','localeCompare','Local\x20service\x20not\x20found:\x20','update','services','885261FedSli','5726817KjCcaP','serviceCode','cliPath','toISOString','$.services[','splice','startsWith','registry','description','source','1248178VqPGfx','manifests','homeDir','updatedAt','find','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','normalizedManifest','ENOENT','Invalid\x20service\x20manifest\x20JSON:\x20','digest','Remove\x20or\x20migrate\x20','Cannot\x20write\x20service\x20registry:\x20','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','report','reduce','kind','bff\x20target\x20requires\x20functionName.','code','Service\x20manifest\x20file\x20not\x20found:\x20','slice','175IkTYvu'];a42_0x3579=function(){return _0x3a8bf6;};return a42_0x3579();}function sha256(_0x2a0e5d){const _0x4d73ba=a42_0x106f25;return createHash(_0x4d73ba(0x126))[_0x4d73ba(0x12a)](_0x2a0e5d)[_0x4d73ba(0xe7)]('hex');}
|
|
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 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x52e2bd=a43_0x57eb;(function(_0x28b199,_0x36d144){const _0x380b07=a43_0x57eb,_0x280872=_0x28b199();while(!![]){try{const _0x188170=parseInt(_0x380b07(0x1b1))/0x1+parseInt(_0x380b07(0x1be))/0x2+parseInt(_0x380b07(0x1b0))/0x3+-parseInt(_0x380b07(0x1a5))/0x4*(-parseInt(_0x380b07(0x1af))/0x5)+parseInt(_0x380b07(0x1ae))/0x6*(-parseInt(_0x380b07(0x1b7))/0x7)+parseInt(_0x380b07(0x1b2))/0x8*(-parseInt(_0x380b07(0x1a8))/0x9)+-parseInt(_0x380b07(0x19d))/0xa*(parseInt(_0x380b07(0x1b8))/0xb);if(_0x188170===_0x36d144)break;else _0x280872['push'](_0x280872['shift']());}catch(_0x51efe3){_0x280872['push'](_0x280872['shift']());}}}(a43_0x2a03,0x1efd2));function a43_0x2a03(){const _0x5bc482=['type','Refusing\x20to\x20overwrite\x20symlink:\x20','12348CrCrId','skillName','validation','isSymbolicLink','trim','map','78PEzokz','50lRofJN','246642IYZhWR','41854AAcacB','416cMksRr','WRITE','isDirectory','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','skillDir','87409GJUaLp','1595xWukBz','write','target','Created\x20local\x20Skill\x20draft\x20','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','path','854vbwNBs','str','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','220hUmiXS','rendered','Skill\x20directory\x20already\x20exists:\x20','skill','bool','force','files','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','95720uFYBsT'];a43_0x2a03=function(){return _0x5bc482;};return a43_0x2a03();}import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';function a43_0x57eb(_0x2f8900,_0x4f418c){_0x2f8900=_0x2f8900-0x19d;const _0x2a03e6=a43_0x2a03();let _0x57eb51=_0x2a03e6[_0x2f8900];return _0x57eb51;}import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0x52e2bd(0x1a0),'command':'create','description':a43_0x52e2bd(0x1a4),'risk':a43_0x52e2bd(0x1b9),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x3aee07){const _0x1b9612=a43_0x52e2bd,_0x45b4cb=buildSkillCreatePlan(_0x3aee07[_0x1b9612(0x1bf)]('name'),_0x3aee07[_0x1b9612(0x1bf)]('type'),_0x3aee07[_0x1b9612(0x1bf)](_0x1b9612(0x1ba)));return{'method':_0x1b9612(0x1b3),'url':_0x45b4cb['skillDir'],'body':{'skillName':_0x45b4cb[_0x1b9612(0x19e)][_0x1b9612(0x1a9)],'type':_0x45b4cb[_0x1b9612(0x19e)]['type'],'selfContained':!![],'files':_0x45b4cb[_0x1b9612(0x19e)][_0x1b9612(0x1a3)][_0x1b9612(0x1ad)](_0x5c75f4=>_0x5c75f4[_0x1b9612(0x1bd)])},'description':_0x1b9612(0x1b5)};},async 'execute'(_0x4a0b17){const _0x131798=a43_0x52e2bd,_0x4a484d=buildSkillCreatePlan(_0x4a0b17['str']('name'),_0x4a0b17['str'](_0x131798(0x1a6)),_0x4a0b17[_0x131798(0x1bf)]('target'));return writeSkillDraft(_0x4a484d,_0x4a0b17[_0x131798(0x1a1)](_0x131798(0x1a2))),{'ok':!![],'data':{'skillName':_0x4a484d[_0x131798(0x19e)][_0x131798(0x1a9)],'type':_0x4a484d[_0x131798(0x19e)][_0x131798(0x1a6)],'dir':_0x4a484d[_0x131798(0x1b6)],'files':_0x4a484d[_0x131798(0x19e)][_0x131798(0x1a3)][_0x131798(0x1ad)](_0x37cd59=>_0x37cd59[_0x131798(0x1bd)])},'message':_0x131798(0x1bb)+_0x4a484d[_0x131798(0x19e)][_0x131798(0x1a9)]};}};function buildSkillCreatePlan(_0x488459,_0x1af805,_0x3a1fdc){const _0x2761f5=a43_0x52e2bd,_0x1560bd=_0x1af805[_0x2761f5(0x1ac)](),_0x3fc182=renderSkillTemplate({'skillName':_0x488459,'type':_0x1560bd});!_0x1560bd&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0x29db39=resolve(normalizeSkillTarget(_0x3a1fdc));return{'rendered':_0x3fc182,'targetRoot':_0x29db39,'skillDir':resolve(_0x29db39,_0x3fc182[_0x2761f5(0x1a9)])};}function normalizeSkillTarget(_0x5b1922){return(_0x5b1922||DEFAULT_SKILL_TARGET)['trim']()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x86ef6d,_0x3e603d){const _0x2417f9=a43_0x52e2bd;if(existsSync(_0x86ef6d['skillDir'])){const _0x5c57f5=lstatSync(_0x86ef6d[_0x2417f9(0x1b6)]);if(!_0x5c57f5[_0x2417f9(0x1b4)]()||_0x5c57f5[_0x2417f9(0x1ab)]())throw CliErrors['validation'](_0x2417f9(0x1c0)+_0x86ef6d['skillDir']);if(!_0x3e603d)throw CliErrors[_0x2417f9(0x1aa)](_0x2417f9(0x19f)+_0x86ef6d[_0x2417f9(0x1b6)],_0x2417f9(0x1bc));}for(const _0x5ac9d4 of _0x86ef6d[_0x2417f9(0x19e)][_0x2417f9(0x1a3)]){const _0x4691d4=resolve(_0x86ef6d[_0x2417f9(0x1b6)],_0x5ac9d4['path']),_0x1905ae=dirname(_0x4691d4);mkdirSync(_0x1905ae,{'recursive':!![]});if(existsSync(_0x4691d4)&&lstatSync(_0x4691d4)[_0x2417f9(0x1ab)]())throw CliErrors['validation'](_0x2417f9(0x1a7)+_0x4691d4);writeFileSync(_0x4691d4,_0x5ac9d4['content'],'utf8');}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a44_0x22860e=a44_0x1020;(function(_0x227c8e,_0x36e5c8){const _0x446a6c=a44_0x1020,_0x2d4839=_0x227c8e();while(!![]){try{const _0x12b5b4=parseInt(_0x446a6c(0xed))/0x1*(parseInt(_0x446a6c(0xef))/0x2)+-parseInt(_0x446a6c(0xfb))/0x3*(parseInt(_0x446a6c(0xfc))/0x4)+-parseInt(_0x446a6c(0xd4))/0x5+-parseInt(_0x446a6c(0xeb))/0x6+-parseInt(_0x446a6c(0xe7))/0x7*(-parseInt(_0x446a6c(0xf0))/0x8)+-parseInt(_0x446a6c(0xf9))/0x9+parseInt(_0x446a6c(0xf2))/0xa;if(_0x12b5b4===_0x36e5c8)break;else _0x2d4839['push'](_0x2d4839['shift']());}catch(_0x10beaf){_0x2d4839['push'](_0x2d4839['shift']());}}}(a44_0x1e4c,0xf0253));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x39973a){const _0xf489be=a44_0x1020,_0xeb9418=_0x39973a[_0xf489be(0xf6)](_0xf489be(0xe6))['trim'](),_0x942d9e=_0x39973a['str'](_0xf489be(0xe9))[_0xf489be(0xcf)](),_0x4f4d2e=_0x39973a[_0xf489be(0xf6)](_0xf489be(0xd5));if(!_0xeb9418||!_0x942d9e||_0x4f4d2e!==_0xf489be(0xd6)&&_0x4f4d2e!==_0xf489be(0xfa))throw CliErrors['validation']('--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.');return{'skillCode':_0xeb9418,'version':_0x942d9e,'scope':_0x4f4d2e};}function a44_0x1020(_0x2c1e83,_0x25d665){_0x2c1e83=_0x2c1e83-0xcf;const _0x1e4c0b=a44_0x1e4c();let _0x10206d=_0x1e4c0b[_0x2c1e83];return _0x10206d;}function a44_0x1e4c(){const _0x1cf070=['found','read','Skill\x20diagram\x20for\x20','8915950LdDoBh','scope','personal','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','unchanged','test','skillCode','diagram-validate','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','Created','source-fingerprint',';\x20first\x20write\x20expects\x20revision\x20','num','appCode',';\x20next\x20write\x20expects\x20revision\x20','expectedDiagramRevision','diagram-push','diagram-show','skill-code','13958LAxVop','validation','version','action','8945562SQqqvE','isInteger','14mYFawV','write','273338fOsHOq','7688VPCLmH','created','36054730LffLcO','Found\x20Skill\x20diagram\x20for\x20','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','skill','str','Updated','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','11879316HLmROd','company','2859DkFNob','7796mwBgGa','trim','expected-diagram-revision'];a44_0x1e4c=function(){return _0x1cf070;};return a44_0x1e4c();}async function readDiagramWriteInput(_0x219c72){const _0x14d1e5=a44_0x1020,_0x46ddc8=_0x219c72[_0x14d1e5(0xe0)](_0x14d1e5(0xd0)),_0x2fbaf4=_0x219c72[_0x14d1e5(0xf6)](_0x14d1e5(0xde))[_0x14d1e5(0xcf)]();if(!Number[_0x14d1e5(0xec)](_0x46ddc8)||_0x46ddc8<0x0)throw CliErrors[_0x14d1e5(0xe8)]('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/[_0x14d1e5(0xd9)](_0x2fbaf4))throw CliErrors[_0x14d1e5(0xe8)](_0x14d1e5(0xdc));return{'expectedDiagramRevision':_0x46ddc8,'sourceFingerprint':_0x2fbaf4,'diagram':await readRequiredSkillDiagram(_0x219c72['str']('diagram-file'))};}export const diagramValidateCommand={'service':a44_0x22860e(0xf5),'command':a44_0x22860e(0xdb),'description':a44_0x22860e(0xd7),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x2a83fc){const _0x21014a=a44_0x22860e,_0x1042d4=readDiagramTarget(_0x2a83fc),_0x29f62a=await validateRuntimeSkillVersionDiagram(_0x2a83fc[_0x21014a(0xe1)],_0x1042d4[_0x21014a(0xda)],_0x1042d4['version'],_0x1042d4['scope'],await readDiagramWriteInput(_0x2a83fc));return{'ok':!![],'data':_0x29f62a,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0x1042d4[_0x21014a(0xda)]+'@'+_0x1042d4[_0x21014a(0xe9)]+'.'};}};export const diagramPushCommand={'service':'skill','command':a44_0x22860e(0xe4),'description':'Create\x20or\x20replace\x20the\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':a44_0x22860e(0xee),'flags':WRITE_FLAGS,async 'execute'(_0x10e1c4){const _0x5901d6=a44_0x22860e,_0x868450=readDiagramTarget(_0x10e1c4),_0x3a0500=await putRuntimeSkillVersionDiagram(_0x10e1c4['appCode'],_0x868450[_0x5901d6(0xda)],_0x868450[_0x5901d6(0xe9)],_0x868450['scope'],await readDiagramWriteInput(_0x10e1c4));return{'ok':!![],'data':_0x3a0500,'message':_0x3a0500['action']===_0x5901d6(0xd8)?_0x5901d6(0xd3)+_0x868450[_0x5901d6(0xda)]+'@'+_0x868450['version']+'\x20is\x20unchanged.':(_0x3a0500[_0x5901d6(0xea)]===_0x5901d6(0xf1)?_0x5901d6(0xdd):_0x5901d6(0xf7))+'\x20Skill\x20diagram\x20for\x20'+_0x868450['skillCode']+'@'+_0x868450[_0x5901d6(0xe9)]+'.'};}};export const diagramShowCommand={'service':a44_0x22860e(0xf5),'command':a44_0x22860e(0xe5),'description':a44_0x22860e(0xf4),'risk':a44_0x22860e(0xd2),'flags':TARGET_FLAGS,async 'execute'(_0x2cc834){const _0x147593=a44_0x22860e,_0xf4b413=readDiagramTarget(_0x2cc834),_0x1737fd=await getRuntimeSkillVersionDiagram(_0x2cc834[_0x147593(0xe1)],_0xf4b413[_0x147593(0xda)],_0xf4b413[_0x147593(0xe9)],_0xf4b413['scope']);return{'ok':!![],'data':_0x1737fd,'message':_0x1737fd[_0x147593(0xd1)]?_0x147593(0xf3)+_0xf4b413[_0x147593(0xda)]+'@'+_0xf4b413[_0x147593(0xe9)]+_0x147593(0xe2)+_0x1737fd[_0x147593(0xe3)]+'.':_0x147593(0xf8)+_0xf4b413[_0x147593(0xda)]+'@'+_0xf4b413[_0x147593(0xe9)]+_0x147593(0xdf)+_0x1737fd[_0x147593(0xe3)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x207e10=a45_0x2b7c;(function(_0x539ccb,_0x33dcb2){const _0x32dcc4=a45_0x2b7c,_0x91c3b8=_0x539ccb();while(!![]){try{const _0x1a6a7d=parseInt(_0x32dcc4(0x139))/0x1*(-parseInt(_0x32dcc4(0x129))/0x2)+-parseInt(_0x32dcc4(0x134))/0x3*(parseInt(_0x32dcc4(0x10d))/0x4)+parseInt(_0x32dcc4(0x12b))/0x5*(parseInt(_0x32dcc4(0x12e))/0x6)+parseInt(_0x32dcc4(0x10c))/0x7+-parseInt(_0x32dcc4(0x110))/0x8*(-parseInt(_0x32dcc4(0x123))/0x9)+-parseInt(_0x32dcc4(0x113))/0xa*(parseInt(_0x32dcc4(0x119))/0xb)+-parseInt(_0x32dcc4(0x132))/0xc*(parseInt(_0x32dcc4(0x135))/0xd);if(_0x1a6a7d===_0x33dcb2)break;else _0x91c3b8['push'](_0x91c3b8['shift']());}catch(_0x521f1d){_0x91c3b8['push'](_0x91c3b8['shift']());}}}(a45_0x3544,0xe9eb7));import{CliErrors}from'../../../errors.js';function a45_0x2b7c(_0x3b9c48,_0x588d82){_0x3b9c48=_0x3b9c48-0x10c;const _0x354438=a45_0x3544();let _0x2b7c8e=_0x354438[_0x3b9c48];return _0x2b7c8e;}import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';function a45_0x3544(){const _0x45115e=['push','444CORXdB','../../../skills/runtime-skill-sync.js','23631MINAlX','420953nszZKO','filter','install','skillRoots','359EnPBtt','envName','4008389ktdQms','212Sjwtvs','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','skillCode','877328WAMEJO','action','flatMap','10XcitQZ','str','skipped','all','trim','map','6286621wRpBlt','scope','bool','removed','appCode','updated','reduce','unchanged','company','\x20personal\x20and\x20','81PLyGgY','personal','length','version','authRequired','write','426zDAcfP','\x20company\x20Skill(s).','50oZiVgC','skill','includes','997242OwhZpP','project','production'];a45_0x3544=function(){return _0x45115e;};return a45_0x3544();}import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a45_0x207e10(0x12c),'command':a45_0x207e10(0x137),'description':'Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','risk':a45_0x207e10(0x128),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x3d5c8d){return syncRuntimeSkills(_0x3d5c8d);}};async function syncRuntimeSkills(_0x1a029e){const _0x21b969=a45_0x207e10,{downloadRuntimeSkillPackage:_0x3abe80,listRuntimeSkills:_0x442dc2}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x52387d,materializeRuntimeSkill:_0x1447ab,pruneStaleRuntimeSkillCache:_0x3144bd,pruneStaleRuntimeSkillLinks:_0xeaed6d,resolveRuntimeSkillInstallTarget:_0x1185ef}=await import(_0x21b969(0x133)),_0x333ac7=_0x1a029e[_0x21b969(0x114)]('code'),_0xad459b=normalizeSyncScopes(_0x1a029e[_0x21b969(0x114)](_0x21b969(0x11a))),_0x17f4e6=_0x1a029e[_0x21b969(0x13a)]??_0x21b969(0x130),_0xe39719=_0x1a029e['accessKey'],_0x4e385a=_0x1a029e[_0x21b969(0x11b)]('force');if(!_0xe39719)throw CliErrors[_0x21b969(0x127)](_0x21b969(0x10e));const _0x4a7725=_0x1185ef(_0x1a029e['appCode'],_0x1a029e['bool']('project')?'project':'global'),_0x245bcf=_0x1185ef(_0x1a029e[_0x21b969(0x11d)],_0x4a7725[_0x21b969(0x11a)]===_0x21b969(0x12f)?'global':_0x21b969(0x12f)),_0x2761a3=await Promise[_0x21b969(0x116)](_0xad459b[_0x21b969(0x118)](_0x43af0f=>_0x442dc2({'appCode':_0x1a029e[_0x21b969(0x11d)],'scope':_0x43af0f,'code':_0x333ac7[_0x21b969(0x117)]()||undefined}))),_0xac4d70=_0xad459b[_0x21b969(0x12d)](_0x21b969(0x124))?_0x2761a3[_0x21b969(0x112)]((_0x31091c,_0x3e2fdb)=>_0xad459b[_0x3e2fdb]===_0x21b969(0x124)?_0x31091c[_0x21b969(0x124)]:[]):[],_0x3b7cec=_0xad459b[_0x21b969(0x12d)](_0x21b969(0x121))?_0x2761a3[_0x21b969(0x112)]((_0x44d28c,_0x173174)=>_0xad459b[_0x173174]===_0x21b969(0x121)?_0x44d28c['company']:[]):[],_0x4d9355=new Set([..._0xac4d70[_0x21b969(0x118)](_0x455486=>_0x455486['skillCode']?.[_0x21b969(0x117)]())[_0x21b969(0x136)](_0x90273b=>Boolean(_0x90273b)),..._0x3b7cec['map'](_0x58c8c4=>_0x58c8c4['skillCode']?.[_0x21b969(0x117)]())['filter'](_0x35533a=>Boolean(_0x35533a))]),_0x955d22=_0x333ac7[_0x21b969(0x117)]()?[_0x333ac7[_0x21b969(0x117)]()]:undefined,_0x172361=_0xad459b[_0x21b969(0x125)]===0x2&&_0xad459b[_0x21b969(0x12d)]('personal')&&_0xad459b[_0x21b969(0x12d)](_0x21b969(0x121)),_0x2c8eea=_0x172361?_0xeaed6d(_0x4a7725,_0x4d9355,_0x955d22):[],_0x2bd534=_0x3144bd({'env':_0x17f4e6,'accessKey':_0xe39719,'appCode':_0x1a029e[_0x21b969(0x11d)],'activeSkillCodes':_0x4d9355,'pruneSkillCodes':_0x955d22,'scopes':_0xad459b,'protectedLinkRoots':_0x245bcf['skillRoots']}),_0xe6894e=[];for(const _0x371f66 of _0xac4d70){_0xe6894e[_0x21b969(0x131)](_0x1447ab(_0x371f66,_0x21b969(0x124),{'env':_0x17f4e6,'accessKey':_0xe39719,'appCode':_0x1a029e[_0x21b969(0x11d)],'force':_0x4e385a,'packageBytes':await downloadSkillPackage(_0x371f66,_0x21b969(0x124),_0x1a029e['appCode'],_0x3abe80)}));}for(const _0x1d1dc9 of _0x3b7cec){_0xe6894e[_0x21b969(0x131)](_0x1447ab(_0x1d1dc9,_0x21b969(0x121),{'env':_0x17f4e6,'accessKey':_0xe39719,'appCode':_0x1a029e[_0x21b969(0x11d)],'force':_0x4e385a,'packageBytes':await downloadSkillPackage(_0x1d1dc9,_0x21b969(0x121),_0x1a029e[_0x21b969(0x11d)],_0x3abe80)}));}const _0x26f054=_0x52387d(_0xe6894e,_0x4a7725),_0x57b2d5=countLinkActions(_0x26f054);return{'ok':!![],'data':{'appCode':_0x1a029e[_0x21b969(0x11d)],..._0x4a7725['scope']===_0x21b969(0x12f)?{'installTarget':{'scope':_0x4a7725[_0x21b969(0x11a)],'skillRoots':[..._0x4a7725[_0x21b969(0x138)]]}}:{},'personal':_0xac4d70[_0x21b969(0x125)],'company':_0x3b7cec['length'],'materialized':_0xe6894e[_0x21b969(0x125)],'links':{'total':_0x26f054[_0x21b969(0x125)],'created':_0x57b2d5['created']??0x0,'updated':_0x57b2d5[_0x21b969(0x11e)]??0x0,'unchanged':_0x57b2d5[_0x21b969(0x120)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x2c8eea['filter'](_0x5b35f8=>_0x5b35f8[_0x21b969(0x111)]==='removed')[_0x21b969(0x125)],'cacheDirs':_0x2bd534[_0x21b969(0x136)](_0x3f53bf=>_0x3f53bf[_0x21b969(0x111)]===_0x21b969(0x11c))[_0x21b969(0x125)],'skipped':[..._0x2c8eea,..._0x2bd534][_0x21b969(0x136)](_0x1128bc=>_0x1128bc['action']===_0x21b969(0x115))[_0x21b969(0x125)]},'skills':{'personal':_0xac4d70[_0x21b969(0x118)](summarizeRuntimeSkill),'company':_0x3b7cec[_0x21b969(0x118)](summarizeRuntimeSkill)}},'message':'Installed\x20'+_0xac4d70[_0x21b969(0x125)]+_0x21b969(0x122)+_0x3b7cec[_0x21b969(0x125)]+_0x21b969(0x12a)};}async function downloadSkillPackage(_0x3562ac,_0x530efc,_0x202bd3,_0x40da3d){const _0x1fd81d=a45_0x207e10,_0x20b980=_0x3562ac[_0x1fd81d(0x126)]?.[_0x1fd81d(0x117)]();return _0x20b980?_0x40da3d(_0x530efc,_0x3562ac['skillCode'],_0x202bd3,_0x20b980):_0x40da3d(_0x530efc,_0x3562ac[_0x1fd81d(0x10f)],_0x202bd3);}function countLinkActions(_0x462657){const _0x511520=a45_0x207e10;return _0x462657[_0x511520(0x11f)]((_0x3e0060,_0x4570fa)=>{return _0x3e0060[_0x4570fa['action']]=(_0x3e0060[_0x4570fa['action']]??0x0)+0x1,_0x3e0060;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x4cea5d=a46_0x44d0;(function(_0x4e0a86,_0x45d1a4){const _0x3ecc63=a46_0x44d0,_0x4985bd=_0x4e0a86();while(!![]){try{const _0x4359b2=parseInt(_0x3ecc63(0x167))/0x1+parseInt(_0x3ecc63(0x169))/0x2+-parseInt(_0x3ecc63(0x15b))/0x3+-parseInt(_0x3ecc63(0x164))/0x4+parseInt(_0x3ecc63(0x15f))/0x5+-parseInt(_0x3ecc63(0x151))/0x6*(-parseInt(_0x3ecc63(0x160))/0x7)+parseInt(_0x3ecc63(0x153))/0x8*(-parseInt(_0x3ecc63(0x16e))/0x9);if(_0x4359b2===_0x45d1a4)break;else _0x4985bd['push'](_0x4985bd['shift']());}catch(_0x3871c9){_0x4985bd['push'](_0x4985bd['shift']());}}}(a46_0x3dcc,0xf3a0c));function a46_0x3dcc(){const _0x4b686d=['\x20remote\x20Skill(s).','Listed\x20','1444455ohOVmd','envName','2112358LfjtNq','builtin','personal','length','remote','4671NqEKzP','appCode','local','skill','\x20local\x20Skill(s).','project','23784oogadS','bool','10448igCkoT','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','map','../../../skills/runtime-skill-sync.js','production','company','accessKey','filter','3521994hSMvwG','authRequired','str','trim','4114715oIeGxf','931sTkeZQ','read','scope','list','4004308QSyJHP'];a46_0x3dcc=function(){return _0x4b686d;};return a46_0x3dcc();}import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';function a46_0x44d0(_0x44b7e4,_0x228987){_0x44b7e4=_0x44b7e4-0x14d;const _0x3dcc30=a46_0x3dcc();let _0x44d08f=_0x3dcc30[_0x44b7e4];return _0x44d08f;}export const listCommand={'service':a46_0x4cea5d(0x14e),'command':a46_0x4cea5d(0x163),'description':a46_0x4cea5d(0x154),'risk':a46_0x4cea5d(0x161),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x95069){const _0x28a0c7=a46_0x4cea5d,_0x20ce4c=_0x95069[_0x28a0c7(0x15d)]('code'),_0x899eba=normalizeListScope(_0x95069[_0x28a0c7(0x15d)](_0x28a0c7(0x162)));if(_0x95069[_0x28a0c7(0x152)]('local')){const _0x52c2d4=_0x95069[_0x28a0c7(0x159)];if(!_0x52c2d4)throw CliErrors[_0x28a0c7(0x15c)]();const {listLocalRuntimeSkills:_0x45a370,resolveRuntimeSkillInstallTarget:_0x336533}=await import(_0x28a0c7(0x156)),_0xf95310=_0x336533(_0x95069[_0x28a0c7(0x16f)],_0x95069['bool']('project')?_0x28a0c7(0x150):'global'),_0x365065=_0x45a370({'env':_0x95069[_0x28a0c7(0x168)]??_0x28a0c7(0x157),'accessKey':_0x52c2d4,'appCode':_0x95069[_0x28a0c7(0x16f)],'scopes':listScopeToRuntimeScopes(_0x899eba),'code':_0x20ce4c['trim']()||undefined},_0xf95310),_0x3d5f94=groupLocalRuntimeSkills(_0x365065);return{'ok':!![],'data':{'appCode':_0x95069[_0x28a0c7(0x16f)],'source':_0x28a0c7(0x14d),..._0xf95310[_0x28a0c7(0x162)]===_0x28a0c7(0x150)?{'installScope':_0xf95310[_0x28a0c7(0x162)]}:{},'scope':_0x899eba,'total':_0x365065[_0x28a0c7(0x16c)],'personal':_0x3d5f94[_0x28a0c7(0x16b)][_0x28a0c7(0x16c)],'company':_0x3d5f94[_0x28a0c7(0x158)][_0x28a0c7(0x16c)],'items':_0x365065[_0x28a0c7(0x155)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x3d5f94['personal'][_0x28a0c7(0x155)](summarizeLocalRuntimeSkill),'company':_0x3d5f94['company'][_0x28a0c7(0x155)](summarizeLocalRuntimeSkill)}},'message':_0x28a0c7(0x166)+_0x365065[_0x28a0c7(0x16c)]+_0x28a0c7(0x14f)};}const {listRuntimeSkills:_0x2cb26f}=await import('../../../core/api-client.js'),_0x31a589=await _0x2cb26f({'appCode':_0x95069[_0x28a0c7(0x16f)],'scope':listScopeToRemoteScope(_0x899eba),'code':_0x20ce4c[_0x28a0c7(0x15e)]()||undefined}),_0x3ddae1=shouldListScope(_0x899eba,_0x28a0c7(0x16b))?_0x31a589[_0x28a0c7(0x16b)]??[]:[],_0x478a88=shouldListScope(_0x899eba,_0x28a0c7(0x158))?_0x31a589[_0x28a0c7(0x158)]??[]:[],_0x409f47=[..._0x3ddae1,..._0x478a88];return{'ok':!![],'data':{'appCode':_0x95069[_0x28a0c7(0x16f)],'source':_0x28a0c7(0x16d),'scope':_0x899eba,'total':_0x409f47[_0x28a0c7(0x16c)],'personal':_0x3ddae1[_0x28a0c7(0x16c)],'company':_0x478a88[_0x28a0c7(0x16c)],'items':_0x409f47[_0x28a0c7(0x155)](summarizeRuntimeSkill),'skills':{'personal':_0x3ddae1['map'](summarizeRuntimeSkill),'company':_0x478a88['map'](summarizeRuntimeSkill)}},'message':_0x28a0c7(0x166)+_0x409f47[_0x28a0c7(0x16c)]+_0x28a0c7(0x165)};}};function groupLocalRuntimeSkills(_0x1abd1b){const _0x4dec25=a46_0x4cea5d;return{'personal':_0x1abd1b[_0x4dec25(0x15a)](_0x29f3df=>_0x29f3df[_0x4dec25(0x162)]===_0x4dec25(0x16b)),'company':_0x1abd1b[_0x4dec25(0x15a)](_0x4b3c0a=>_0x4b3c0a[_0x4dec25(0x162)]===_0x4dec25(0x158)),'builtin':_0x1abd1b[_0x4dec25(0x15a)](_0x200538=>_0x200538[_0x4dec25(0x162)]===_0x4dec25(0x16a))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0x10c6(_0x5a2b8,_0x4ece4a){_0x5a2b8=_0x5a2b8-0xe5;const _0x437da3=a47_0x437d();let _0x10c657=_0x437da3[_0x5a2b8];return _0x10c657;}const a47_0x175c41=a47_0x10c6;(function(_0x58efc7,_0x46d763){const _0x6d57b5=a47_0x10c6,_0x3d6277=_0x58efc7();while(!![]){try{const _0x153d0d=parseInt(_0x6d57b5(0xeb))/0x1*(-parseInt(_0x6d57b5(0xe8))/0x2)+parseInt(_0x6d57b5(0xed))/0x3+-parseInt(_0x6d57b5(0xee))/0x4*(parseInt(_0x6d57b5(0xf1))/0x5)+parseInt(_0x6d57b5(0xe7))/0x6+-parseInt(_0x6d57b5(0xec))/0x7*(parseInt(_0x6d57b5(0xea))/0x8)+-parseInt(_0x6d57b5(0xe5))/0x9+-parseInt(_0x6d57b5(0xf2))/0xa*(-parseInt(_0x6d57b5(0xe6))/0xb);if(_0x153d0d===_0x46d763)break;else _0x3d6277['push'](_0x3d6277['shift']());}catch(_0xe782fa){_0x3d6277['push'](_0x3d6277['shift']());}}}(a47_0x437d,0x7935a));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_0x175c41(0xe9),'command':a47_0x175c41(0xef),'description':'Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20scope\x20or\x20submit\x20company\x20scope\x20for\x20review','risk':a47_0x175c41(0xf0),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};function a47_0x437d(){const _0x5250a3=['1957896Bcidhf','20PlcsvW','push','write','785405CKaoIj','13031750WJLmMa','1745217MbEeta','11bYzbme','4391232cyApNG','4tDMXSa','skill','458872UwvXvG','405187SsoWSj','49WxEkPn'];a47_0x437d=function(){return _0x5250a3;};return a47_0x437d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x5be67c=a48_0x805a;(function(_0x2260da,_0x40c4cb){const _0xcfb163=a48_0x805a,_0x4b2b51=_0x2260da();while(!![]){try{const _0x4dbaca=-parseInt(_0xcfb163(0x1b6))/0x1+parseInt(_0xcfb163(0x1bf))/0x2+parseInt(_0xcfb163(0x1ba))/0x3*(parseInt(_0xcfb163(0x1ae))/0x4)+-parseInt(_0xcfb163(0x1b5))/0x5+-parseInt(_0xcfb163(0x1b9))/0x6+parseInt(_0xcfb163(0x1be))/0x7+parseInt(_0xcfb163(0x1b4))/0x8;if(_0x4dbaca===_0x40c4cb)break;else _0x4b2b51['push'](_0x4b2b51['shift']());}catch(_0x43ebf0){_0x4b2b51['push'](_0x4b2b51['shift']());}}}(a48_0xac6c,0xd8f20));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a48_0x805a(_0x42000d,_0x10131c){_0x42000d=_0x42000d-0x1ad;const _0xac6c86=a48_0xac6c();let _0x805a1=_0xac6c86[_0x42000d];return _0x805a1;}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';function a48_0xac6c(){const _0x451afa=['217326ItDGcB','bool','skill','7174788RypqZe','100347Lajrqz','str','warnings','read','7607544NqxQJL','620320cwWaje','errors','136FAmQtK','strict','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','Skill\x20validation\x20passed.','dir','validate','11391216KMXESZ','8281940RKPwOS'];a48_0xac6c=function(){return _0x451afa;};return a48_0xac6c();}export const validateCommand={'service':a48_0x5be67c(0x1b8),'command':a48_0x5be67c(0x1b3),'description':a48_0x5be67c(0x1b0),'risk':a48_0x5be67c(0x1bd),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x4090ab){const _0x4b145b=a48_0x5be67c,_0x2e881f=_0x4090ab[_0x4b145b(0x1b7)](_0x4b145b(0x1af)),_0x446172=validateSkillDirectory(_0x4090ab[_0x4b145b(0x1bb)](_0x4b145b(0x1b2)),{'strict':_0x2e881f});return throwIfSkillValidationFailed(_0x446172,_0x2e881f),{'ok':!![],'data':{'dir':_0x446172[_0x4b145b(0x1b2)],'type':_0x446172['type'],'errors':_0x446172[_0x4b145b(0x1ad)],'warnings':_0x446172[_0x4b145b(0x1bc)]},'message':_0x4b145b(0x1b1)};}};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RuntimeSkillDiagramSubmission } from "../../core/api-client.js";
|
|
2
|
+
/** Reads and validates the direct Mermaid payload required by Skill publication. */
|
|
3
|
+
export declare function readRequiredSkillDiagram(path: string): Promise<RuntimeSkillDiagramSubmission>;
|
|
4
|
+
/** Canonicalizes line endings and validates the source with Mermaid's official parser. */
|
|
5
|
+
export declare function validateAndCanonicalizeMermaid(source: string): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0xcbd2da,_0x4b826d){const _0x1b9724=a49_0x1eed,_0x54b095=_0xcbd2da();while(!![]){try{const _0x2f5a80=parseInt(_0x1b9724(0x1be))/0x1+-parseInt(_0x1b9724(0x1c8))/0x2+parseInt(_0x1b9724(0x1c3))/0x3*(parseInt(_0x1b9724(0x1b3))/0x4)+parseInt(_0x1b9724(0x1bb))/0x5*(-parseInt(_0x1b9724(0x1ca))/0x6)+-parseInt(_0x1b9724(0x1c2))/0x7+-parseInt(_0x1b9724(0x1c1))/0x8*(parseInt(_0x1b9724(0x1b8))/0x9)+parseInt(_0x1b9724(0x1c0))/0xa;if(_0x2f5a80===_0x4b826d)break;else _0x54b095['push'](_0x54b095['shift']());}catch(_0x463f16){_0x54b095['push'](_0x54b095['shift']());}}}(a49_0x88c6,0xd0e5a));function a49_0x1eed(_0x11c5b6,_0x2b3205){_0x11c5b6=_0x11c5b6-0x1b3;const _0x88c64e=a49_0x88c6();let _0x1eedcc=_0x88c64e[_0x11c5b6];return _0x1eedcc;}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(_0x26aa9c){const _0x16cd84=a49_0x1eed,_0x325ee7=_0x26aa9c[_0x16cd84(0x1c4)]();if(!_0x325ee7)throw CliErrors['validation'](_0x16cd84(0x1bd),'Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.');let _0x25d2b;if(_0x325ee7==='-')try{_0x25d2b=readFileSync(0x0,_0x16cd84(0x1c9));}catch{throw CliErrors[_0x16cd84(0x1c7)](_0x16cd84(0x1bf));}else{const _0x167d0a=resolve(_0x325ee7);if(!existsSync(_0x167d0a))throw CliErrors[_0x16cd84(0x1c7)]('Mermaid\x20flowchart\x20file\x20not\x20found:\x20'+_0x167d0a);if(!statSync(_0x167d0a)[_0x16cd84(0x1b7)]())throw CliErrors[_0x16cd84(0x1c7)]('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x167d0a);_0x25d2b=readFileSync(_0x167d0a,_0x16cd84(0x1c9));}return{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x25d2b)};}export async function validateAndCanonicalizeMermaid(_0x16de02){const _0x49f1a8=a49_0x1eed,_0x42a4c0=_0x16de02[_0x49f1a8(0x1b4)](/\r\n/g,'\x0a')[_0x49f1a8(0x1b4)](/\r/g,'\x0a')[_0x49f1a8(0x1b4)](/\n+$/,'')+'\x0a';try{const _0x29bb09=await loadMermaidApi();await _0x29bb09['parse'](_0x42a4c0);}catch{throw diagramValidationError();}return _0x42a4c0;}function a49_0x88c6(){const _0x53c9df=['defineProperties','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','isFile','963PEcFwh','window','mermaid','4145mdFUye','default','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','182960thCeEA','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','41679640DOIgAA','43240YRvWMY','10213630VZVicC','3851823RHdgeb','trim','document','Mermaid\x20syntax\x20validation\x20failed.','validation','2736290kausDW','utf8','9942sKKByd','4uYTQko','replace'];a49_0x88c6=function(){return _0x53c9df;};return a49_0x88c6();}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x4b12eb=a49_0x1eed;if(!(_0x4b12eb(0x1b9)in globalThis)||!(_0x4b12eb(0x1c5)in globalThis)){const _0x581a33=new JSDOM('');Object[_0x4b12eb(0x1b5)](globalThis,{'window':{'configurable':!![],'value':_0x581a33[_0x4b12eb(0x1b9)]},'document':{'configurable':!![],'value':_0x581a33[_0x4b12eb(0x1b9)][_0x4b12eb(0x1c5)]}});}return(await import(_0x4b12eb(0x1ba)))[_0x4b12eb(0x1bc)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x4dc70a=a49_0x1eed;return CliErrors[_0x4dc70a(0x1c7)](_0x4dc70a(0x1c6),_0x4dc70a(0x1b6));}
|
|
@@ -5,6 +5,12 @@ export declare const PUSH_SCOPE_FLAG: FlagDef;
|
|
|
5
5
|
export declare const LIST_SCOPE_FLAG: FlagDef;
|
|
6
6
|
export declare const LOCAL_FLAG: FlagDef;
|
|
7
7
|
export declare const DIR_FLAG: FlagDef;
|
|
8
|
+
export declare const DIAGRAM_FILE_FLAG: FlagDef;
|
|
9
|
+
export declare const DIAGRAM_SKILL_CODE_FLAG: FlagDef;
|
|
10
|
+
export declare const DIAGRAM_VERSION_FLAG: FlagDef;
|
|
11
|
+
export declare const DIAGRAM_SCOPE_FLAG: FlagDef;
|
|
12
|
+
export declare const SOURCE_FINGERPRINT_FLAG: FlagDef;
|
|
13
|
+
export declare const EXPECTED_DIAGRAM_REVISION_FLAG: FlagDef;
|
|
8
14
|
export declare const CREATE_NAME_FLAG: FlagDef;
|
|
9
15
|
export declare const TYPE_FLAG: FlagDef;
|
|
10
16
|
export declare const TARGET_FLAG: FlagDef;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x45c3ef=a50_0x50d4;(function(_0xada909,_0x2233f7){const _0x14655e=a50_0x50d4,_0x2b3340=_0xada909();while(!![]){try{const _0x5292cc=-parseInt(_0x14655e(0x1d9))/0x1*(parseInt(_0x14655e(0x1bc))/0x2)+parseInt(_0x14655e(0x1ce))/0x3+parseInt(_0x14655e(0x1bf))/0x4+-parseInt(_0x14655e(0x1de))/0x5+parseInt(_0x14655e(0x1d4))/0x6+-parseInt(_0x14655e(0x1c7))/0x7+parseInt(_0x14655e(0x1d2))/0x8;if(_0x5292cc===_0x2233f7)break;else _0x2b3340['push'](_0x2b3340['shift']());}catch(_0x184ab9){_0x2b3340['push'](_0x2b3340['shift']());}}}(a50_0x419b,0x4c43d));import{DEFAULT_SKILL_TARGET,SKILL_NAME_PATTERN,SKILL_TYPES}from'./templates.js';export const CODE_FLAG={'name':'code','type':'string','description':a50_0x45c3ef(0x1b6)};export const SCOPE_FLAG={'name':a50_0x45c3ef(0x1dd),'type':'string','description':a50_0x45c3ef(0x1c3),'enum':[a50_0x45c3ef(0x1b8),a50_0x45c3ef(0x1b7),a50_0x45c3ef(0x1cc)]};export const PUSH_SCOPE_FLAG={'name':a50_0x45c3ef(0x1dd),'type':'string','description':a50_0x45c3ef(0x1d8),'default':'personal','enum':[a50_0x45c3ef(0x1b7),'company']};function a50_0x50d4(_0x5605ec,_0x1bbbb6){_0x5605ec=_0x5605ec-0x1b5;const _0x419b6b=a50_0x419b();let _0x50d446=_0x419b6b[_0x5605ec];return _0x50d446;}export const LIST_SCOPE_FLAG={'name':'scope','type':a50_0x45c3ef(0x1b5),'description':a50_0x45c3ef(0x1d3),'enum':[a50_0x45c3ef(0x1b8),a50_0x45c3ef(0x1b7),a50_0x45c3ef(0x1cc)]};export const LOCAL_FLAG={'name':a50_0x45c3ef(0x1d5),'type':a50_0x45c3ef(0x1db),'description':a50_0x45c3ef(0x1c9)};export const DIR_FLAG={'name':a50_0x45c3ef(0x1c8),'type':'string','required':!![],'description':a50_0x45c3ef(0x1cb)};export const DIAGRAM_FILE_FLAG={'name':'diagram-file','type':a50_0x45c3ef(0x1b5),'required':!![],'description':a50_0x45c3ef(0x1bd)};export const DIAGRAM_SKILL_CODE_FLAG={'name':'skill-code','type':a50_0x45c3ef(0x1b5),'required':!![],'description':a50_0x45c3ef(0x1c0)};export const DIAGRAM_VERSION_FLAG={'name':a50_0x45c3ef(0x1dc),'type':'string','required':!![],'description':a50_0x45c3ef(0x1ba)};export const DIAGRAM_SCOPE_FLAG={'name':a50_0x45c3ef(0x1dd),'type':a50_0x45c3ef(0x1b5),'required':!![],'enum':['personal','company'],'description':'Exact\x20Skill\x20scope:\x20personal\x20or\x20company'};export const SOURCE_FINGERPRINT_FLAG={'name':a50_0x45c3ef(0x1b9),'type':a50_0x45c3ef(0x1b5),'required':!![],'description':a50_0x45c3ef(0x1d1),'pattern':{'regex':/^sha256:[0-9a-f]{64}$/,'description':a50_0x45c3ef(0x1cf)}};export const EXPECTED_DIAGRAM_REVISION_FLAG={'name':'expected-diagram-revision','type':a50_0x45c3ef(0x1d6),'required':!![],'description':a50_0x45c3ef(0x1c4)};export const CREATE_NAME_FLAG={'name':a50_0x45c3ef(0x1cd),'type':'string','required':!![],'description':'Skill\x20name\x20using\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','pattern':{'regex':SKILL_NAME_PATTERN,'description':a50_0x45c3ef(0x1d7)}};export const TYPE_FLAG={'name':'type','type':a50_0x45c3ef(0x1b5),'description':'Skill\x20template\x20type:\x20pass\x20read\x20or\x20write\x20explicitly\x20(omission\x20is\x20deprecated)','enum':[...SKILL_TYPES]};export const TARGET_FLAG={'name':a50_0x45c3ef(0x1da),'type':a50_0x45c3ef(0x1b5),'description':a50_0x45c3ef(0x1c1),'default':DEFAULT_SKILL_TARGET};export const FORCE_FLAG={'name':a50_0x45c3ef(0x1c2),'type':a50_0x45c3ef(0x1db),'description':a50_0x45c3ef(0x1bb)};function a50_0x419b(){const _0x478767=['Use\x20the\x20current\x20project\x27s\x20.agents/skills\x20instead\x20of\x20user-level\x20Agent\x20Skill\x20directories','3300150IyXijb','dir','Read\x20CLI-managed\x20local\x20Skill\x20cache\x20and\x20links\x20instead\x20of\x20remote\x20lists','Confirm\x20reviewed\x20personal\x20or\x20company\x20Skill\x20publish\x20warnings','Local\x20Skill\x20directory\x20containing\x20SKILL.md','company','name','1604928ztgBvr','a\x20lowercase\x20sha256:<64\x20hex\x20characters>\x20fingerprint','confirm-warnings','Server-reported\x20SkillVersion\x20source\x20fingerprint','4576056Ibcfdt','Skill\x20list\x20scope:\x20all,\x20personal,\x20or\x20company','2565630sSOhXc','local','number','lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens','Skill\x20push\x20target\x20scope:\x20personal\x20saves\x20immediately,\x20company\x20submits\x20a\x20new\x20version\x20for\x20review','462475TYAbLU','target','boolean','version','scope','1719660dQFQGW','string','Only\x20target\x20a\x20specific\x20runtime\x20Skill\x20code','personal','all','source-fingerprint','Exact\x20Skill\x20version\x20whose\x20diagram\x20is\x20being\x20managed','Overwrite\x20generated\x20or\x20CLI-managed\x20Skill\x20files\x20when\x20the\x20target\x20already\x20exists','2LbNLQp','UTF-8\x20Mermaid\x20flowchart\x20file;\x20use\x20-\x20to\x20read\x20from\x20standard\x20input','project','222600YPILWw','Exact\x20Skill\x20code\x20whose\x20version\x20diagram\x20is\x20being\x20managed','Directory\x20that\x20will\x20contain\x20the\x20generated\x20Skill\x20directory','force','Skill\x20sync\x20scope:\x20all\x20(personal/company),\x20personal,\x20or\x20company','Expected\x20current\x20diagram\x20revision;\x20use\x200\x20for\x20the\x20first\x20diagram','strict'];a50_0x419b=function(){return _0x478767;};return a50_0x419b();}export const PROJECT_TARGET_FLAG={'name':a50_0x45c3ef(0x1be),'type':a50_0x45c3ef(0x1db),'description':a50_0x45c3ef(0x1c6)};export const CONFIRM_WARNINGS_FLAG={'name':a50_0x45c3ef(0x1d0),'type':a50_0x45c3ef(0x1db),'description':a50_0x45c3ef(0x1ca)};export const STRICT_FLAG={'name':a50_0x45c3ef(0x1c5),'type':a50_0x45c3ef(0x1db),'description':'Compatibility\x20flag;\x20no\x20extra\x20checks\x20are\x20enabled'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50e596,_0x19778b){const _0x33ed31=a51_0x42e4,_0x1dcc8d=_0x50e596();while(!![]){try{const _0x42fa9b=parseInt(_0x33ed31(0x16b))/0x1*(-parseInt(_0x33ed31(0x161))/0x2)+-parseInt(_0x33ed31(0x16a))/0x3*(parseInt(_0x33ed31(0x164))/0x4)+parseInt(_0x33ed31(0x162))/0x5*(parseInt(_0x33ed31(0x166))/0x6)+parseInt(_0x33ed31(0x163))/0x7+parseInt(_0x33ed31(0x168))/0x8+-parseInt(_0x33ed31(0x169))/0x9*(parseInt(_0x33ed31(0x167))/0xa)+-parseInt(_0x33ed31(0x165))/0xb;if(_0x42fa9b===_0x19778b)break;else _0x1dcc8d['push'](_0x1dcc8d['shift']());}catch(_0x1bcb68){_0x1dcc8d['push'](_0x1dcc8d['shift']());}}}(a51_0x539e,0xb7b94));import{createCommand}from'./commands/create.js';import{diagramPushCommand,diagramShowCommand,diagramValidateCommand}from'./commands/diagram.js';function a51_0x42e4(_0x573dde,_0x1f3669){_0x573dde=_0x573dde-0x161;const _0x539e3e=a51_0x539e();let _0x42e409=_0x539e3e[_0x573dde];return _0x42e409;}function a51_0x539e(){const _0x48d0b9=['10883408wHYjTB','83511mhsUQO','713301IVmMjc','1951iNTzEL','60wqIeDp','5DGohKl','4059104GhnPBv','20RsuYbr','2282192cRQdmW','8004936awHYFg','1150DrNZQF'];a51_0x539e=function(){return _0x48d0b9;};return a51_0x539e();}import{installCommand}from'./commands/install.js';import{listCommand}from'./commands/list.js';import{pushCommand}from'./commands/push.js';import{validateCommand}from'./commands/validate.js';export const skillDefinitions=[installCommand,createCommand,validateCommand,listCommand,pushCommand,diagramValidateCommand,diagramPushCommand,diagramShowCommand];
|