@lovrabet/lovrabet-cli 2.2.4 → 2.2.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.d.ts +7 -0
- 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.d.ts +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a58_0x3bb7cb=a58_0x5c8b;(function(_0x2c4afa,_0x26364f){const _0x2e36e4=a58_0x5c8b,_0x2e7129=_0x2c4afa();while(!![]){try{const _0x17d6ce=parseInt(_0x2e36e4(0xcc))/0x1+parseInt(_0x2e36e4(0xc9))/0x2*(parseInt(_0x2e36e4(0xcf))/0x3)+-parseInt(_0x2e36e4(0xc5))/0x4+parseInt(_0x2e36e4(0xce))/0x5*(parseInt(_0x2e36e4(0xcb))/0x6)+-parseInt(_0x2e36e4(0xcd))/0x7*(-parseInt(_0x2e36e4(0xca))/0x8)+-parseInt(_0x2e36e4(0xc3))/0x9+-parseInt(_0x2e36e4(0xc2))/0xa*(parseInt(_0x2e36e4(0xc7))/0xb);if(_0x17d6ce===_0x26364f)break;else _0x2e7129['push'](_0x2e7129['shift']());}catch(_0x382bb8){_0x2e7129['push'](_0x2e7129['shift']());}}}(a58_0x17e3,0x88860));function a58_0x17e3(){const _0x435790=['1072146iwKZdm','35LSTnsh','38815eqjcdb','9jbCZpS','12680820NrtNqb','5412609Akzqtu','read','1079264gPMXkq','Export\x20machine-readable\x20command\x20schema\x20(JSON)','11ooufci','export','582642mYvyhb','1017512cREhkW','90WmQTlz'];a58_0x17e3=function(){return _0x435790;};return a58_0x17e3();}function a58_0x5c8b(_0x25ae66,_0x3efed2){_0x25ae66=_0x25ae66-0xc2;const _0x17e3c4=a58_0x17e3();let _0x5c8b5e=_0x17e3c4[_0x25ae66];return _0x5c8b5e;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x4e7c2c){const _0x1ba1f7=await buildSchemaPayload();return{'ok':!![],'data':_0x1ba1f7};}export const schemaDefinition={'service':'schema','command':a58_0x3bb7cb(0xc8),'description':a58_0x3bb7cb(0xc6),'risk':a58_0x3bb7cb(0xc4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x28175f,_0x26b1cd){const _0x25f9b3=a59_0x56e5,_0x5477ed=_0x28175f();while(!![]){try{const _0x1f17b9=parseInt(_0x25f9b3(0xd0))/0x1+-parseInt(_0x25f9b3(0xb6))/0x2+-parseInt(_0x25f9b3(0xbc))/0x3+-parseInt(_0x25f9b3(0xba))/0x4+parseInt(_0x25f9b3(0xdb))/0x5+parseInt(_0x25f9b3(0xc7))/0x6+parseInt(_0x25f9b3(0xcf))/0x7;if(_0x1f17b9===_0x26b1cd)break;else _0x5477ed['push'](_0x5477ed['shift']());}catch(_0x2d8fd4){_0x5477ed['push'](_0x5477ed['shift']());}}}(a59_0xc87c,0x8946a));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(_0x4819b4,_0x6eed16){const _0x5636c3=a59_0x56e5,_0x4e75f6=listLocalServiceTrees();let _0x56b92d;for(const _0x20a77f of _0x4e75f6){const _0x5e178c=matchServiceTreeCommand(_0x20a77f,_0x4819b4);if(!_0x5e178c)continue;(!_0x56b92d||_0x5e178c['command']['fullPath'][_0x5636c3(0xda)]>_0x56b92d[_0x5636c3(0x102)][_0x5636c3(0xb9)][_0x5636c3(0xda)])&&(_0x56b92d={'tree':_0x20a77f,'command':_0x5e178c[_0x5636c3(0x102)],'remainingArgs':_0x5e178c[_0x5636c3(0xee)]});}if(!_0x56b92d)return undefined;const _0x440f76={..._0x6eed16};return applyAppBinding(_0x56b92d[_0x5636c3(0xec)],_0x56b92d[_0x5636c3(0x102)],_0x440f76),{'definition':buildDynamicCommandDefinition(_0x56b92d[_0x5636c3(0xec)],_0x56b92d[_0x5636c3(0x102)]),'args':_0x56b92d[_0x5636c3(0xee)],'flags':_0x440f76,'tree':_0x56b92d[_0x5636c3(0xec)],'command':_0x56b92d[_0x5636c3(0x102)]};}export function generateDynamicServiceHelp(_0x5401f5){const _0x5c73e8=a59_0x56e5,_0x40500e=listLocalServiceTrees()[_0x5c73e8(0xc8)](_0xad60f0=>_0xad60f0[_0x5c73e8(0xef)][_0x5c73e8(0xb7)]===_0x5401f5);if(!_0x40500e)return undefined;const _0x413ff9=[CLI_BIN_NAME+'\x20'+_0x5401f5+_0x5c73e8(0xe1),'',_0x40500e[_0x5c73e8(0xef)][_0x5c73e8(0xce)]||_0x5401f5,_0x40500e['service'][_0x5c73e8(0xf3)]?'\x20\x20'+_0x40500e[_0x5c73e8(0xef)]['description']:'','',_0x5c73e8(0xf1),..._0x40500e[_0x5c73e8(0x10a)][_0x5c73e8(0xfc)](_0x4bcfd3=>{const _0x38d9b4=_0x5c73e8,_0x125302=_0x4bcfd3[_0x38d9b4(0xb9)][_0x38d9b4(0xcb)](0x1)[_0x38d9b4(0x109)]('\x20'),_0x3862b4=_0x4bcfd3[_0x38d9b4(0xde)]==='read'?'':'\x20['+_0x4bcfd3['risk']+']';return'\x20\x20'+_0x125302[_0x38d9b4(0x107)](0x18)+'\x20'+(_0x4bcfd3[_0x38d9b4(0xf3)]||'')+_0x3862b4;}),'','Use\x20`'+CLI_BIN_NAME+_0x5c73e8(0xaf)+_0x5401f5+_0x5c73e8(0xf0)][_0x5c73e8(0x101)](Boolean);return _0x413ff9['join']('\x0a');}export function listDynamicServiceEntries(){const _0x3bbdd1=a59_0x56e5;return listLocalServices()[_0x3bbdd1(0xfc)](_0x5f14cd=>{const _0x630390=_0x3bbdd1,_0x301a98=_0x5f14cd['normalizedManifest'];return{'service':_0x301a98[_0x630390(0xef)]['code'],'label':_0x301a98[_0x630390(0xef)][_0x630390(0xce)]||_0x301a98[_0x630390(0xef)][_0x630390(0xb7)],'commands':_0x301a98[_0x630390(0x10a)][_0x630390(0xfc)](_0x3ee95f=>({'command':dynamicCommandName(_0x3ee95f),'description':_0x3ee95f[_0x630390(0xf3)]||'Run\x20service\x20command\x20'+_0x3ee95f['cliPath'],'tag':riskTag(_0x3ee95f[_0x630390(0xde)])}))};});}export function getDynamicServiceEntry(_0x47f81a){const _0x3b0ff9=a59_0x56e5;return listDynamicServiceEntries()[_0x3b0ff9(0xc8)](_0x44ae6a=>_0x44ae6a[_0x3b0ff9(0xef)]===_0x47f81a);}export function listDynamicServiceDefinitions(_0x3414a6){const _0x32cbbe=a59_0x56e5;return listLocalServiceTrees()[_0x32cbbe(0x101)](_0x181e20=>!_0x3414a6||_0x181e20[_0x32cbbe(0xef)]['code']===_0x3414a6)[_0x32cbbe(0xc9)](_0x1b88ba=>_0x1b88ba[_0x32cbbe(0x10a)][_0x32cbbe(0xfc)](_0x35c8a2=>buildDynamicCommandDefinition(_0x1b88ba,_0x35c8a2)));}export function getDynamicServiceDefinitions(_0x22a6ef){const _0x298a03=listDynamicServiceDefinitions(_0x22a6ef);return _0x298a03['length']>0x0?_0x298a03:undefined;}export function findDynamicServiceDefinition(_0x16b078,_0x4346cf){const _0x4fc0a1=a59_0x56e5;return listDynamicServiceDefinitions(_0x16b078)[_0x4fc0a1(0xc8)](_0x4f6326=>_0x4f6326['command']===_0x4346cf);}export function buildDynamicCommandDefinition(_0x5bd6e4,_0x3321b2){const _0x7aa1ff=a59_0x56e5;return{'service':_0x5bd6e4[_0x7aa1ff(0xef)][_0x7aa1ff(0xb7)],'command':dynamicCommandName(_0x3321b2),'description':_0x3321b2[_0x7aa1ff(0xf3)]||'Run\x20service\x20command\x20'+_0x3321b2[_0x7aa1ff(0xd2)],'risk':_0x3321b2[_0x7aa1ff(0xde)],..._0x3321b2[_0x7aa1ff(0xde)]===_0x7aa1ff(0xdd)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x3321b2)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3321b2[_0x7aa1ff(0xac)][_0x7aa1ff(0xfc)](_0x46b0e8=>({'name':_0x46b0e8[_0x7aa1ff(0xce)],'description':_0x46b0e8['description']||_0x46b0e8[_0x7aa1ff(0xce)],'required':_0x46b0e8[_0x7aa1ff(0xfa)]})),'flags':_0x3321b2[_0x7aa1ff(0xb1)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3321b2),async 'dryRun'(_0x7d8a68){const _0x23ea53=_0x7aa1ff,_0x59d388=await compilePlan(_0x3321b2,_0x7d8a68);return{'method':_0x23ea53(0xcd),'url':_0x3321b2[_0x23ea53(0xd2)],'body':{'target':targetPreview(_0x59d388),'params':_0x59d388[_0x23ea53(0xfe)]},'description':_0x23ea53(0xe9)+_0x3321b2[_0x23ea53(0xd2)]};},async 'execute'(_0x25d32c){const _0x3bd043=_0x7aa1ff,_0x503eea=await compilePlan(_0x3321b2,_0x25d32c),_0x235bcf=Date['now'](),_0x147df4=await executePlan(_0x503eea,_0x3321b2,_0x25d32c),_0x54727f=Date['now']()-_0x235bcf;return{'ok':!![],'data':{'service':_0x5bd6e4[_0x3bd043(0xef)],'command':_0x3321b2[_0x3bd043(0xd2)],'target':targetPreview(_0x503eea),'result':_0x147df4,'elapsed':_0x54727f},'message':'Service\x20command\x20'+_0x3321b2[_0x3bd043(0xd2)]+_0x3bd043(0xbf)+_0x54727f+'ms'};}};}function buildDynamicConfirmationDescription(_0x3b443e){const _0x287836=a59_0x56e5,_0x20d8dc=_0x3b443e[_0x287836(0xf3)]||_0x3b443e['cliPath'],_0x3656aa=_0x3b443e[_0x287836(0xde)]==='high-risk-write'?'该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。':_0x287836(0xc1);return _0x287836(0xe5)+_0x20d8dc+'”。'+_0x3656aa;}function dynamicCommandName(_0xb39c0f){const _0x197ba3=a59_0x56e5;return _0xb39c0f[_0x197ba3(0xb9)][_0x197ba3(0xcb)](0x1)[_0x197ba3(0x109)]('\x20');}function riskTag(_0x338f90){const _0x43fe06=a59_0x56e5;return _0x338f90===_0x43fe06(0xdd)?'':_0x43fe06(0xd3)+_0x338f90+']';}function flagToCommandFlag(_0x248a81){const _0x1a95e5=a59_0x56e5;return{'name':_0x248a81['cliName'],'type':_0x248a81[_0x1a95e5(0xd6)]===_0x1a95e5(0xb0)?_0x1a95e5(0xdf):_0x248a81['type'],'description':_0x248a81[_0x1a95e5(0xf3)]||_0x248a81[_0x1a95e5(0xce)],'required':_0x248a81[_0x1a95e5(0xfa)],'default':isPrimitiveFlagDefault(_0x248a81['default'])?_0x248a81[_0x1a95e5(0xc5)]:undefined,'enum':_0x248a81['enum']};}function a59_0x56e5(_0x12d084,_0x142960){_0x12d084=_0x12d084-0xac;const _0xc87c16=a59_0xc87c();let _0x56e5eb=_0xc87c16[_0x12d084];return _0x56e5eb;}async function compilePlan(_0x57fd48,_0x55f239){const _0x210b72=a59_0x56e5;return compileServiceTreeCommand(_0x57fd48,{'flags':_0x55f239['rawFlags'],'args':_0x55f239[_0x210b72(0xac)],'context':await buildServiceContext(_0x57fd48,_0x55f239)});}async function buildServiceContext(_0x4091c6,_0x1c1598){const _0x36fcac=a59_0x56e5,_0x372467={'appCode':_0x1c1598['appCode'],'env':_0x1c1598[_0x36fcac(0xc4)],'envName':_0x1c1598[_0x36fcac(0xc4)]};if(!usesRuntimeContext(_0x4091c6))return _0x372467;const _0x376d12=await getLoginUserInfo(),_0x5d9f49=pickFirst(_0x376d12[_0x36fcac(0xe7)],_0x376d12['id']);return{..._0x372467,'user':_0x376d12,'userId':_0x5d9f49,'id':_0x376d12['id'],'username':pickFirst(_0x376d12[_0x36fcac(0x104)],_0x376d12[_0x36fcac(0xf6)],_0x376d12['loginName']),'userName':_0x376d12[_0x36fcac(0xf6)],'nickname':pickFirst(_0x376d12[_0x36fcac(0xc0)],_0x376d12[_0x36fcac(0xed)]),'nickName':_0x376d12[_0x36fcac(0xed)],'tenantCode':_0x376d12[_0x36fcac(0xd9)],'employeeId':_0x376d12['employeeId']};}function usesRuntimeContext(_0x18abf3){const _0x23e304=a59_0x56e5;return _0x18abf3[_0x23e304(0xbb)]['some'](_0x2efca1=>typeof _0x2efca1[_0x23e304(0x108)]===_0x23e304(0xdf)&&(_0x2efca1[_0x23e304(0x108)][_0x23e304(0xf9)](_0x23e304(0xd8))||_0x2efca1[_0x23e304(0x108)]['startsWith'](_0x23e304(0xd5))));}function pickFirst(..._0x41fdd8){const _0x3ac0af=a59_0x56e5;return _0x41fdd8[_0x3ac0af(0xc8)](_0x22831d=>_0x22831d!==undefined&&_0x22831d!==null);}async function executePlan(_0x2048f5,_0x1be6e5,_0x4a3b5c){const _0x2ce59f=a59_0x56e5;if(_0x2048f5[_0x2ce59f(0xb2)]===_0x2ce59f(0x103)){const _0x50c81a=await resolveDatasetCode(_0x2048f5,_0x1be6e5,_0x4a3b5c);return executeData(_0x50c81a,_0x2048f5[_0x2ce59f(0x102)],_0x2048f5['params']);}if(_0x2048f5[_0x2ce59f(0xb2)]==='sql'){if(!_0x2048f5[_0x2ce59f(0xe0)])throw CliErrors['validation']('Service\x20command\x20'+_0x1be6e5[_0x2ce59f(0xd2)]+_0x2ce59f(0xe6));return executeSdkSql(_0x2048f5[_0x2ce59f(0xe0)],normalizeScalarParams(_0x2048f5[_0x2ce59f(0xfe)]));}if(_0x2048f5[_0x2ce59f(0xb2)]==='bff'){const _0x3a4411=_0x2048f5[_0x2ce59f(0xc3)]||_0x2048f5[_0x2ce59f(0x105)]||(_0x2048f5['bffId']==null?'':String(_0x2048f5[_0x2ce59f(0xea)]));if(!_0x3a4411)throw CliErrors['validation'](_0x2ce59f(0xb8)+_0x1be6e5[_0x2ce59f(0xd2)]+_0x2ce59f(0xe8));return executeSdkBff(_0x3a4411,_0x2048f5[_0x2ce59f(0xfe)]);}throw CliErrors['validation'](_0x2ce59f(0xf8)+_0x2048f5[_0x2ce59f(0xb2)]);}function a59_0xc87c(){const _0x38039b=['Service\x20command\x20','fullPath','4283024AQnoZp','mapTo','61887zXlgSE','validation','appBindings','\x20completed\x20in\x20','nickname','该命令被清单标记为写入,可能修改业务数据或服务状态。','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','scriptName','envName','default','dbtableConfig','1394916SoPjHZ','find','flatMap','\x20\x20\x20\x20datatable:\x20','slice','operator','SERVICE_TREE','name','10375869tqpYEM','2843AXhkYt','push','cliPath','\x20\x20[','appCode','ctx.','type','\x20\x20\x20\x20command:\x20','context.','tenantCode','length','4317820fzTvYs','appRef','read','risk','string','sqlCode','\x20<command>\x20[flags]','target','appcode','app','将通过\x20Service\x20Tree\x20执行“','\x20requires\x20target.sqlCode.','userId','\x20requires\x20target.functionName.','Preview\x20dynamic\x20service\x20command:\x20','bffId','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','tree','nickName','remainingArgs','service','`\x20to\x20inspect\x20the\x20manifest.','Commands:','\x20\x20\x20\x20sqlCode:\x20','description','\x20\x20MAP\x20TO','datatable','userName','\x20\x20\x20\x20','Unsupported\x20service\x20target\x20kind:\x20','startsWith','required','Cannot\x20resolve\x20datatable\x20\x22','map','trim','params','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','env','filter','command','data','username','bffCode','number','padEnd','source','join','commands','args','\x20\x20\x20\x20datasetCode:\x20','fromEntries','\x20service\x20detail\x20--service\x20','json','flags','kind','\x20->\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','datasetCode','1854986VzETUz','code'];a59_0xc87c=function(){return _0x38039b;};return a59_0xc87c();}async function resolveDatasetCode(_0x426f19,_0x56c00a,_0xeae0d5){const _0x217aaf=a59_0x56e5;if(_0x426f19[_0x217aaf(0xb5)])return _0x426f19[_0x217aaf(0xb5)];if(!_0x426f19['datatable'])throw CliErrors[_0x217aaf(0xbd)](_0x217aaf(0xb8)+_0x56c00a[_0x217aaf(0xd2)]+_0x217aaf(0xff));const _0x3fb377=await listDatasets(_0xeae0d5[_0x217aaf(0xd4)]),_0x2d511f=_0x3fb377['find'](_0x2fc41f=>_0x2fc41f[_0x217aaf(0xc6)]?.['tableName']===_0x426f19[_0x217aaf(0xf5)]);if(!_0x2d511f?.[_0x217aaf(0xb7)])throw CliErrors['validation'](_0x217aaf(0xfb)+_0x426f19[_0x217aaf(0xf5)]+_0x217aaf(0xeb)+_0xeae0d5[_0x217aaf(0xd4)]+'.',_0x217aaf(0xc2));return _0x2d511f[_0x217aaf(0xb7)];}function applyAppBinding(_0x19d951,_0x51a60b,_0x1c6f64){const _0x4a828f=a59_0x56e5,_0x4031d6=_0x51a60b['target'][_0x4a828f(0xdc)];if(!_0x4031d6)return;const _0x13adc1=_0x19d951[_0x4a828f(0xbe)][_0x4031d6];if(!_0x13adc1)throw CliErrors[_0x4a828f(0xbd)]('Unknown\x20appRef\x20\x22'+_0x4031d6+'\x22\x20in\x20service\x20command\x20'+_0x51a60b[_0x4a828f(0xd2)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x330cb3=_0x13adc1[_0x4a828f(0xe3)]||_0x13adc1[_0x4a828f(0xd4)];_0x330cb3&&!hasText(_0x1c6f64[_0x4a828f(0xe3)])&&(_0x1c6f64['appcode']=_0x330cb3),_0x13adc1['app']&&!hasText(_0x1c6f64[_0x4a828f(0xe4)])&&!hasText(_0x1c6f64[_0x4a828f(0xe3)])&&(_0x1c6f64[_0x4a828f(0xe4)]=_0x13adc1[_0x4a828f(0xe4)]),_0x13adc1[_0x4a828f(0x100)]&&!hasText(_0x1c6f64['env'])&&(_0x1c6f64['env']=_0x13adc1['env']);}function renderDynamicCommandHelp(_0x98d907){const _0x453090=a59_0x56e5,_0x58a458=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x453090(0xb4)+_0x98d907[_0x453090(0xe2)][_0x453090(0xb2)],_0x453090(0xd7)+_0x98d907['target'][_0x453090(0x102)]];if(_0x98d907[_0x453090(0xe2)][_0x453090(0xb5)])_0x58a458[_0x453090(0xd1)](_0x453090(0xad)+_0x98d907[_0x453090(0xe2)][_0x453090(0xb5)]);if(_0x98d907[_0x453090(0xe2)][_0x453090(0xf5)])_0x58a458['push'](_0x453090(0xca)+_0x98d907[_0x453090(0xe2)][_0x453090(0xf5)]);if(_0x98d907[_0x453090(0xe2)][_0x453090(0xe0)])_0x58a458[_0x453090(0xd1)](_0x453090(0xf2)+_0x98d907[_0x453090(0xe2)][_0x453090(0xe0)]);if(_0x98d907[_0x453090(0xe2)]['scriptName'])_0x58a458[_0x453090(0xd1)]('\x20\x20\x20\x20functionName:\x20'+_0x98d907[_0x453090(0xe2)][_0x453090(0xc3)]);if(_0x98d907['mapTo'][_0x453090(0xda)]>0x0){_0x58a458[_0x453090(0xd1)]('',_0x453090(0xf4));for(const _0x5d2d0b of _0x98d907['mapTo']){_0x58a458[_0x453090(0xd1)](_0x453090(0xf7)+(_0x5d2d0b[_0x453090(0x108)]||'const')+_0x453090(0xb3)+_0x5d2d0b[_0x453090(0xe2)]+(_0x5d2d0b[_0x453090(0xcc)]?'.'+_0x5d2d0b[_0x453090(0xcc)]:''));}}return _0x58a458[_0x453090(0x109)]('\x0a');}function targetPreview(_0x76c6dd){const _0x54cae7=a59_0x56e5;return{'kind':_0x76c6dd[_0x54cae7(0xb2)],'command':_0x76c6dd[_0x54cae7(0x102)],'appRef':_0x76c6dd[_0x54cae7(0xdc)],'datasetCode':_0x76c6dd[_0x54cae7(0xb5)],'datatable':_0x76c6dd[_0x54cae7(0xf5)],'sqlCode':_0x76c6dd['sqlCode'],'bffCode':_0x76c6dd['bffCode'],'bffId':_0x76c6dd[_0x54cae7(0xea)],'functionName':_0x76c6dd[_0x54cae7(0xc3)]};}function normalizeScalarParams(_0x432b6c){const _0x4e062b=a59_0x56e5;return Object[_0x4e062b(0xae)](Object['entries'](_0x432b6c)[_0x4e062b(0x101)](([,_0xca3b41])=>typeof _0xca3b41===_0x4e062b(0xdf)||typeof _0xca3b41===_0x4e062b(0x106)));}function hasText(_0x24a3bf){const _0x27033e=a59_0x56e5;return typeof _0x24a3bf===_0x27033e(0xdf)&&_0x24a3bf[_0x27033e(0xfd)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x4a2555){const _0x3c2aa0=a59_0x56e5;return _0x4a2555===undefined||typeof _0x4a2555==='string'||typeof _0x4a2555===_0x3c2aa0(0x106)||typeof _0x4a2555==='boolean';}
|
|
1
|
+
(function(_0x5717f2,_0x273f89){const _0x50a958=a59_0x64bd,_0xad183=_0x5717f2();while(!![]){try{const _0x4f3845=parseInt(_0x50a958(0x1af))/0x1+-parseInt(_0x50a958(0x1b5))/0x2+-parseInt(_0x50a958(0x181))/0x3*(-parseInt(_0x50a958(0x1a5))/0x4)+parseInt(_0x50a958(0x172))/0x5*(parseInt(_0x50a958(0x18c))/0x6)+-parseInt(_0x50a958(0x199))/0x7+parseInt(_0x50a958(0x176))/0x8+-parseInt(_0x50a958(0x1a0))/0x9;if(_0x4f3845===_0x273f89)break;else _0xad183['push'](_0xad183['shift']());}catch(_0xf26a58){_0xad183['push'](_0xad183['shift']());}}}(a59_0x15ad,0x6e74b));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(_0x25f535,_0x53fbf8){const _0x5e0fea=a59_0x64bd,_0x5f2dd7=listLocalServiceTrees();let _0x2af9c1;for(const _0x31eb57 of _0x5f2dd7){const _0xd311a2=matchServiceTreeCommand(_0x31eb57,_0x25f535);if(!_0xd311a2)continue;(!_0x2af9c1||_0xd311a2[_0x5e0fea(0x19c)]['fullPath'][_0x5e0fea(0x188)]>_0x2af9c1[_0x5e0fea(0x19c)]['fullPath'][_0x5e0fea(0x188)])&&(_0x2af9c1={'tree':_0x31eb57,'command':_0xd311a2[_0x5e0fea(0x19c)],'remainingArgs':_0xd311a2['remainingArgs']});}if(!_0x2af9c1)return undefined;const _0x5de8bf={..._0x53fbf8};return applyAppBinding(_0x2af9c1[_0x5e0fea(0x179)],_0x2af9c1[_0x5e0fea(0x19c)],_0x5de8bf),{'definition':buildDynamicCommandDefinition(_0x2af9c1['tree'],_0x2af9c1['command']),'args':_0x2af9c1[_0x5e0fea(0x18a)],'flags':_0x5de8bf,'tree':_0x2af9c1['tree'],'command':_0x2af9c1[_0x5e0fea(0x19c)]};}export function generateDynamicServiceHelp(_0x3854e9){const _0x41bd44=a59_0x64bd,_0x42305a=listLocalServiceTrees()[_0x41bd44(0x174)](_0x123dcb=>_0x123dcb[_0x41bd44(0x1b4)][_0x41bd44(0x17c)]===_0x3854e9);if(!_0x42305a)return undefined;const _0x415961=[CLI_BIN_NAME+'\x20'+_0x3854e9+'\x20<command>\x20[flags]','',_0x42305a[_0x41bd44(0x1b4)][_0x41bd44(0x1ab)]||_0x3854e9,_0x42305a[_0x41bd44(0x1b4)]['description']?'\x20\x20'+_0x42305a['service'][_0x41bd44(0x18e)]:'','','Commands:',..._0x42305a[_0x41bd44(0x186)]['map'](_0x2ac4c6=>{const _0x9c9d92=_0x41bd44,_0x50b5e2=_0x2ac4c6[_0x9c9d92(0x15c)][_0x9c9d92(0x18b)](0x1)['join']('\x20'),_0x469138=_0x2ac4c6[_0x9c9d92(0x1b8)]==='read'?'':'\x20['+_0x2ac4c6[_0x9c9d92(0x1b8)]+']';return'\x20\x20'+_0x50b5e2[_0x9c9d92(0x17a)](0x18)+'\x20'+(_0x2ac4c6['description']||'')+_0x469138;}),'',_0x41bd44(0x1aa)+CLI_BIN_NAME+_0x41bd44(0x1b1)+_0x3854e9+_0x41bd44(0x1b0)][_0x41bd44(0x19d)](Boolean);return _0x415961['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x46434e=>{const _0x427cd1=a59_0x64bd,_0x1f20ab=_0x46434e[_0x427cd1(0x1b7)];return{'service':_0x1f20ab['service'][_0x427cd1(0x17c)],'label':_0x1f20ab[_0x427cd1(0x1b4)][_0x427cd1(0x1ab)]||_0x1f20ab[_0x427cd1(0x1b4)][_0x427cd1(0x17c)],'commands':_0x1f20ab[_0x427cd1(0x186)][_0x427cd1(0x15e)](_0x590109=>({'command':dynamicCommandName(_0x590109),'description':_0x590109[_0x427cd1(0x18e)]||_0x427cd1(0x18f)+_0x590109['cliPath'],'tag':riskTag(_0x590109['risk'])}))};});}export function getDynamicServiceEntry(_0x37a297){const _0x3baea1=a59_0x64bd;return listDynamicServiceEntries()[_0x3baea1(0x174)](_0x2ac6ac=>_0x2ac6ac['service']===_0x37a297);}export function listDynamicServiceDefinitions(_0x3f5313){const _0x3d5334=a59_0x64bd;return listLocalServiceTrees()[_0x3d5334(0x19d)](_0x43b739=>!_0x3f5313||_0x43b739['service']['code']===_0x3f5313)['flatMap'](_0x50a1f5=>_0x50a1f5[_0x3d5334(0x186)][_0x3d5334(0x15e)](_0x1e92d2=>buildDynamicCommandDefinition(_0x50a1f5,_0x1e92d2)));}function a59_0x64bd(_0x283e92,_0x235b36){_0x283e92=_0x283e92-0x15a;const _0x15adbf=a59_0x15ad();let _0x64bd7a=_0x15adbf[_0x283e92];return _0x64bd7a;}export function getDynamicServiceDefinitions(_0x3815c7){const _0x38d193=a59_0x64bd,_0x3d04eb=listDynamicServiceDefinitions(_0x3815c7);return _0x3d04eb[_0x38d193(0x188)]>0x0?_0x3d04eb:undefined;}export function findDynamicServiceDefinition(_0xe6b0ae,_0x2ce826){const _0x566a6e=a59_0x64bd;return listDynamicServiceDefinitions(_0xe6b0ae)[_0x566a6e(0x174)](_0xa286f0=>_0xa286f0[_0x566a6e(0x19c)]===_0x2ce826);}export function buildDynamicCommandDefinition(_0x13cbb0,_0x2d56d9){const _0x31f6aa=a59_0x64bd;return{'service':_0x13cbb0[_0x31f6aa(0x1b4)]['code'],'command':dynamicCommandName(_0x2d56d9),'description':_0x2d56d9[_0x31f6aa(0x18e)]||'Run\x20service\x20command\x20'+_0x2d56d9['cliPath'],'risk':_0x2d56d9[_0x31f6aa(0x1b8)],..._0x2d56d9['risk']===_0x31f6aa(0x1a1)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x2d56d9)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x2d56d9[_0x31f6aa(0x15b)]['map'](_0x3fbdc8=>({'name':_0x3fbdc8['name'],'description':_0x3fbdc8[_0x31f6aa(0x18e)]||_0x3fbdc8[_0x31f6aa(0x1ab)],'required':_0x3fbdc8[_0x31f6aa(0x173)]})),'flags':_0x2d56d9[_0x31f6aa(0x177)][_0x31f6aa(0x15e)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x2d56d9),async 'dryRun'(_0x5bf4dc){const _0x4e050c=_0x31f6aa,_0x50b651=await compilePlan(_0x2d56d9,_0x5bf4dc);return{'method':'SERVICE_TREE','url':_0x2d56d9[_0x4e050c(0x1ac)],'body':{'target':targetPreview(_0x50b651),'params':_0x50b651[_0x4e050c(0x197)]},'description':_0x4e050c(0x183)+_0x2d56d9['cliPath']};},async 'execute'(_0x52936b){const _0x4b44f2=_0x31f6aa,_0xcff51d=await compilePlan(_0x2d56d9,_0x52936b),_0x44730e=Date['now'](),_0x393bb9=await executePlan(_0xcff51d,_0x2d56d9,_0x52936b),_0x3f0dd0=Date[_0x4b44f2(0x17d)]()-_0x44730e;return{'ok':!![],'data':{'service':_0x13cbb0[_0x4b44f2(0x1b4)],'command':_0x2d56d9[_0x4b44f2(0x1ac)],'target':targetPreview(_0xcff51d),'result':_0x393bb9,'elapsed':_0x3f0dd0},'message':_0x4b44f2(0x1a8)+_0x2d56d9[_0x4b44f2(0x1ac)]+'\x20completed\x20in\x20'+_0x3f0dd0+'ms'};}};}function buildDynamicConfirmationDescription(_0x371ce2){const _0x1c6dd7=a59_0x64bd,_0x34bde1=_0x371ce2[_0x1c6dd7(0x18e)]||_0x371ce2[_0x1c6dd7(0x1ac)],_0x1f1dd7=_0x371ce2[_0x1c6dd7(0x1b8)]===_0x1c6dd7(0x16e)?'该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。':_0x1c6dd7(0x170);return _0x1c6dd7(0x185)+_0x34bde1+'”。'+_0x1f1dd7;}function dynamicCommandName(_0x429c81){const _0x55482a=a59_0x64bd;return _0x429c81['fullPath'][_0x55482a(0x18b)](0x1)['join']('\x20');}function a59_0x15ad(){const _0x24082f=['required','find','kind','652336BTdZML','flags','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','tree','padEnd','username','code','now','fromEntries','mapTo','target','119037ehrpWh','Cannot\x20resolve\x20datatable\x20\x22','Preview\x20dynamic\x20service\x20command:\x20','json','将通过\x20Service\x20Tree\x20执行“','commands','entries','length','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','remainingArgs','slice','3340554vqOcCc','nickName','description','Run\x20service\x20command\x20','appcode','\x20\x20\x20\x20datasetCode:\x20','sql','sqlCode','envName','startsWith','type','params','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','1325597uovvIb','\x20\x20\x20\x20command:\x20','dbtableConfig','command','filter','bffId','\x20\x20\x20\x20','5247738BqmhJA','read','string','scriptName','push','68cBFHWQ','validation','some','Service\x20command\x20','Unknown\x20appRef\x20\x22','Use\x20`','name','cliPath','enum','\x20->\x20','70775QiBXon','`\x20to\x20inspect\x20the\x20manifest.','\x20service\x20detail\x20--service\x20','datasetCode','env','service','317478vHrBBR','loginName','normalizedManifest','risk','source','args','fullPath','appRef','map','number','userName','join','app','boolean','\x20\x20\x20\x20kind:\x20\x20\x20\x20','\x22\x20in\x20service\x20command\x20','default','nickname','\x20\x20\x20\x20datatable:\x20','Unsupported\x20service\x20target\x20kind:\x20','appCode','bffCode','tenantCode','employeeId','high-risk-write','datatable','该命令被清单标记为写入,可能修改业务数据或服务状态。','\x20\x20\x20\x20functionName:\x20','5uMoOuu'];a59_0x15ad=function(){return _0x24082f;};return a59_0x15ad();}function riskTag(_0x365caa){const _0x137fd1=a59_0x64bd;return _0x365caa===_0x137fd1(0x1a1)?'':'\x20\x20['+_0x365caa+']';}function flagToCommandFlag(_0xfe34f3){const _0x5f16a4=a59_0x64bd;return{'name':_0xfe34f3['cliName'],'type':_0xfe34f3[_0x5f16a4(0x196)]===_0x5f16a4(0x184)?_0x5f16a4(0x1a2):_0xfe34f3['type'],'description':_0xfe34f3[_0x5f16a4(0x18e)]||_0xfe34f3['name'],'required':_0xfe34f3['required'],'default':isPrimitiveFlagDefault(_0xfe34f3['default'])?_0xfe34f3[_0x5f16a4(0x166)]:undefined,'enum':_0xfe34f3[_0x5f16a4(0x1ad)]};}async function compilePlan(_0x2565b2,_0x4b2fc0){const _0x4ec3d8=a59_0x64bd;return compileServiceTreeCommand(_0x2565b2,{'flags':_0x4b2fc0['rawFlags'],'args':_0x4b2fc0[_0x4ec3d8(0x15b)],'context':await buildServiceContext(_0x2565b2,_0x4b2fc0)});}async function buildServiceContext(_0x5c4487,_0x72d201){const _0xfad925=a59_0x64bd,_0x461206={'appCode':_0x72d201['appCode'],'env':_0x72d201['envName'],'envName':_0x72d201[_0xfad925(0x194)]};if(!usesRuntimeContext(_0x5c4487))return _0x461206;const _0x36f0da=await getLoginUserInfo(),_0x565fab=pickFirst(_0x36f0da['userId'],_0x36f0da['id']);return{..._0x461206,'user':_0x36f0da,'userId':_0x565fab,'id':_0x36f0da['id'],'username':pickFirst(_0x36f0da[_0xfad925(0x17b)],_0x36f0da[_0xfad925(0x160)],_0x36f0da[_0xfad925(0x1b6)]),'userName':_0x36f0da['userName'],'nickname':pickFirst(_0x36f0da[_0xfad925(0x167)],_0x36f0da[_0xfad925(0x18d)]),'nickName':_0x36f0da['nickName'],'tenantCode':_0x36f0da[_0xfad925(0x16c)],'employeeId':_0x36f0da[_0xfad925(0x16d)]};}function usesRuntimeContext(_0x3380e3){const _0x17fb6b=a59_0x64bd;return _0x3380e3[_0x17fb6b(0x17f)][_0x17fb6b(0x1a7)](_0x540f6c=>typeof _0x540f6c[_0x17fb6b(0x15a)]===_0x17fb6b(0x1a2)&&(_0x540f6c[_0x17fb6b(0x15a)]['startsWith']('context.')||_0x540f6c[_0x17fb6b(0x15a)][_0x17fb6b(0x195)]('ctx.')));}function pickFirst(..._0x493ee1){return _0x493ee1['find'](_0x477431=>_0x477431!==undefined&&_0x477431!==null);}async function executePlan(_0x2df4a5,_0x1bd89f,_0x2ee79e){const _0x5070f6=a59_0x64bd;if(_0x2df4a5['kind']==='data'){const _0x2624e7=await resolveDatasetCode(_0x2df4a5,_0x1bd89f,_0x2ee79e);return executeData(_0x2624e7,_0x2df4a5['command'],_0x2df4a5[_0x5070f6(0x197)]);}if(_0x2df4a5[_0x5070f6(0x175)]===_0x5070f6(0x192)){if(!_0x2df4a5['sqlCode'])throw CliErrors[_0x5070f6(0x1a6)](_0x5070f6(0x1a8)+_0x1bd89f['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x2df4a5[_0x5070f6(0x193)],normalizeScalarParams(_0x2df4a5[_0x5070f6(0x197)]));}if(_0x2df4a5['kind']==='bff'){const _0xb8f974=_0x2df4a5[_0x5070f6(0x1a3)]||_0x2df4a5[_0x5070f6(0x16b)]||(_0x2df4a5[_0x5070f6(0x19e)]==null?'':String(_0x2df4a5[_0x5070f6(0x19e)]));if(!_0xb8f974)throw CliErrors[_0x5070f6(0x1a6)](_0x5070f6(0x1a8)+_0x1bd89f[_0x5070f6(0x1ac)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0xb8f974,_0x2df4a5[_0x5070f6(0x197)]);}throw CliErrors[_0x5070f6(0x1a6)](_0x5070f6(0x169)+_0x2df4a5['kind']);}async function resolveDatasetCode(_0x1a4a38,_0x3b721a,_0x3ad32d){const _0x4d626f=a59_0x64bd;if(_0x1a4a38[_0x4d626f(0x1b2)])return _0x1a4a38[_0x4d626f(0x1b2)];if(!_0x1a4a38['datatable'])throw CliErrors[_0x4d626f(0x1a6)]('Service\x20command\x20'+_0x3b721a[_0x4d626f(0x1ac)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x275552=await listDatasets(_0x3ad32d[_0x4d626f(0x16a)]),_0x56c812=_0x275552[_0x4d626f(0x174)](_0x2f5f98=>_0x2f5f98[_0x4d626f(0x19b)]?.['tableName']===_0x1a4a38[_0x4d626f(0x16f)]);if(!_0x56c812?.['code'])throw CliErrors['validation'](_0x4d626f(0x182)+_0x1a4a38[_0x4d626f(0x16f)]+_0x4d626f(0x178)+_0x3ad32d[_0x4d626f(0x16a)]+'.',_0x4d626f(0x198));return _0x56c812[_0x4d626f(0x17c)];}function applyAppBinding(_0x1c7f0b,_0x2341b6,_0x249754){const _0x2a4779=a59_0x64bd,_0x45d4bb=_0x2341b6[_0x2a4779(0x180)][_0x2a4779(0x15d)];if(!_0x45d4bb)return;const _0x17f8f3=_0x1c7f0b['appBindings'][_0x45d4bb];if(!_0x17f8f3)throw CliErrors[_0x2a4779(0x1a6)](_0x2a4779(0x1a9)+_0x45d4bb+_0x2a4779(0x165)+_0x2341b6[_0x2a4779(0x1ac)]+'.',_0x2a4779(0x189));const _0x82dd3f=_0x17f8f3[_0x2a4779(0x190)]||_0x17f8f3[_0x2a4779(0x16a)];_0x82dd3f&&!hasText(_0x249754['appcode'])&&(_0x249754[_0x2a4779(0x190)]=_0x82dd3f),_0x17f8f3[_0x2a4779(0x162)]&&!hasText(_0x249754[_0x2a4779(0x162)])&&!hasText(_0x249754[_0x2a4779(0x190)])&&(_0x249754[_0x2a4779(0x162)]=_0x17f8f3['app']),_0x17f8f3[_0x2a4779(0x1b3)]&&!hasText(_0x249754['env'])&&(_0x249754[_0x2a4779(0x1b3)]=_0x17f8f3['env']);}function renderDynamicCommandHelp(_0x3a342e){const _0x154441=a59_0x64bd,_0x386583=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x154441(0x164)+_0x3a342e[_0x154441(0x180)][_0x154441(0x175)],_0x154441(0x19a)+_0x3a342e[_0x154441(0x180)]['command']];if(_0x3a342e['target']['datasetCode'])_0x386583[_0x154441(0x1a4)](_0x154441(0x191)+_0x3a342e['target']['datasetCode']);if(_0x3a342e[_0x154441(0x180)][_0x154441(0x16f)])_0x386583[_0x154441(0x1a4)](_0x154441(0x168)+_0x3a342e[_0x154441(0x180)][_0x154441(0x16f)]);if(_0x3a342e[_0x154441(0x180)][_0x154441(0x193)])_0x386583[_0x154441(0x1a4)]('\x20\x20\x20\x20sqlCode:\x20'+_0x3a342e['target'][_0x154441(0x193)]);if(_0x3a342e[_0x154441(0x180)][_0x154441(0x1a3)])_0x386583[_0x154441(0x1a4)](_0x154441(0x171)+_0x3a342e[_0x154441(0x180)][_0x154441(0x1a3)]);if(_0x3a342e[_0x154441(0x17f)]['length']>0x0){_0x386583[_0x154441(0x1a4)]('','\x20\x20MAP\x20TO');for(const _0x1087ad of _0x3a342e[_0x154441(0x17f)]){_0x386583['push'](_0x154441(0x19f)+(_0x1087ad[_0x154441(0x15a)]||'const')+_0x154441(0x1ae)+_0x1087ad['target']+(_0x1087ad['operator']?'.'+_0x1087ad['operator']:''));}}return _0x386583[_0x154441(0x161)]('\x0a');}function targetPreview(_0x314f61){const _0x1b283c=a59_0x64bd;return{'kind':_0x314f61[_0x1b283c(0x175)],'command':_0x314f61[_0x1b283c(0x19c)],'appRef':_0x314f61[_0x1b283c(0x15d)],'datasetCode':_0x314f61['datasetCode'],'datatable':_0x314f61[_0x1b283c(0x16f)],'sqlCode':_0x314f61[_0x1b283c(0x193)],'bffCode':_0x314f61[_0x1b283c(0x16b)],'bffId':_0x314f61[_0x1b283c(0x19e)],'functionName':_0x314f61[_0x1b283c(0x1a3)]};}function normalizeScalarParams(_0x5a0ebd){const _0x40792f=a59_0x64bd;return Object[_0x40792f(0x17e)](Object[_0x40792f(0x187)](_0x5a0ebd)[_0x40792f(0x19d)](([,_0x18ad95])=>typeof _0x18ad95===_0x40792f(0x1a2)||typeof _0x18ad95==='number'));}function hasText(_0x16abe1){const _0xe29844=a59_0x64bd;return typeof _0x16abe1===_0xe29844(0x1a2)&&_0x16abe1['trim']()[_0xe29844(0x188)]>0x0;}function isPrimitiveFlagDefault(_0x108f0a){const _0x191fd7=a59_0x64bd;return _0x108f0a===undefined||typeof _0x108f0a==='string'||typeof _0x108f0a===_0x191fd7(0x15f)||typeof _0x108f0a===_0x191fd7(0x163);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a60_0x2aa1(){const _0x24778a=['isArray','trim','.resources','commands','.target','6564887alFlzR','prototype','47811ZGfOpO','functionName\x20must\x20be\x20a\x20non-empty\x20string.','action','hasOwnProperty','bff.exec','$.resources','error','push','$.commands[','].target','.actions.','scriptName','entries','597771yWzxdW','functionName','map','resources','object','18994176MqWSwY','call','bff','94WFHdCy','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','fromEntries','kind','1382536ROdjUc','356646BstPvW','actions','4711440gaMMUV','string','target'];a60_0x2aa1=function(){return _0x24778a;};return a60_0x2aa1();}(function(_0x597bfa,_0xfa0e07){const _0x532604=a60_0x460a,_0xe9c9a9=_0x597bfa();while(!![]){try{const _0x52862f=parseInt(_0x532604(0x10f))/0x1+parseInt(_0x532604(0xf1))/0x2*(parseInt(_0x532604(0x102))/0x3)+-parseInt(_0x532604(0xf5))/0x4+parseInt(_0x532604(0xf8))/0x5+parseInt(_0x532604(0xf6))/0x6+parseInt(_0x532604(0x100))/0x7+-parseInt(_0x532604(0xee))/0x8;if(_0x52862f===_0xfa0e07)break;else _0xe9c9a9['push'](_0xe9c9a9['shift']());}catch(_0x550e6c){_0xe9c9a9['push'](_0xe9c9a9['shift']());}}}(a60_0x2aa1,0x8a4ca));export function adaptServiceTreeManifestForLegacyFramework(_0x3bffd5){const _0x1b4373=a60_0x460a,_0x4a6aed=cloneJsonValue(_0x3bffd5),_0x541e25=[];if(!isObjectRecord(_0x4a6aed))return{'manifest':_0x4a6aed,'errors':_0x541e25};return Array[_0x1b4373(0xfb)](_0x4a6aed['commands'])&&_0x4a6aed[_0x1b4373(0xfe)]['forEach']((_0x587b26,_0x1f50fd)=>{const _0x540b26=_0x1b4373;if(!isObjectRecord(_0x587b26))return;adaptBffTarget(_0x587b26['target'],_0x540b26(0x10a)+_0x1f50fd+_0x540b26(0x10b),_0x541e25);}),adaptResources(_0x4a6aed['resources'],_0x1b4373(0x107),_0x541e25),{'manifest':_0x4a6aed,'errors':_0x541e25};}export function toPublicServiceTreeTarget(_0x293703){const _0x156bda=a60_0x460a,{scriptName:_0x4cbbce,..._0x239919}=_0x293703;return typeof _0x4cbbce===_0x156bda(0xf9)&&_0x4cbbce[_0x156bda(0xfc)]()&&(_0x239919[_0x156bda(0x110)]=_0x4cbbce),_0x239919;}export function toPublicNormalizedServiceTree(_0x2caee8){const _0x52f456=a60_0x460a;return{..._0x2caee8,'commands':_0x2caee8[_0x52f456(0xfe)]['map'](_0x46ea54=>({..._0x46ea54,'target':toPublicServiceTreeTarget(_0x46ea54[_0x52f456(0xfa)])}))};}function adaptResources(_0x5cebcb,_0x93c187,_0x5f1fca){const _0x45d556=a60_0x460a;if(!isObjectRecord(_0x5cebcb))return;for(const [_0x1620ea,_0x8ca959]of Object[_0x45d556(0x10e)](_0x5cebcb)){if(!isObjectRecord(_0x8ca959))continue;const _0x1429ca=_0x93c187+'.'+_0x1620ea;if(isObjectRecord(_0x8ca959[_0x45d556(0xf7)]))for(const [_0x31a398,_0x50083a]of Object['entries'](_0x8ca959['actions'])){if(!isObjectRecord(_0x50083a))continue;const _0x2eacc2=_0x1429ca+_0x45d556(0x10c)+_0x31a398,_0x360f70=isObjectRecord(_0x50083a[_0x45d556(0xfa)])&&_0x50083a[_0x45d556(0xfa)][_0x45d556(0xf4)]===_0x45d556(0xf0);adaptBffTarget(_0x50083a[_0x45d556(0xfa)],_0x2eacc2+_0x45d556(0xff),_0x5f1fca),(_0x360f70||isBffAction(_0x50083a))&&adaptFunctionNameField(_0x50083a,_0x2eacc2,_0x5f1fca);}adaptResources(_0x8ca959[_0x45d556(0x112)],_0x1429ca+_0x45d556(0xfd),_0x5f1fca);}}function adaptBffTarget(_0x12f832,_0x1ab330,_0x5031c6){const _0x5e7d0f=a60_0x460a;if(!isObjectRecord(_0x12f832)||_0x12f832[_0x5e7d0f(0xf4)]!==_0x5e7d0f(0xf0))return;adaptFunctionNameField(_0x12f832,_0x1ab330,_0x5031c6);}function adaptFunctionNameField(_0x4b0188,_0x4ae0f2,_0x10dbcc){const _0x5aeaac=a60_0x460a;Object['prototype'][_0x5aeaac(0x105)][_0x5aeaac(0xef)](_0x4b0188,_0x5aeaac(0x10d))&&_0x10dbcc[_0x5aeaac(0x109)]({'level':_0x5aeaac(0x108),'path':_0x4ae0f2+'.scriptName','message':_0x5aeaac(0xf2)});if(Object[_0x5aeaac(0x101)][_0x5aeaac(0x105)][_0x5aeaac(0xef)](_0x4b0188,_0x5aeaac(0x110))){if(typeof _0x4b0188[_0x5aeaac(0x110)]!==_0x5aeaac(0xf9)||!_0x4b0188[_0x5aeaac(0x110)][_0x5aeaac(0xfc)]()){_0x10dbcc['push']({'level':_0x5aeaac(0x108),'path':_0x4ae0f2+'.functionName','message':_0x5aeaac(0x103)}),delete _0x4b0188['functionName'];return;}_0x4b0188[_0x5aeaac(0x10d)]=_0x4b0188[_0x5aeaac(0x110)],delete _0x4b0188[_0x5aeaac(0x110)];}}function a60_0x460a(_0x1c3e91,_0x12379b){_0x1c3e91=_0x1c3e91-0xed;const _0x2aa178=a60_0x2aa1();let _0x460af2=_0x2aa178[_0x1c3e91];return _0x460af2;}function isBffAction(_0x7d7ae2){const _0x531a12=a60_0x460a;return _0x7d7ae2[_0x531a12(0xf4)]===_0x531a12(0xf0)||_0x7d7ae2[_0x531a12(0x104)]===_0x531a12(0x106)||_0x7d7ae2[_0x531a12(0xfa)]==='bff.exec';}function cloneJsonValue(_0x1ee5fb){const _0x15b3b0=a60_0x460a;if(Array[_0x15b3b0(0xfb)](_0x1ee5fb))return _0x1ee5fb['map'](_0xc94668=>cloneJsonValue(_0xc94668));if(isObjectRecord(_0x1ee5fb))return Object[_0x15b3b0(0xf3)](Object[_0x15b3b0(0x10e)](_0x1ee5fb)[_0x15b3b0(0x111)](([_0x435589,_0x856903])=>[_0x435589,cloneJsonValue(_0x856903)]));return _0x1ee5fb;}function isObjectRecord(_0x3bb569){const _0x24cbab=a60_0x460a;return Boolean(_0x3bb569)&&typeof _0x3bb569===_0x24cbab(0xed)&&!Array[_0x24cbab(0xfb)](_0x3bb569);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a61_0x357366=a61_0x3044;(function(_0x75dfe5,_0x356ea2){const _0x4643e5=a61_0x3044,_0x425ef4=_0x75dfe5();while(!![]){try{const _0x163e38=parseInt(_0x4643e5(0x226))/0x1*(parseInt(_0x4643e5(0x21a))/0x2)+parseInt(_0x4643e5(0x1ed))/0x3+-parseInt(_0x4643e5(0x1fc))/0x4+parseInt(_0x4643e5(0x229))/0x5+parseInt(_0x4643e5(0x1fd))/0x6*(parseInt(_0x4643e5(0x228))/0x7)+-parseInt(_0x4643e5(0x205))/0x8*(-parseInt(_0x4643e5(0x224))/0x9)+parseInt(_0x4643e5(0x202))/0xa*(-parseInt(_0x4643e5(0x1f5))/0xb);if(_0x163e38===_0x356ea2)break;else _0x425ef4['push'](_0x425ef4['shift']());}catch(_0x2a372a){_0x425ef4['push'](_0x425ef4['shift']());}}}(a61_0x47c4,0xbbc4f));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a61_0x47c4(){const _0x539fff=['Service\x20manifest\x20validation\x20passed.','entries','11XQBrCE','warnings','Service\x20registry\x20validation\x20passed.','registry','description','replaced','reduce','3040112xPAyNs','2238NiQGKm','cliName','serviceCount','type','remove','36955780IPYyWQ','Removed\x20service\x20','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','7502560gFHrYA','normalizedManifest','entry','file','filePath','source','cliPath','Exported\x20service\x20','read','\x20service\x20','Imported\x20','hash','\x20service(s),\x20updated\x20','imported','将\x20Service\x20Tree\x20清单导入本地运行态注册表','version','validate','Imported','length','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','service','213090DBhoyH','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','Updated','write','updated','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Service\x20Tree\x20manifest\x20file\x20path','required','str','string','9BuViBU','name','14FCksRn','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','6545BYDMWV','5299665IuFWCv','Local\x20service\x20code,\x20for\x20example\x20crm','manifests','kind','target','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','errors','report','\x20service(s).','risk','map','Local\x20service\x20not\x20found:\x20','export','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','registryServiceCode','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','commands','serviceCode','4159713ZQwvRq','list','WRITE','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','registryPath','lower\x20kebab-case\x20service\x20code'];a61_0x47c4=function(){return _0x539fff;};return a61_0x47c4();}const FILE_FLAG={'name':a61_0x357366(0x208),'type':a61_0x357366(0x223),'required':!![],'description':a61_0x357366(0x220)},SERVICE_FLAG={'name':a61_0x357366(0x219),'type':a61_0x357366(0x223),'required':!![],'description':a61_0x357366(0x22a),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a61_0x357366(0x1f2)}};function a61_0x3044(_0x284bec,_0x4077d4){_0x284bec=_0x284bec-0x1e4;const _0x47c491=a61_0x47c4();let _0x3044fa=_0x47c491[_0x284bec];return _0x3044fa;}function summarizeService(_0x4d0131){const _0x3d5660=a61_0x357366;return{'serviceCode':_0x4d0131[_0x3d5660(0x1ec)],'name':_0x4d0131[_0x3d5660(0x206)][_0x3d5660(0x219)]['name'],'version':_0x4d0131['version'],'importedAt':_0x4d0131['importedAt'],'source':_0x4d0131['source'],'commandCount':_0x4d0131[_0x3d5660(0x206)][_0x3d5660(0x1eb)]['length'],'commands':_0x4d0131[_0x3d5660(0x206)]['commands'][_0x3d5660(0x1e5)](_0x4c1618=>({'path':_0x4c1618[_0x3d5660(0x20b)],'description':_0x4c1618[_0x3d5660(0x1f9)],'risk':_0x4c1618[_0x3d5660(0x1e4)],'target':toPublicServiceTreeTarget(_0x4c1618['target']),'flags':_0x4c1618['flags'][_0x3d5660(0x1e5)](_0x3a9ef2=>({'name':_0x3a9ef2[_0x3d5660(0x225)],'cliName':_0x3a9ef2[_0x3d5660(0x1fe)],'type':_0x3a9ef2[_0x3d5660(0x200)],'required':_0x3a9ef2[_0x3d5660(0x221)]===!![]}))}))};}function summarizeLoadedManifest(_0x1c4236){const _0x291538=a61_0x357366;return{'service':_0x1c4236['normalizedManifest']?.[_0x291538(0x219)],'version':_0x1c4236[_0x291538(0x206)]?.[_0x291538(0x214)],'commandCount':_0x1c4236[_0x291538(0x206)]?.['commands'][_0x291538(0x217)]??0x0,'commands':_0x1c4236[_0x291538(0x206)]?.[_0x291538(0x1eb)][_0x291538(0x1e5)](_0x53393a=>({'path':_0x53393a[_0x291538(0x20b)],'risk':_0x53393a[_0x291538(0x1e4)],'target':toPublicServiceTreeTarget(_0x53393a['target'])}))??[],'registryIndex':_0x1c4236['registryIndex'],'registryServiceCode':_0x1c4236[_0x291538(0x1e9)],'errors':_0x1c4236[_0x291538(0x230)][_0x291538(0x22f)],'warnings':_0x1c4236['report'][_0x291538(0x1f6)]};}export const serviceDefinitions=[{'service':'service','command':a61_0x357366(0x215),'description':a61_0x357366(0x204),'risk':a61_0x357366(0x20d),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x47686c){const _0x48b276=a61_0x357366,_0x29772d=loadServiceManifestFromFile(_0x47686c['str'](_0x48b276(0x208)));if(!_0x29772d[_0x48b276(0x230)]['ok'])return{'ok':![],'data':{'file':_0x29772d[_0x48b276(0x209)],'hash':_0x29772d['hash'],'kind':_0x29772d['kind'],'serviceCount':_0x29772d[_0x48b276(0x22b)][_0x48b276(0x217)],'services':_0x29772d[_0x48b276(0x22b)][_0x48b276(0x1e5)](summarizeLoadedManifest),'errors':_0x29772d[_0x48b276(0x230)][_0x48b276(0x22f)],'warnings':_0x29772d[_0x48b276(0x230)]['warnings']},'message':formatValidationFailure(_0x29772d[_0x48b276(0x230)])};if(_0x29772d[_0x48b276(0x22c)]===_0x48b276(0x1f8)||_0x29772d['manifests'][_0x48b276(0x217)]!==0x1)return{'ok':!![],'data':{'file':_0x29772d['filePath'],'hash':_0x29772d[_0x48b276(0x210)],'kind':_0x29772d['kind'],'serviceCount':_0x29772d['manifests']['length'],'commandCount':_0x29772d[_0x48b276(0x22b)][_0x48b276(0x1fb)]((_0x2c56ae,_0x5d2605)=>_0x2c56ae+(_0x5d2605[_0x48b276(0x206)]?.['commands'][_0x48b276(0x217)]??0x0),0x0),'services':_0x29772d['manifests'][_0x48b276(0x1e5)](summarizeLoadedManifest),'warnings':_0x29772d[_0x48b276(0x230)][_0x48b276(0x1f6)]},'message':_0x48b276(0x1f7)};return{'ok':!![],'data':{'file':_0x29772d[_0x48b276(0x209)],'hash':_0x29772d[_0x48b276(0x210)],'kind':_0x29772d[_0x48b276(0x22c)],'service':_0x29772d[_0x48b276(0x206)]?.[_0x48b276(0x219)],'version':_0x29772d[_0x48b276(0x206)]?.[_0x48b276(0x214)],'commandCount':_0x29772d[_0x48b276(0x206)]?.[_0x48b276(0x1eb)]['length']??0x0,'commands':_0x29772d['normalizedManifest']?.['commands']['map'](_0x5baf3c=>({'path':_0x5baf3c['cliPath'],'risk':_0x5baf3c[_0x48b276(0x1e4)],'target':toPublicServiceTreeTarget(_0x5baf3c[_0x48b276(0x22d)])})),'warnings':_0x29772d[_0x48b276(0x230)][_0x48b276(0x1f6)]},'message':_0x48b276(0x1f3)};}},{'service':a61_0x357366(0x219),'command':'import','description':a61_0x357366(0x213),'risk':a61_0x357366(0x21d),'confirmationDescription':a61_0x357366(0x1ea),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x4bb071){const _0x219316=a61_0x357366,_0x322a36=loadServiceManifestFromFile(_0x4bb071['str'](_0x219316(0x208)));return{'method':_0x219316(0x1ef),'url':getServiceRegistryPath(),'body':{'file':_0x322a36[_0x219316(0x209)],'hash':_0x322a36[_0x219316(0x210)],'kind':_0x322a36[_0x219316(0x22c)],'ok':_0x322a36['report']['ok'],'service':_0x322a36[_0x219316(0x206)]?.[_0x219316(0x219)],'version':_0x322a36[_0x219316(0x206)]?.[_0x219316(0x214)],'serviceCount':_0x322a36[_0x219316(0x22b)][_0x219316(0x217)],'services':_0x322a36['manifests'][_0x219316(0x1e5)](_0x3d1947=>({'service':_0x3d1947['normalizedManifest']?.[_0x219316(0x219)],'version':_0x3d1947['normalizedManifest']?.[_0x219316(0x214)],'commandCount':_0x3d1947[_0x219316(0x206)]?.[_0x219316(0x1eb)][_0x219316(0x217)]??0x0,'errors':_0x3d1947['report']['errors']})),'errors':_0x322a36[_0x219316(0x230)]['errors'],'commandCount':_0x322a36[_0x219316(0x206)]?.[_0x219316(0x1eb)][_0x219316(0x217)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x2e2677){const _0x38eaf1=a61_0x357366,_0x5b60b1=importServiceManifest(_0x2e2677['str'](_0x38eaf1(0x208)));if(_0x5b60b1[_0x38eaf1(0x1f4)][_0x38eaf1(0x217)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x5b60b1[_0x38eaf1(0x1f1)],'imported':_0x5b60b1[_0x38eaf1(0x212)],'updated':_0x5b60b1[_0x38eaf1(0x21e)],'serviceCount':_0x5b60b1[_0x38eaf1(0x1ff)],'services':_0x5b60b1[_0x38eaf1(0x1f4)][_0x38eaf1(0x1e5)](summarizeService)},'message':_0x38eaf1(0x20f)+_0x5b60b1['imported']+_0x38eaf1(0x211)+_0x5b60b1[_0x38eaf1(0x21e)]+_0x38eaf1(0x231)};return{'ok':!![],'data':{'registryPath':_0x5b60b1[_0x38eaf1(0x1f1)],'replaced':_0x5b60b1[_0x38eaf1(0x1fa)],'imported':_0x5b60b1[_0x38eaf1(0x212)],'updated':_0x5b60b1[_0x38eaf1(0x21e)],'serviceCount':_0x5b60b1[_0x38eaf1(0x1ff)],'service':summarizeService(_0x5b60b1['entry'])},'message':(_0x5b60b1[_0x38eaf1(0x1fa)]?_0x38eaf1(0x21c):_0x38eaf1(0x216))+_0x38eaf1(0x20e)+_0x5b60b1[_0x38eaf1(0x207)]['serviceCode']+'.'};}},{'service':'service','command':a61_0x357366(0x1e7),'description':a61_0x357366(0x22e),'risk':a61_0x357366(0x21d),'confirmationDescription':a61_0x357366(0x21b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x15ece3){const _0xc2f462=a61_0x357366,_0x2bd171=getLocalServiceEntry(_0x15ece3['str']('service'));return{'method':_0xc2f462(0x1ef),'url':_0x15ece3[_0xc2f462(0x222)](_0xc2f462(0x208)),'body':{'service':_0x15ece3[_0xc2f462(0x222)](_0xc2f462(0x219)),'found':Boolean(_0x2bd171),'version':_0x2bd171?.[_0xc2f462(0x214)],'source':_0x2bd171?.[_0xc2f462(0x20a)]},'description':_0xc2f462(0x227)};},async 'execute'(_0x114852){const _0x1b338f=a61_0x357366,_0x2c71ad=exportServiceManifest(_0x114852[_0x1b338f(0x222)](_0x1b338f(0x219)),_0x114852[_0x1b338f(0x222)](_0x1b338f(0x208)));return{'ok':!![],'data':{'registryPath':_0x2c71ad[_0x1b338f(0x1f1)],'file':_0x2c71ad[_0x1b338f(0x209)],'service':summarizeService(_0x2c71ad[_0x1b338f(0x207)])},'message':_0x1b338f(0x20c)+_0x2c71ad[_0x1b338f(0x207)][_0x1b338f(0x1ec)]+'.'};}},{'service':a61_0x357366(0x219),'command':a61_0x357366(0x1ee),'description':a61_0x357366(0x1f0),'risk':a61_0x357366(0x20d),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x41acfa=a61_0x357366,_0x2c1e31=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x2c1e31[_0x41acfa(0x217)],'services':_0x2c1e31['map'](summarizeService)}};}},{'service':a61_0x357366(0x219),'command':a61_0x357366(0x201),'description':'从本地运行态注册表移除\x20Service\x20Tree\x20清单','risk':a61_0x357366(0x21d),'confirmationDescription':a61_0x357366(0x1e8),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x548960){const _0xf1f97e=a61_0x357366,_0x2d309c=getLocalServiceEntry(_0x548960[_0xf1f97e(0x222)](_0xf1f97e(0x219)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x548960[_0xf1f97e(0x222)]('service'),'found':Boolean(_0x2d309c),'version':_0x2d309c?.['version'],'source':_0x2d309c?.[_0xf1f97e(0x20a)]},'description':_0xf1f97e(0x21f)};},async 'execute'(_0x395233){const _0x238118=a61_0x357366,_0x4c1ac0=removeServiceManifest(_0x395233[_0x238118(0x222)](_0x238118(0x219)));return{'ok':!![],'data':{'registryPath':_0x4c1ac0[_0x238118(0x1f1)],'serviceCount':_0x4c1ac0['serviceCount'],'service':summarizeService(_0x4c1ac0[_0x238118(0x207)])},'message':_0x238118(0x203)+_0x4c1ac0[_0x238118(0x207)][_0x238118(0x1ec)]+'.'};}},{'service':a61_0x357366(0x219),'command':'detail','description':a61_0x357366(0x218),'risk':a61_0x357366(0x20d),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1b1625){const _0x3e69cf=a61_0x357366,_0x2847fa=getLocalServiceEntry(_0x1b1625[_0x3e69cf(0x222)](_0x3e69cf(0x219)));if(!_0x2847fa)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1b1625['str']('service')},'message':_0x3e69cf(0x1e6)+_0x1b1625[_0x3e69cf(0x222)](_0x3e69cf(0x219))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2847fa),'manifest':_0x2847fa['manifest'],'normalizedManifest':toPublicNormalizedServiceTree(_0x2847fa[_0x3e69cf(0x206)])}};}}];
|
|
1
|
+
const a61_0x34b3ae=a61_0x43ff;(function(_0x1319ac,_0x183e08){const _0x160436=a61_0x43ff,_0x4e2930=_0x1319ac();while(!![]){try{const _0x161711=-parseInt(_0x160436(0x14d))/0x1+parseInt(_0x160436(0x142))/0x2+parseInt(_0x160436(0x11d))/0x3+-parseInt(_0x160436(0x157))/0x4*(parseInt(_0x160436(0x152))/0x5)+parseInt(_0x160436(0x124))/0x6*(parseInt(_0x160436(0x13b))/0x7)+parseInt(_0x160436(0x139))/0x8+-parseInt(_0x160436(0x138))/0x9;if(_0x161711===_0x183e08)break;else _0x4e2930['push'](_0x4e2930['shift']());}catch(_0x19b438){_0x4e2930['push'](_0x4e2930['shift']());}}}(a61_0xb115,0xbf7b3));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':'file','type':'string','required':!![],'description':a61_0x34b3ae(0x121)},SERVICE_FLAG={'name':a61_0x34b3ae(0x14a),'type':a61_0x34b3ae(0x129),'required':!![],'description':a61_0x34b3ae(0x155),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a61_0x34b3ae(0x15c)}};function summarizeService(_0x1971e5){const _0x168856=a61_0x34b3ae;return{'serviceCode':_0x1971e5[_0x168856(0x12a)],'name':_0x1971e5[_0x168856(0x144)]['service'][_0x168856(0x117)],'version':_0x1971e5[_0x168856(0x159)],'importedAt':_0x1971e5[_0x168856(0x12e)],'source':_0x1971e5['source'],'commandCount':_0x1971e5['normalizedManifest'][_0x168856(0x143)][_0x168856(0x11e)],'commands':_0x1971e5[_0x168856(0x144)]['commands'][_0x168856(0x11f)](_0x23608d=>({'path':_0x23608d[_0x168856(0x15e)],'description':_0x23608d[_0x168856(0x14b)],'risk':_0x23608d[_0x168856(0x14c)],'target':toPublicServiceTreeTarget(_0x23608d[_0x168856(0x15d)]),'flags':_0x23608d[_0x168856(0x12b)]['map'](_0x5d233d=>({'name':_0x5d233d[_0x168856(0x117)],'cliName':_0x5d233d['cliName'],'type':_0x5d233d[_0x168856(0x14e)],'required':_0x5d233d[_0x168856(0x128)]===!![]}))}))};}function a61_0xb115(){const _0x32baf4=['kind','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','registryServiceCode','1332836sjDtfg','commands','normalizedManifest','Service\x20registry\x20validation\x20passed.','entry','detail','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','hash','service','description','risk','324105HHEQHK','type','WRITE','errors','从本地运行态注册表移除\x20Service\x20Tree\x20清单','5760470MJhoul','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','file','Local\x20service\x20code,\x20for\x20example\x20crm','str','4PUcYRg','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','version','reduce','write','lower\x20kebab-case\x20service\x20code','target','cliPath','filePath','Exported\x20service\x20','name','replaced','export','manifests','\x20service\x20','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','151671gwQrBc','length','map','list','Service\x20Tree\x20manifest\x20file\x20path','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','serviceCount','148266KAuDef','Removed\x20service\x20','Local\x20service\x20not\x20found:\x20','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','required','string','serviceCode','flags','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','imported','importedAt','warnings','read','manifest','registryPath','updated','\x20service(s),\x20updated\x20','source','Imported','validate','341433uyUJdC','5337288GicrIN','registry','259AuqEMk','report','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','import'];a61_0xb115=function(){return _0x32baf4;};return a61_0xb115();}function summarizeLoadedManifest(_0x2c180c){const _0x4fde7f=a61_0x34b3ae;return{'service':_0x2c180c[_0x4fde7f(0x144)]?.[_0x4fde7f(0x14a)],'version':_0x2c180c[_0x4fde7f(0x144)]?.['version'],'commandCount':_0x2c180c[_0x4fde7f(0x144)]?.[_0x4fde7f(0x143)]['length']??0x0,'commands':_0x2c180c['normalizedManifest']?.[_0x4fde7f(0x143)][_0x4fde7f(0x11f)](_0x131127=>({'path':_0x131127[_0x4fde7f(0x15e)],'risk':_0x131127['risk'],'target':toPublicServiceTreeTarget(_0x131127['target'])}))??[],'registryIndex':_0x2c180c['registryIndex'],'registryServiceCode':_0x2c180c[_0x4fde7f(0x141)],'errors':_0x2c180c[_0x4fde7f(0x13c)][_0x4fde7f(0x150)],'warnings':_0x2c180c['report'][_0x4fde7f(0x12f)]};}function a61_0x43ff(_0x14551c,_0x36d3ca){_0x14551c=_0x14551c-0x116;const _0xb115c6=a61_0xb115();let _0x43ff95=_0xb115c6[_0x14551c];return _0x43ff95;}export const serviceDefinitions=[{'service':'service','command':a61_0x34b3ae(0x137),'description':a61_0x34b3ae(0x127),'risk':a61_0x34b3ae(0x130),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x2cc6e5){const _0x347096=a61_0x34b3ae,_0xd1e2d0=loadServiceManifestFromFile(_0x2cc6e5[_0x347096(0x156)](_0x347096(0x154)));if(!_0xd1e2d0[_0x347096(0x13c)]['ok'])return{'ok':![],'data':{'file':_0xd1e2d0[_0x347096(0x15f)],'hash':_0xd1e2d0[_0x347096(0x149)],'kind':_0xd1e2d0[_0x347096(0x13f)],'serviceCount':_0xd1e2d0['manifests']['length'],'services':_0xd1e2d0[_0x347096(0x11a)][_0x347096(0x11f)](summarizeLoadedManifest),'errors':_0xd1e2d0[_0x347096(0x13c)][_0x347096(0x150)],'warnings':_0xd1e2d0['report'][_0x347096(0x12f)]},'message':formatValidationFailure(_0xd1e2d0[_0x347096(0x13c)])};if(_0xd1e2d0[_0x347096(0x13f)]===_0x347096(0x13a)||_0xd1e2d0[_0x347096(0x11a)]['length']!==0x1)return{'ok':!![],'data':{'file':_0xd1e2d0[_0x347096(0x15f)],'hash':_0xd1e2d0[_0x347096(0x149)],'kind':_0xd1e2d0[_0x347096(0x13f)],'serviceCount':_0xd1e2d0[_0x347096(0x11a)]['length'],'commandCount':_0xd1e2d0['manifests'][_0x347096(0x15a)]((_0x3aaecd,_0x7653ca)=>_0x3aaecd+(_0x7653ca['normalizedManifest']?.[_0x347096(0x143)][_0x347096(0x11e)]??0x0),0x0),'services':_0xd1e2d0[_0x347096(0x11a)][_0x347096(0x11f)](summarizeLoadedManifest),'warnings':_0xd1e2d0[_0x347096(0x13c)][_0x347096(0x12f)]},'message':_0x347096(0x145)};return{'ok':!![],'data':{'file':_0xd1e2d0[_0x347096(0x15f)],'hash':_0xd1e2d0[_0x347096(0x149)],'kind':_0xd1e2d0[_0x347096(0x13f)],'service':_0xd1e2d0['normalizedManifest']?.['service'],'version':_0xd1e2d0[_0x347096(0x144)]?.['version'],'commandCount':_0xd1e2d0[_0x347096(0x144)]?.[_0x347096(0x143)][_0x347096(0x11e)]??0x0,'commands':_0xd1e2d0[_0x347096(0x144)]?.['commands'][_0x347096(0x11f)](_0x97b1ec=>({'path':_0x97b1ec[_0x347096(0x15e)],'risk':_0x97b1ec[_0x347096(0x14c)],'target':toPublicServiceTreeTarget(_0x97b1ec[_0x347096(0x15d)])})),'warnings':_0xd1e2d0['report'][_0x347096(0x12f)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a61_0x34b3ae(0x14a),'command':a61_0x34b3ae(0x13e),'description':'将\x20Service\x20Tree\x20清单导入本地运行态注册表','risk':a61_0x34b3ae(0x15b),'confirmationDescription':a61_0x34b3ae(0x12c),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x265408){const _0x2ef3b3=a61_0x34b3ae,_0x544c2d=loadServiceManifestFromFile(_0x265408[_0x2ef3b3(0x156)](_0x2ef3b3(0x154)));return{'method':_0x2ef3b3(0x14f),'url':getServiceRegistryPath(),'body':{'file':_0x544c2d[_0x2ef3b3(0x15f)],'hash':_0x544c2d[_0x2ef3b3(0x149)],'kind':_0x544c2d[_0x2ef3b3(0x13f)],'ok':_0x544c2d[_0x2ef3b3(0x13c)]['ok'],'service':_0x544c2d[_0x2ef3b3(0x144)]?.[_0x2ef3b3(0x14a)],'version':_0x544c2d[_0x2ef3b3(0x144)]?.[_0x2ef3b3(0x159)],'serviceCount':_0x544c2d['manifests']['length'],'services':_0x544c2d['manifests'][_0x2ef3b3(0x11f)](_0x2a6e41=>({'service':_0x2a6e41[_0x2ef3b3(0x144)]?.[_0x2ef3b3(0x14a)],'version':_0x2a6e41[_0x2ef3b3(0x144)]?.['version'],'commandCount':_0x2a6e41[_0x2ef3b3(0x144)]?.[_0x2ef3b3(0x143)][_0x2ef3b3(0x11e)]??0x0,'errors':_0x2a6e41[_0x2ef3b3(0x13c)][_0x2ef3b3(0x150)]})),'errors':_0x544c2d['report']['errors'],'commandCount':_0x544c2d[_0x2ef3b3(0x144)]?.[_0x2ef3b3(0x143)][_0x2ef3b3(0x11e)]??0x0},'description':_0x2ef3b3(0x140)};},async 'execute'(_0x56f854){const _0x253fd7=a61_0x34b3ae,_0x338cd0=importServiceManifest(_0x56f854[_0x253fd7(0x156)](_0x253fd7(0x154)));if(_0x338cd0['entries'][_0x253fd7(0x11e)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x338cd0[_0x253fd7(0x132)],'imported':_0x338cd0[_0x253fd7(0x12d)],'updated':_0x338cd0[_0x253fd7(0x133)],'serviceCount':_0x338cd0[_0x253fd7(0x123)],'services':_0x338cd0['entries'][_0x253fd7(0x11f)](summarizeService)},'message':'Imported\x20'+_0x338cd0[_0x253fd7(0x12d)]+_0x253fd7(0x134)+_0x338cd0[_0x253fd7(0x133)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x338cd0[_0x253fd7(0x132)],'replaced':_0x338cd0[_0x253fd7(0x118)],'imported':_0x338cd0[_0x253fd7(0x12d)],'updated':_0x338cd0[_0x253fd7(0x133)],'serviceCount':_0x338cd0['serviceCount'],'service':summarizeService(_0x338cd0[_0x253fd7(0x146)])},'message':(_0x338cd0[_0x253fd7(0x118)]?'Updated':_0x253fd7(0x136))+_0x253fd7(0x11b)+_0x338cd0[_0x253fd7(0x146)][_0x253fd7(0x12a)]+'.'};}},{'service':'service','command':a61_0x34b3ae(0x119),'description':a61_0x34b3ae(0x13d),'risk':a61_0x34b3ae(0x15b),'confirmationDescription':a61_0x34b3ae(0x122),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x494019){const _0x59db3f=a61_0x34b3ae,_0x30e6b4=getLocalServiceEntry(_0x494019['str'](_0x59db3f(0x14a)));return{'method':_0x59db3f(0x14f),'url':_0x494019[_0x59db3f(0x156)]('file'),'body':{'service':_0x494019[_0x59db3f(0x156)](_0x59db3f(0x14a)),'found':Boolean(_0x30e6b4),'version':_0x30e6b4?.[_0x59db3f(0x159)],'source':_0x30e6b4?.[_0x59db3f(0x135)]},'description':_0x59db3f(0x148)};},async 'execute'(_0x359b49){const _0x1fc95d=a61_0x34b3ae,_0x8292ea=exportServiceManifest(_0x359b49['str'](_0x1fc95d(0x14a)),_0x359b49[_0x1fc95d(0x156)]('file'));return{'ok':!![],'data':{'registryPath':_0x8292ea[_0x1fc95d(0x132)],'file':_0x8292ea['filePath'],'service':summarizeService(_0x8292ea[_0x1fc95d(0x146)])},'message':_0x1fc95d(0x116)+_0x8292ea[_0x1fc95d(0x146)][_0x1fc95d(0x12a)]+'.'};}},{'service':a61_0x34b3ae(0x14a),'command':a61_0x34b3ae(0x120),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a61_0x34b3ae(0x130),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0xc23f5d=a61_0x34b3ae,_0x338135=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x338135['length'],'services':_0x338135[_0xc23f5d(0x11f)](summarizeService)}};}},{'service':a61_0x34b3ae(0x14a),'command':'remove','description':a61_0x34b3ae(0x151),'risk':'write','confirmationDescription':a61_0x34b3ae(0x153),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x1c8e6b){const _0x462347=a61_0x34b3ae,_0x2fcb95=getLocalServiceEntry(_0x1c8e6b['str'](_0x462347(0x14a)));return{'method':_0x462347(0x14f),'url':getServiceRegistryPath(),'body':{'service':_0x1c8e6b[_0x462347(0x156)](_0x462347(0x14a)),'found':Boolean(_0x2fcb95),'version':_0x2fcb95?.[_0x462347(0x159)],'source':_0x2fcb95?.[_0x462347(0x135)]},'description':_0x462347(0x158)};},async 'execute'(_0x298b4f){const _0x23a9e7=a61_0x34b3ae,_0x49a82f=removeServiceManifest(_0x298b4f[_0x23a9e7(0x156)](_0x23a9e7(0x14a)));return{'ok':!![],'data':{'registryPath':_0x49a82f[_0x23a9e7(0x132)],'serviceCount':_0x49a82f['serviceCount'],'service':summarizeService(_0x49a82f[_0x23a9e7(0x146)])},'message':_0x23a9e7(0x125)+_0x49a82f[_0x23a9e7(0x146)][_0x23a9e7(0x12a)]+'.'};}},{'service':'service','command':a61_0x34b3ae(0x147),'description':a61_0x34b3ae(0x11c),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1c02d7){const _0x5addcb=a61_0x34b3ae,_0x3cee3d=getLocalServiceEntry(_0x1c02d7['str']('service'));if(!_0x3cee3d)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1c02d7['str'](_0x5addcb(0x14a))},'message':_0x5addcb(0x126)+_0x1c02d7[_0x5addcb(0x156)](_0x5addcb(0x14a))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3cee3d),'manifest':_0x3cee3d[_0x5addcb(0x131)],'normalizedManifest':toPublicNormalizedServiceTree(_0x3cee3d[_0x5addcb(0x144)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a62_0x5125(_0xf2b6dd,_0xbcc518){_0xf2b6dd=_0xf2b6dd-0x1d6;const _0x57a384=a62_0x57a3();let _0x5125ab=_0x57a384[_0xf2b6dd];return _0x5125ab;}const a62_0x22ee08=a62_0x5125;(function(_0x179163,_0x60b7ff){const _0x5eb2f9=a62_0x5125,_0x110cec=_0x179163();while(!![]){try{const _0x552ef2=-parseInt(_0x5eb2f9(0x218))/0x1+parseInt(_0x5eb2f9(0x216))/0x2+-parseInt(_0x5eb2f9(0x207))/0x3+-parseInt(_0x5eb2f9(0x1db))/0x4+-parseInt(_0x5eb2f9(0x1ff))/0x5*(parseInt(_0x5eb2f9(0x1fe))/0x6)+-parseInt(_0x5eb2f9(0x1ed))/0x7*(-parseInt(_0x5eb2f9(0x1d8))/0x8)+parseInt(_0x5eb2f9(0x21f))/0x9*(parseInt(_0x5eb2f9(0x224))/0xa);if(_0x552ef2===_0x60b7ff)break;else _0x110cec['push'](_0x110cec['shift']());}catch(_0x4181d0){_0x110cec['push'](_0x110cec['shift']());}}}(a62_0x57a3,0x65a73));import{createHash}from'node:crypto';function a62_0x57a3(){const _0x5d81b8=['10AgsIqR','update','empty','62856dYQBCb','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','Cannot\x20write\x20service\x20registry:\x20','2678864iDspDb','errors','kind','string','description','].manifest.','digest','slice','service.json','registryIndex','Unsupported\x20schemaVersion:\x20','command','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','.tmp','Local\x20service\x20not\x20found:\x20','code','push','missing','581pwAXcL','name','updatedAt','findIndex','localeCompare','trim','homeDir','length','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','serviceCode','bff\x20target\x20requires\x20functionName.','Unsupported\x20service\x20registry\x20schemaVersion:\x20','schemaVersion','sourceHash','Service\x20manifest\x20file\x20not\x20found:\x20','file','parse','84jwRePQ','274610kwACeM','now','services','commands','sort','sha256','commandCount','invalid','2391912ZePxBi','isArray','map','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','path','validation','warnings','toISOString','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Remove\x20or\x20migrate\x20','homeDirName','report','$.services[','flatMap','service','1592468ONhwZm','utf8','410495dDcKsA','manifest','message','risk','manifests','cliPath','source','14529861mdOpXb','normalizedManifest','stringify','hex','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.'];a62_0x57a3=function(){return _0x5d81b8;};return a62_0x57a3();}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=a62_0x22ee08(0x1e3);export function getServiceRegistryPath(_0x14b32b={}){const _0x7e77bf=a62_0x22ee08;return resolve(_0x14b32b[_0x7e77bf(0x1f3)]??homedir(),PRODUCT_CONFIG[_0x7e77bf(0x211)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x23e20a={}){const _0x11b1fa=a62_0x22ee08,_0x3f274e=getServiceRegistryPath(_0x23e20a);if(!existsSync(_0x3f274e))return emptyServiceRegistry();try{const _0x131f3a=readFileSync(_0x3f274e,_0x11b1fa(0x217));if(!_0x131f3a[_0x11b1fa(0x1f2)]())return emptyServiceRegistry();const _0x4ff258=JSON[_0x11b1fa(0x1fd)](_0x131f3a);if(_0x4ff258['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x11b1fa(0x1f8)+String(_0x4ff258[_0x11b1fa(0x1f9)]),_0x11b1fa(0x210)+_0x3f274e+'.');if(!Array[_0x11b1fa(0x208)](_0x4ff258[_0x11b1fa(0x201)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x4ff258[_0x11b1fa(0x1ef)],'services':_0x4ff258[_0x11b1fa(0x201)]};}catch(_0x7a8609){if(_0x7a8609 instanceof Error&&_0x7a8609[_0x11b1fa(0x1ee)]==='CliError')throw _0x7a8609;throw CliErrors['validation']('Invalid\x20service\x20registry\x20JSON:\x20'+_0x3f274e,_0x11b1fa(0x223));}}export function writeServiceRegistry(_0xaa3905,_0x2cf969={}){const _0x3a423c=a62_0x22ee08,_0x2a8bac=getServiceRegistryPath(_0x2cf969),_0x154e49=dirname(_0x2a8bac);!existsSync(_0x154e49)&&mkdirSync(_0x154e49,{'recursive':!![]});const _0x781c95=_0x2a8bac+_0x3a423c(0x1e8);try{writeFileSync(_0x781c95,JSON[_0x3a423c(0x221)](_0xaa3905,null,0x2)+'\x0a',{'encoding':_0x3a423c(0x217),'mode':0x180}),renameSync(_0x781c95,_0x2a8bac);}catch(_0x2a7a5f){try{unlinkSync(_0x781c95);}catch{}if(_0x2a7a5f?.[_0x3a423c(0x1ea)]==='ENOENT')throw CliErrors[_0x3a423c(0x20c)](_0x3a423c(0x1da)+_0x2a8bac);throw _0x2a7a5f;}return _0x2a8bac;}export function loadServiceManifestFromFile(_0x163a6a){const _0x3f6784=a62_0x22ee08,_0x5dc908=resolve(_0x163a6a);if(!existsSync(_0x5dc908))throw CliErrors[_0x3f6784(0x20c)](_0x3f6784(0x1fb)+_0x163a6a);let _0xb43dde;const _0x593613=readFileSync(_0x5dc908,_0x3f6784(0x217));try{_0xb43dde=JSON[_0x3f6784(0x1fd)](_0x593613);}catch{throw CliErrors[_0x3f6784(0x20c)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x163a6a,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x18b1d2=sha256(_0x593613),_0x23a1a5=extractLoadedServiceManifests(_0xb43dde,_0x18b1d2),_0x303e49=aggregateValidationReports(_0x23a1a5),_0x461807=_0x23a1a5[0x0];return{'filePath':_0x5dc908,'hash':_0x18b1d2,'kind':isServiceRegistryLike(_0xb43dde)?'registry':_0x3f6784(0x219),'manifest':_0x461807?.[_0x3f6784(0x219)]??_0xb43dde,'report':_0x303e49,'normalizedManifest':_0x23a1a5['length']===0x1?_0x461807?.[_0x3f6784(0x220)]:undefined,'manifests':_0x23a1a5};}export function importServiceManifest(_0x3b4cfb,_0x1bc3c1={}){const _0x54c57b=a62_0x22ee08,_0x3f5f39=loadServiceManifestFromFile(_0x3b4cfb);if(!_0x3f5f39[_0x54c57b(0x212)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x3f5f39[_0x54c57b(0x212)]),_0x54c57b(0x1d9));if(_0x3f5f39[_0x54c57b(0x21c)][_0x54c57b(0x1f4)]===0x0)throw CliErrors[_0x54c57b(0x20c)](_0x54c57b(0x20f),_0x54c57b(0x20a));const _0x2f2c81=readServiceRegistry(_0x1bc3c1),_0x44d209=(_0x1bc3c1[_0x54c57b(0x200)]??(()=>new Date()))()['toISOString'](),_0x51bef0=[];let _0x4723c8=0x0,_0x2e3534=0x0;for(const _0x4e1f4a of _0x3f5f39['manifests']){if(!_0x4e1f4a[_0x54c57b(0x220)])continue;const _0x2101fc=_0x4e1f4a[_0x54c57b(0x220)]['service'][_0x54c57b(0x1ea)],_0x4f7536={'serviceCode':_0x2101fc,'version':_0x4e1f4a['normalizedManifest']['version'],'importedAt':_0x44d209,'source':{'type':_0x54c57b(0x1fc),'path':_0x3f5f39['filePath'],'hash':_0x4e1f4a[_0x54c57b(0x1fa)]},'manifest':_0x4e1f4a[_0x54c57b(0x219)],'normalizedManifest':_0x4e1f4a['normalizedManifest']},_0x4b74fb=_0x2f2c81[_0x54c57b(0x201)]['findIndex'](_0x1911c5=>_0x1911c5[_0x54c57b(0x1f6)]===_0x2101fc);_0x4b74fb>=0x0?(_0x2f2c81[_0x54c57b(0x201)][_0x4b74fb]=_0x4f7536,_0x2e3534++):(_0x2f2c81[_0x54c57b(0x201)][_0x54c57b(0x1eb)](_0x4f7536),_0x4723c8++),_0x51bef0['push'](_0x4f7536);}_0x2f2c81[_0x54c57b(0x201)][_0x54c57b(0x203)]((_0x3be49a,_0x404e58)=>_0x3be49a[_0x54c57b(0x1f6)][_0x54c57b(0x1f1)](_0x404e58[_0x54c57b(0x1f6)])),_0x2f2c81['updatedAt']=_0x44d209;const _0xf5e6a9=writeServiceRegistry(_0x2f2c81,_0x1bc3c1);return{'registryPath':_0xf5e6a9,'entry':_0x51bef0[0x0],'replaced':_0x51bef0[_0x54c57b(0x1f4)]===0x1?_0x2e3534===0x1:_0x2e3534>0x0,'entries':_0x51bef0,'imported':_0x4723c8,'updated':_0x2e3534,'serviceCount':_0x2f2c81['services'][_0x54c57b(0x1f4)]};}export function exportServiceManifest(_0x1bcd87,_0x2a404f,_0x16d042={}){const _0x372cd7=a62_0x22ee08,_0x5392a6=getServiceRegistryPath(_0x16d042),_0x52a480=getLocalServiceEntry(_0x1bcd87,_0x16d042);if(!_0x52a480)throw CliErrors['validation'](_0x372cd7(0x1e9)+_0x1bcd87,_0x372cd7(0x1e7));const _0x47c9f4=resolve(_0x2a404f),_0x310afd=dirname(_0x47c9f4);return!existsSync(_0x310afd)&&mkdirSync(_0x310afd,{'recursive':!![]}),writeFileSync(_0x47c9f4,JSON[_0x372cd7(0x221)](_0x52a480[_0x372cd7(0x219)],null,0x2)+'\x0a',{'encoding':_0x372cd7(0x217),'mode':0x180}),{'registryPath':_0x5392a6,'filePath':_0x47c9f4,'entry':_0x52a480};}export function removeServiceManifest(_0x123e2f,_0x18a622={}){const _0xe83356=a62_0x22ee08,_0x4b889e=readServiceRegistry(_0x18a622),_0xe9bebd=_0x123e2f[_0xe83356(0x1f2)](),_0x5a0c2b=_0x4b889e[_0xe83356(0x201)][_0xe83356(0x1f0)](_0x244ad4=>_0x244ad4[_0xe83356(0x1f6)]===_0xe9bebd);if(_0x5a0c2b<0x0)throw CliErrors[_0xe83356(0x20c)](_0xe83356(0x1e9)+_0xe9bebd,_0xe83356(0x1e7));const [_0x2c5a57]=_0x4b889e[_0xe83356(0x201)]['splice'](_0x5a0c2b,0x1),_0x5dce42=(_0x18a622[_0xe83356(0x200)]??(()=>new Date()))()[_0xe83356(0x20e)]();_0x4b889e['updatedAt']=_0x5dce42;const _0xa5525c=writeServiceRegistry(_0x4b889e,_0x18a622);return{'registryPath':_0xa5525c,'entry':_0x2c5a57,'serviceCount':_0x4b889e[_0xe83356(0x201)][_0xe83356(0x1f4)]};}export function listLocalServices(_0x5f4e35={}){const _0x376384=a62_0x22ee08;return readServiceRegistry(_0x5f4e35)[_0x376384(0x201)];}export function getLocalServiceEntry(_0x217e8e,_0x11ce63={}){const _0x42afbe=a62_0x22ee08;return readServiceRegistry(_0x11ce63)[_0x42afbe(0x201)]['find'](_0x451803=>_0x451803[_0x42afbe(0x1f6)]===_0x217e8e[_0x42afbe(0x1f2)]());}export function listLocalServiceTrees(_0x3a3f04={}){const _0x2f45cd=a62_0x22ee08;return readServiceRegistry(_0x3a3f04)['services'][_0x2f45cd(0x209)](_0x4c6f94=>_0x4c6f94[_0x2f45cd(0x220)]);}export function inspectServiceRegistry(_0x330a7f={}){const _0x25209a=a62_0x22ee08,_0x7b6c00=getServiceRegistryPath(_0x330a7f);if(!existsSync(_0x7b6c00))return emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x1ec),![]);try{const _0x376939=readFileSync(_0x7b6c00,'utf8');if(!_0x376939['trim']())return emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x1d7),!![]);const _0x28d900=JSON[_0x25209a(0x1fd)](_0x376939);if(_0x28d900[_0x25209a(0x1f9)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x206),!![]),'schemaVersion':_0x28d900[_0x25209a(0x1f9)],'message':_0x25209a(0x1e5)+String(_0x28d900[_0x25209a(0x1f9)])};if(!Array[_0x25209a(0x208)](_0x28d900['services']))return{...emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x206),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x28d900[_0x25209a(0x1ef)],'message':'services\x20must\x20be\x20an\x20array'};const _0x19e5c3=_0x28d900[_0x25209a(0x201)]['map'](summarizeLocalServiceEntry);return{'registryPath':_0x7b6c00,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x28d900[_0x25209a(0x1ef)],'serviceCount':_0x19e5c3[_0x25209a(0x1f4)],'commandCount':_0x19e5c3['reduce']((_0x522bc7,_0x20925d)=>_0x522bc7+_0x20925d[_0x25209a(0x205)],0x0),'services':_0x19e5c3};}catch(_0xd85afb){return{...emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x206),!![]),'message':_0xd85afb instanceof Error?_0xd85afb[_0x25209a(0x21a)]:String(_0xd85afb)};}}export function formatValidationFailure(_0x516ad1){const _0x3b9a44=a62_0x22ee08,_0x4b5294=_0x516ad1['errors'][_0x3b9a44(0x209)](_0x46d03f=>_0x46d03f[_0x3b9a44(0x20b)]+':\x20'+_0x46d03f[_0x3b9a44(0x21a)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x4b5294['join']('\x0a');}function extractLoadedServiceManifests(_0x41d3dd,_0x25bc95){const _0xce39dd=a62_0x22ee08;if(!isServiceRegistryLike(_0x41d3dd)){const _0x4366eb=_0x41d3dd,{manifest:_0x5bc3bf,errors:_0x45ced5}=adaptServiceTreeManifestForLegacyFramework(_0x4366eb),_0x4d9631=validateServiceTreeManifest(_0x5bc3bf),_0x3f1b21=mergeValidationErrors(_0x4d9631,_0x45ced5);return[{'manifest':_0x4366eb,'report':_0x3f1b21,'normalizedManifest':_0x3f1b21['ok']?normalizeServiceTreeManifest(_0x5bc3bf):undefined,'sourceHash':_0x25bc95}];}return _0x41d3dd['services'][_0xce39dd(0x209)]((_0x3c650e,_0x163fa6)=>{const _0x20f98e=_0xce39dd,_0x4f7d92=isObjectRecord(_0x3c650e)?_0x3c650e[_0x20f98e(0x219)]:undefined,{manifest:_0x2898d7,errors:_0x59dc09}=adaptServiceTreeManifestForLegacyFramework(_0x4f7d92),_0x4de403=validateServiceTreeManifest(_0x2898d7),_0x3780f8=mergeValidationErrors(_0x4de403,_0x59dc09),_0x235652=isObjectRecord(_0x3c650e)&&typeof _0x3c650e[_0x20f98e(0x1f6)]===_0x20f98e(0x1de)?_0x3c650e['serviceCode']:undefined;return{'manifest':_0x4f7d92,'report':_0x3780f8,'normalizedManifest':_0x3780f8['ok']?normalizeServiceTreeManifest(_0x2898d7):undefined,'sourceHash':sha256(JSON[_0x20f98e(0x221)](_0x4f7d92,null,0x2)+'\x0a'),'registryIndex':_0x163fa6,'registryServiceCode':_0x235652};});}function mergeValidationErrors(_0x39e94b,_0x22a72e){const _0x4afd71=a62_0x22ee08,_0x2ce339=_0x39e94b[_0x4afd71(0x1dc)]['map'](_0x32bcaa=>_0x32bcaa['message']===_0x4afd71(0x1f5)?{..._0x32bcaa,'message':_0x4afd71(0x1f7)}:_0x32bcaa),_0x36249b=[..._0x22a72e,..._0x2ce339];return{'ok':_0x36249b[_0x4afd71(0x1f4)]===0x0,'errors':_0x36249b,'warnings':_0x39e94b[_0x4afd71(0x20d)]};}function aggregateValidationReports(_0x4e9c79){const _0x4d4dbc=a62_0x22ee08,_0x4708de=_0x4e9c79[_0x4d4dbc(0x214)](_0x1fb715=>_0x1fb715['registryIndex']===undefined?_0x1fb715['report'][_0x4d4dbc(0x1dc)]:_0x1fb715['report'][_0x4d4dbc(0x1dc)][_0x4d4dbc(0x209)](_0x26c7f4=>({..._0x26c7f4,'path':prefixRegistryIssuePath(_0x1fb715[_0x4d4dbc(0x1e4)],_0x26c7f4[_0x4d4dbc(0x20b)])}))),_0x5a8d7a=_0x4e9c79[_0x4d4dbc(0x214)](_0x2af385=>_0x2af385['registryIndex']===undefined?_0x2af385[_0x4d4dbc(0x212)][_0x4d4dbc(0x20d)]:_0x2af385[_0x4d4dbc(0x212)][_0x4d4dbc(0x20d)]['map'](_0xa7aa42=>({..._0xa7aa42,'path':prefixRegistryIssuePath(_0x2af385[_0x4d4dbc(0x1e4)],_0xa7aa42[_0x4d4dbc(0x20b)])})));return{'ok':_0x4708de[_0x4d4dbc(0x1f4)]===0x0,'errors':_0x4708de,'warnings':_0x5a8d7a};}function prefixRegistryIssuePath(_0x32422f,_0xf64b59){const _0x56fff0=a62_0x22ee08;if(_0xf64b59==='$')return _0x56fff0(0x213)+_0x32422f+'].manifest';if(_0xf64b59['startsWith']('$.'))return _0x56fff0(0x213)+_0x32422f+'].manifest'+_0xf64b59[_0x56fff0(0x1e2)](0x1);if(_0xf64b59['startsWith']('$['))return'$.services['+_0x32422f+'].manifest'+_0xf64b59[_0x56fff0(0x1e2)](0x1);return _0x56fff0(0x213)+_0x32422f+_0x56fff0(0x1e0)+_0xf64b59;}function isServiceRegistryLike(_0x591418){const _0x3cd162=a62_0x22ee08;return isObjectRecord(_0x591418)&&_0x591418[_0x3cd162(0x1f9)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x591418['services']);}function isObjectRecord(_0x205cd0){return Boolean(_0x205cd0)&&typeof _0x205cd0==='object'&&!Array['isArray'](_0x205cd0);}function emptyServiceRegistryInspection(_0xfd360e,_0x2a0eda,_0x346c61){return{'registryPath':_0xfd360e,'exists':_0x346c61,'status':_0x2a0eda,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x4298d2){const _0x504789=a62_0x22ee08,_0x1b39d9=_0x4298d2[_0x504789(0x220)],_0x4afd95=_0x1b39d9[_0x504789(0x202)][_0x504789(0x209)](_0x379b56=>({'path':_0x379b56[_0x504789(0x21d)],'description':_0x379b56['description'],'risk':_0x379b56[_0x504789(0x21b)],'targetKind':_0x379b56['target'][_0x504789(0x1dd)],'targetCommand':_0x379b56['target'][_0x504789(0x1e6)]}));return{'serviceCode':_0x4298d2[_0x504789(0x1f6)],'name':_0x1b39d9['service'][_0x504789(0x1ee)],'description':_0x1b39d9[_0x504789(0x215)][_0x504789(0x1df)],'version':_0x4298d2['version'],'importedAt':_0x4298d2['importedAt'],'source':_0x4298d2[_0x504789(0x21e)],'commandCount':_0x4afd95[_0x504789(0x1f4)],'commands':_0x4afd95};}function sha256(_0x19bd05){const _0x363b2c=a62_0x22ee08;return createHash(_0x363b2c(0x204))[_0x363b2c(0x1d6)](_0x19bd05)[_0x363b2c(0x1e1)](_0x363b2c(0x222));}
|
|
1
|
+
const a62_0x3f808c=a62_0x3f95;(function(_0x1c53a7,_0x7057d5){const _0x135ae9=a62_0x3f95,_0x2c916a=_0x1c53a7();while(!![]){try{const _0x254df9=-parseInt(_0x135ae9(0x192))/0x1*(-parseInt(_0x135ae9(0x1c6))/0x2)+parseInt(_0x135ae9(0x1a4))/0x3*(-parseInt(_0x135ae9(0x1aa))/0x4)+-parseInt(_0x135ae9(0x1b2))/0x5*(-parseInt(_0x135ae9(0x1c4))/0x6)+-parseInt(_0x135ae9(0x1a6))/0x7*(-parseInt(_0x135ae9(0x184))/0x8)+parseInt(_0x135ae9(0x1bf))/0x9*(parseInt(_0x135ae9(0x1c5))/0xa)+-parseInt(_0x135ae9(0x1ca))/0xb+-parseInt(_0x135ae9(0x1a5))/0xc*(parseInt(_0x135ae9(0x172))/0xd);if(_0x254df9===_0x7057d5)break;else _0x2c916a['push'](_0x2c916a['shift']());}catch(_0x29c1b2){_0x2c916a['push'](_0x2c916a['shift']());}}}(a62_0x2175,0xade66));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=a62_0x3f808c(0x170);export function getServiceRegistryPath(_0x1fff27={}){const _0x27434a=a62_0x3f808c;return resolve(_0x1fff27[_0x27434a(0x189)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x2fa873={}){const _0x367418=a62_0x3f808c,_0x449ae9=getServiceRegistryPath(_0x2fa873);if(!existsSync(_0x449ae9))return emptyServiceRegistry();try{const _0x27a550=readFileSync(_0x449ae9,_0x367418(0x180));if(!_0x27a550[_0x367418(0x1ba)]())return emptyServiceRegistry();const _0x23d6fd=JSON[_0x367418(0x1b8)](_0x27a550);if(_0x23d6fd[_0x367418(0x188)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x367418(0x1c8)+String(_0x23d6fd['schemaVersion']),_0x367418(0x19a)+_0x449ae9+'.');if(!Array[_0x367418(0x182)](_0x23d6fd[_0x367418(0x190)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x23d6fd[_0x367418(0x1ac)],'services':_0x23d6fd[_0x367418(0x190)]};}catch(_0x30348d){if(_0x30348d instanceof Error&&_0x30348d[_0x367418(0x1b1)]===_0x367418(0x1ae))throw _0x30348d;throw CliErrors[_0x367418(0x178)](_0x367418(0x196)+_0x449ae9,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x10c643,_0x4ea9ec={}){const _0xeccd81=a62_0x3f808c,_0x3260d5=getServiceRegistryPath(_0x4ea9ec),_0x52de02=dirname(_0x3260d5);!existsSync(_0x52de02)&&mkdirSync(_0x52de02,{'recursive':!![]});const _0x2f07bc=_0x3260d5+_0xeccd81(0x176);try{writeFileSync(_0x2f07bc,JSON[_0xeccd81(0x195)](_0x10c643,null,0x2)+'\x0a',{'encoding':_0xeccd81(0x180),'mode':0x180}),renameSync(_0x2f07bc,_0x3260d5);}catch(_0x47bc99){try{unlinkSync(_0x2f07bc);}catch{}if(_0x47bc99?.[_0xeccd81(0x174)]===_0xeccd81(0x193))throw CliErrors[_0xeccd81(0x178)](_0xeccd81(0x179)+_0x3260d5);throw _0x47bc99;}return _0x3260d5;}export function loadServiceManifestFromFile(_0x52f2d2){const _0x5b62a2=a62_0x3f808c,_0x23430e=resolve(_0x52f2d2);if(!existsSync(_0x23430e))throw CliErrors['validation'](_0x5b62a2(0x19b)+_0x52f2d2);let _0x36425c;const _0x4042ed=readFileSync(_0x23430e,_0x5b62a2(0x180));try{_0x36425c=JSON[_0x5b62a2(0x1b8)](_0x4042ed);}catch{throw CliErrors['validation']('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x52f2d2,_0x5b62a2(0x1a1));}const _0x5e5dfc=sha256(_0x4042ed),_0x417b06=extractLoadedServiceManifests(_0x36425c,_0x5e5dfc),_0x31ec97=aggregateValidationReports(_0x417b06),_0x2e628e=_0x417b06[0x0];return{'filePath':_0x23430e,'hash':_0x5e5dfc,'kind':isServiceRegistryLike(_0x36425c)?'registry':_0x5b62a2(0x1a8),'manifest':_0x2e628e?.[_0x5b62a2(0x1a8)]??_0x36425c,'report':_0x31ec97,'normalizedManifest':_0x417b06[_0x5b62a2(0x186)]===0x1?_0x2e628e?.[_0x5b62a2(0x19e)]:undefined,'manifests':_0x417b06};}export function importServiceManifest(_0x36d52a,_0x4e8583={}){const _0xc9bdd=a62_0x3f808c,_0xb83ed6=loadServiceManifestFromFile(_0x36d52a);if(!_0xb83ed6[_0xc9bdd(0x1b7)]['ok'])throw CliErrors[_0xc9bdd(0x178)](formatValidationFailure(_0xb83ed6[_0xc9bdd(0x1b7)]),_0xc9bdd(0x1a3));if(_0xb83ed6[_0xc9bdd(0x19d)][_0xc9bdd(0x186)]===0x0)throw CliErrors['validation']('Service\x20registry\x20has\x20no\x20services\x20to\x20import.',_0xc9bdd(0x1a9));const _0x56ac6a=readServiceRegistry(_0x4e8583),_0x495b7d=(_0x4e8583[_0xc9bdd(0x1bd)]??(()=>new Date()))()[_0xc9bdd(0x1c2)](),_0x11e1f1=[];let _0x2a0cfd=0x0,_0x5e96dc=0x0;for(const _0xd13877 of _0xb83ed6[_0xc9bdd(0x19d)]){if(!_0xd13877[_0xc9bdd(0x19e)])continue;const _0xc7e25b=_0xd13877['normalizedManifest'][_0xc9bdd(0x18e)][_0xc9bdd(0x174)],_0x46572f={'serviceCode':_0xc7e25b,'version':_0xd13877[_0xc9bdd(0x19e)]['version'],'importedAt':_0x495b7d,'source':{'type':_0xc9bdd(0x1bc),'path':_0xb83ed6[_0xc9bdd(0x1bb)],'hash':_0xd13877[_0xc9bdd(0x17a)]},'manifest':_0xd13877[_0xc9bdd(0x1a8)],'normalizedManifest':_0xd13877[_0xc9bdd(0x19e)]},_0xebc3d6=_0x56ac6a[_0xc9bdd(0x190)][_0xc9bdd(0x175)](_0xdb5392=>_0xdb5392[_0xc9bdd(0x17c)]===_0xc7e25b);_0xebc3d6>=0x0?(_0x56ac6a[_0xc9bdd(0x190)][_0xebc3d6]=_0x46572f,_0x5e96dc++):(_0x56ac6a[_0xc9bdd(0x190)][_0xc9bdd(0x199)](_0x46572f),_0x2a0cfd++),_0x11e1f1[_0xc9bdd(0x199)](_0x46572f);}_0x56ac6a['services'][_0xc9bdd(0x18b)]((_0xfee4a,_0xd0ca22)=>_0xfee4a[_0xc9bdd(0x17c)]['localeCompare'](_0xd0ca22['serviceCode'])),_0x56ac6a[_0xc9bdd(0x1ac)]=_0x495b7d;const _0x2a9860=writeServiceRegistry(_0x56ac6a,_0x4e8583);return{'registryPath':_0x2a9860,'entry':_0x11e1f1[0x0],'replaced':_0x11e1f1[_0xc9bdd(0x186)]===0x1?_0x5e96dc===0x1:_0x5e96dc>0x0,'entries':_0x11e1f1,'imported':_0x2a0cfd,'updated':_0x5e96dc,'serviceCount':_0x56ac6a['services'][_0xc9bdd(0x186)]};}export function exportServiceManifest(_0x2403a9,_0x1d5fdf,_0x39131a={}){const _0x37b592=a62_0x3f808c,_0x580522=getServiceRegistryPath(_0x39131a),_0x43a265=getLocalServiceEntry(_0x2403a9,_0x39131a);if(!_0x43a265)throw CliErrors[_0x37b592(0x178)](_0x37b592(0x1be)+_0x2403a9,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x2f7cb1=resolve(_0x1d5fdf),_0x44f0ae=dirname(_0x2f7cb1);return!existsSync(_0x44f0ae)&&mkdirSync(_0x44f0ae,{'recursive':!![]}),writeFileSync(_0x2f7cb1,JSON['stringify'](_0x43a265[_0x37b592(0x1a8)],null,0x2)+'\x0a',{'encoding':_0x37b592(0x180),'mode':0x180}),{'registryPath':_0x580522,'filePath':_0x2f7cb1,'entry':_0x43a265};}export function removeServiceManifest(_0x26e3c1,_0x37ef60={}){const _0x2b27c5=a62_0x3f808c,_0x32a03a=readServiceRegistry(_0x37ef60),_0x2b9035=_0x26e3c1['trim'](),_0x45aee5=_0x32a03a['services'][_0x2b27c5(0x175)](_0x2e3410=>_0x2e3410[_0x2b27c5(0x17c)]===_0x2b9035);if(_0x45aee5<0x0)throw CliErrors[_0x2b27c5(0x178)]('Local\x20service\x20not\x20found:\x20'+_0x2b9035,_0x2b27c5(0x1c9));const [_0x365f5b]=_0x32a03a['services'][_0x2b27c5(0x19c)](_0x45aee5,0x1),_0x2da03e=(_0x37ef60[_0x2b27c5(0x1bd)]??(()=>new Date()))()[_0x2b27c5(0x1c2)]();_0x32a03a['updatedAt']=_0x2da03e;const _0x38ec36=writeServiceRegistry(_0x32a03a,_0x37ef60);return{'registryPath':_0x38ec36,'entry':_0x365f5b,'serviceCount':_0x32a03a['services']['length']};}export function listLocalServices(_0x11fd54={}){return readServiceRegistry(_0x11fd54)['services'];}export function getLocalServiceEntry(_0x369191,_0x22f115={}){const _0x33adf6=a62_0x3f808c;return readServiceRegistry(_0x22f115)[_0x33adf6(0x190)][_0x33adf6(0x1cb)](_0x3acf4e=>_0x3acf4e['serviceCode']===_0x369191['trim']());}export function listLocalServiceTrees(_0x3b327c={}){const _0x167cf7=a62_0x3f808c;return readServiceRegistry(_0x3b327c)[_0x167cf7(0x190)][_0x167cf7(0x1b6)](_0x596824=>_0x596824[_0x167cf7(0x19e)]);}function a62_0x2175(){const _0x429d2c=['kind','2EglOnk','ENOENT','startsWith','stringify','Invalid\x20service\x20registry\x20JSON:\x20','Service\x20manifest\x20validation\x20failed:\x0a','message','push','Remove\x20or\x20migrate\x20','Service\x20manifest\x20file\x20not\x20found:\x20','splice','manifests','normalizedManifest','sha256','flatMap','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','warnings','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','3tXiDXB','48Lzqxdr','49HVtFyP','digest','manifest','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','5158684TjiGQF','object','updatedAt','string','CliError','invalid','hex','name','3166535YqxnSM','description','].manifest','Unsupported\x20schemaVersion:\x20','map','report','parse','target','trim','filePath','file','now','Local\x20service\x20not\x20found:\x20','847881YqrXrW','version','reduce','toISOString','services\x20must\x20be\x20an\x20array','12tMbUMq','20aqwsws','358962kGDffc','source','Unsupported\x20service\x20registry\x20schemaVersion:\x20','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','3875047pOkBxY','find','service.json','path','2649959hkeunM','importedAt','code','findIndex','.tmp','commands','validation','Cannot\x20write\x20service\x20registry:\x20','sourceHash','slice','serviceCode','registryIndex','join','cliPath','utf8','command','isArray','errors','1549280yBvNma','].manifest.','length','missing','schemaVersion','homeDir','commandCount','sort','$.services[','empty','service','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','services'];a62_0x2175=function(){return _0x429d2c;};return a62_0x2175();}export function inspectServiceRegistry(_0x2281cb={}){const _0x48d2bd=a62_0x3f808c,_0xb405ed=getServiceRegistryPath(_0x2281cb);if(!existsSync(_0xb405ed))return emptyServiceRegistryInspection(_0xb405ed,_0x48d2bd(0x187),![]);try{const _0xad6672=readFileSync(_0xb405ed,_0x48d2bd(0x180));if(!_0xad6672[_0x48d2bd(0x1ba)]())return emptyServiceRegistryInspection(_0xb405ed,_0x48d2bd(0x18d),!![]);const _0x48fcc0=JSON[_0x48d2bd(0x1b8)](_0xad6672);if(_0x48fcc0[_0x48d2bd(0x188)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0xb405ed,_0x48d2bd(0x1af),!![]),'schemaVersion':_0x48fcc0[_0x48d2bd(0x188)],'message':_0x48d2bd(0x1b5)+String(_0x48fcc0[_0x48d2bd(0x188)])};if(!Array[_0x48d2bd(0x182)](_0x48fcc0[_0x48d2bd(0x190)]))return{...emptyServiceRegistryInspection(_0xb405ed,_0x48d2bd(0x1af),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x48fcc0['updatedAt'],'message':_0x48d2bd(0x1c3)};const _0x32cb85=_0x48fcc0['services']['map'](summarizeLocalServiceEntry);return{'registryPath':_0xb405ed,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x48fcc0[_0x48d2bd(0x1ac)],'serviceCount':_0x32cb85[_0x48d2bd(0x186)],'commandCount':_0x32cb85[_0x48d2bd(0x1c1)]((_0x2fa622,_0x2c6458)=>_0x2fa622+_0x2c6458[_0x48d2bd(0x18a)],0x0),'services':_0x32cb85};}catch(_0x2f4825){return{...emptyServiceRegistryInspection(_0xb405ed,_0x48d2bd(0x1af),!![]),'message':_0x2f4825 instanceof Error?_0x2f4825[_0x48d2bd(0x198)]:String(_0x2f4825)};}}export function formatValidationFailure(_0x1e5d70){const _0x30b34c=a62_0x3f808c,_0x47291e=_0x1e5d70['errors']['map'](_0x2d6086=>_0x2d6086['path']+':\x20'+_0x2d6086[_0x30b34c(0x198)]);return _0x30b34c(0x197)+_0x47291e[_0x30b34c(0x17e)]('\x0a');}function extractLoadedServiceManifests(_0x123069,_0x560e9a){const _0xf4ffd9=a62_0x3f808c;if(!isServiceRegistryLike(_0x123069)){const _0x33600a=_0x123069,{manifest:_0x45aefa,errors:_0x460eed}=adaptServiceTreeManifestForLegacyFramework(_0x33600a),_0x3cc3b2=validateServiceTreeManifest(_0x45aefa),_0x1d34ba=mergeValidationErrors(_0x3cc3b2,_0x460eed);return[{'manifest':_0x33600a,'report':_0x1d34ba,'normalizedManifest':_0x1d34ba['ok']?normalizeServiceTreeManifest(_0x45aefa):undefined,'sourceHash':_0x560e9a}];}return _0x123069[_0xf4ffd9(0x190)][_0xf4ffd9(0x1b6)]((_0x48e97b,_0x1892f1)=>{const _0x31c3c5=_0xf4ffd9,_0x730309=isObjectRecord(_0x48e97b)?_0x48e97b[_0x31c3c5(0x1a8)]:undefined,{manifest:_0x4f7f5d,errors:_0xe9c787}=adaptServiceTreeManifestForLegacyFramework(_0x730309),_0x1cc58e=validateServiceTreeManifest(_0x4f7f5d),_0x1bd9a6=mergeValidationErrors(_0x1cc58e,_0xe9c787),_0x531dd6=isObjectRecord(_0x48e97b)&&typeof _0x48e97b[_0x31c3c5(0x17c)]===_0x31c3c5(0x1ad)?_0x48e97b[_0x31c3c5(0x17c)]:undefined;return{'manifest':_0x730309,'report':_0x1bd9a6,'normalizedManifest':_0x1bd9a6['ok']?normalizeServiceTreeManifest(_0x4f7f5d):undefined,'sourceHash':sha256(JSON[_0x31c3c5(0x195)](_0x730309,null,0x2)+'\x0a'),'registryIndex':_0x1892f1,'registryServiceCode':_0x531dd6};});}function mergeValidationErrors(_0x38bbc5,_0x2dcd18){const _0xdcfa9=a62_0x3f808c,_0x124fb9=_0x38bbc5[_0xdcfa9(0x183)][_0xdcfa9(0x1b6)](_0x565f23=>_0x565f23[_0xdcfa9(0x198)]===_0xdcfa9(0x18f)?{..._0x565f23,'message':'bff\x20target\x20requires\x20functionName.'}:_0x565f23),_0x2a5c74=[..._0x2dcd18,..._0x124fb9];return{'ok':_0x2a5c74[_0xdcfa9(0x186)]===0x0,'errors':_0x2a5c74,'warnings':_0x38bbc5[_0xdcfa9(0x1a2)]};}function aggregateValidationReports(_0x1ee233){const _0x5b4a5a=a62_0x3f808c,_0x135946=_0x1ee233[_0x5b4a5a(0x1a0)](_0x5858d7=>_0x5858d7[_0x5b4a5a(0x17d)]===undefined?_0x5858d7[_0x5b4a5a(0x1b7)][_0x5b4a5a(0x183)]:_0x5858d7[_0x5b4a5a(0x1b7)]['errors'][_0x5b4a5a(0x1b6)](_0x20974f=>({..._0x20974f,'path':prefixRegistryIssuePath(_0x5858d7['registryIndex'],_0x20974f['path'])}))),_0x3b8dd6=_0x1ee233[_0x5b4a5a(0x1a0)](_0x111258=>_0x111258[_0x5b4a5a(0x17d)]===undefined?_0x111258['report'][_0x5b4a5a(0x1a2)]:_0x111258[_0x5b4a5a(0x1b7)]['warnings'][_0x5b4a5a(0x1b6)](_0x53504f=>({..._0x53504f,'path':prefixRegistryIssuePath(_0x111258[_0x5b4a5a(0x17d)],_0x53504f[_0x5b4a5a(0x171)])})));return{'ok':_0x135946[_0x5b4a5a(0x186)]===0x0,'errors':_0x135946,'warnings':_0x3b8dd6};}function prefixRegistryIssuePath(_0x85edd1,_0x51bd82){const _0x25d8b6=a62_0x3f808c;if(_0x51bd82==='$')return _0x25d8b6(0x18c)+_0x85edd1+_0x25d8b6(0x1b4);if(_0x51bd82[_0x25d8b6(0x194)]('$.'))return _0x25d8b6(0x18c)+_0x85edd1+_0x25d8b6(0x1b4)+_0x51bd82['slice'](0x1);if(_0x51bd82[_0x25d8b6(0x194)]('$['))return _0x25d8b6(0x18c)+_0x85edd1+'].manifest'+_0x51bd82[_0x25d8b6(0x17b)](0x1);return _0x25d8b6(0x18c)+_0x85edd1+_0x25d8b6(0x185)+_0x51bd82;}function isServiceRegistryLike(_0x47abcc){const _0x6d2aba=a62_0x3f808c;return isObjectRecord(_0x47abcc)&&_0x47abcc['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x6d2aba(0x182)](_0x47abcc[_0x6d2aba(0x190)]);}function isObjectRecord(_0x446523){const _0x368436=a62_0x3f808c;return Boolean(_0x446523)&&typeof _0x446523===_0x368436(0x1ab)&&!Array[_0x368436(0x182)](_0x446523);}function emptyServiceRegistryInspection(_0xcbb946,_0x10bfc7,_0xb4c85c){return{'registryPath':_0xcbb946,'exists':_0xb4c85c,'status':_0x10bfc7,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x5426a1){const _0x44e389=a62_0x3f808c,_0x36f86c=_0x5426a1[_0x44e389(0x19e)],_0x5a1fce=_0x36f86c[_0x44e389(0x177)][_0x44e389(0x1b6)](_0x4110e2=>({'path':_0x4110e2[_0x44e389(0x17f)],'description':_0x4110e2[_0x44e389(0x1b3)],'risk':_0x4110e2['risk'],'targetKind':_0x4110e2[_0x44e389(0x1b9)][_0x44e389(0x191)],'targetCommand':_0x4110e2['target'][_0x44e389(0x181)]}));return{'serviceCode':_0x5426a1[_0x44e389(0x17c)],'name':_0x36f86c['service']['name'],'description':_0x36f86c[_0x44e389(0x18e)][_0x44e389(0x1b3)],'version':_0x5426a1[_0x44e389(0x1c0)],'importedAt':_0x5426a1[_0x44e389(0x173)],'source':_0x5426a1[_0x44e389(0x1c7)],'commandCount':_0x5a1fce['length'],'commands':_0x5a1fce};}function a62_0x3f95(_0x96793c,_0x4049f7){_0x96793c=_0x96793c-0x170;const _0x217552=a62_0x2175();let _0x3f9599=_0x217552[_0x96793c];return _0x3f9599;}function sha256(_0x27e85a){const _0x33547b=a62_0x3f808c;return createHash(_0x33547b(0x19f))['update'](_0x27e85a)[_0x33547b(0x1a7)](_0x33547b(0x1b0));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x159d38=a63_0x9fc1;function a63_0x9fc1(_0x3b1034,_0x5d6c35){_0x3b1034=_0x3b1034-0xf6;const _0x5df7d3=a63_0x5df7();let _0x9fc1c9=_0x5df7d3[_0x3b1034];return _0x9fc1c9;}(function(_0x578a11,_0x2198b3){const _0x4705fb=a63_0x9fc1,_0x51acff=_0x578a11();while(!![]){try{const _0x273118=-parseInt(_0x4705fb(0xf9))/0x1*(-parseInt(_0x4705fb(0xf8))/0x2)+parseInt(_0x4705fb(0xfe))/0x3*(-parseInt(_0x4705fb(0x112))/0x4)+parseInt(_0x4705fb(0xfb))/0x5*(-parseInt(_0x4705fb(0x10c))/0x6)+parseInt(_0x4705fb(0x10f))/0x7*(parseInt(_0x4705fb(0x109))/0x8)+parseInt(_0x4705fb(0x108))/0x9*(-parseInt(_0x4705fb(0x103))/0xa)+parseInt(_0x4705fb(0x117))/0xb+-parseInt(_0x4705fb(0x100))/0xc;if(_0x273118===_0x2198b3)break;else _0x51acff['push'](_0x51acff['shift']());}catch(_0x398e09){_0x51acff['push'](_0x51acff['shift']());}}}(a63_0x5df7,0x3e4ec));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a63_0x159d38(0x105),'command':a63_0x159d38(0x10e),'description':'创建本地自包含的运行态\x20Skill\x20草稿','risk':a63_0x159d38(0x113),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x2b00e2){const _0x2e7a4e=a63_0x159d38,_0x18307f=buildSkillCreatePlan(_0x2b00e2[_0x2e7a4e(0x102)](_0x2e7a4e(0x115)),_0x2b00e2[_0x2e7a4e(0x102)](_0x2e7a4e(0x104)),_0x2b00e2['str']('target'));return{'method':_0x2e7a4e(0xfc),'url':_0x18307f['skillDir'],'body':{'skillName':_0x18307f['rendered'][_0x2e7a4e(0x10a)],'type':_0x18307f['rendered'][_0x2e7a4e(0x104)],'selfContained':!![],'files':_0x18307f[_0x2e7a4e(0x106)][_0x2e7a4e(0xf7)][_0x2e7a4e(0x110)](_0x5ca2c2=>_0x5ca2c2[_0x2e7a4e(0xfd)])},'description':_0x2e7a4e(0xff)};},async 'execute'(_0x525d45){const _0x14a9eb=a63_0x159d38,_0x355d36=buildSkillCreatePlan(_0x525d45[_0x14a9eb(0x102)](_0x14a9eb(0x115)),_0x525d45[_0x14a9eb(0x102)](_0x14a9eb(0x104)),_0x525d45['str'](_0x14a9eb(0xfa)));return writeSkillDraft(_0x355d36,_0x525d45[_0x14a9eb(0x119)](_0x14a9eb(0x111))),{'ok':!![],'data':{'skillName':_0x355d36[_0x14a9eb(0x106)]['skillName'],'type':_0x355d36[_0x14a9eb(0x106)]['type'],'dir':_0x355d36['skillDir'],'files':_0x355d36[_0x14a9eb(0x106)][_0x14a9eb(0xf7)]['map'](_0x5a2404=>_0x5a2404[_0x14a9eb(0xfd)])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x355d36[_0x14a9eb(0x106)][_0x14a9eb(0x10a)]};}};function buildSkillCreatePlan(_0x44cbb9,_0xa99d45,_0x32476f){const _0x321248=a63_0x159d38,_0x59b552=_0xa99d45[_0x321248(0xf6)](),_0x5dab09=renderSkillTemplate({'skillName':_0x44cbb9,'type':_0x59b552});!_0x59b552&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0x5b9d61=resolve(normalizeSkillTarget(_0x32476f));return{'rendered':_0x5dab09,'targetRoot':_0x5b9d61,'skillDir':resolve(_0x5b9d61,_0x5dab09[_0x321248(0x10a)])};}function a63_0x5df7(){const _0x12dd5c=['3363262quMyOW','map','force','316ceXbWU','read','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','name','isSymbolicLink','4457068DbShwb','Refusing\x20to\x20overwrite\x20symlink:\x20','bool','skillDir','trim','files','54EbXJZx','3613SEAwAI','target','10XyaikX','WRITE','path','522yTUfkx','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','23016gSFAcY','Skill\x20directory\x20already\x20exists:\x20','str','2525710osDEyH','type','skill','rendered','validation','9oaZcZZ','8MOmVOD','skillName','isDirectory','1379274zWwJrl','content','create'];a63_0x5df7=function(){return _0x12dd5c;};return a63_0x5df7();}function normalizeSkillTarget(_0xa58c0d){const _0x1f5705=a63_0x159d38;return(_0xa58c0d||DEFAULT_SKILL_TARGET)[_0x1f5705(0xf6)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x4e418c,_0x391087){const _0x4d767b=a63_0x159d38;if(existsSync(_0x4e418c[_0x4d767b(0x11a)])){const _0xf240c7=lstatSync(_0x4e418c[_0x4d767b(0x11a)]);if(!_0xf240c7[_0x4d767b(0x10b)]()||_0xf240c7[_0x4d767b(0x116)]())throw CliErrors['validation'](_0x4d767b(0x114)+_0x4e418c[_0x4d767b(0x11a)]);if(!_0x391087)throw CliErrors['validation'](_0x4d767b(0x101)+_0x4e418c[_0x4d767b(0x11a)],'Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.');}for(const _0x240038 of _0x4e418c[_0x4d767b(0x106)][_0x4d767b(0xf7)]){const _0x23f0fe=resolve(_0x4e418c['skillDir'],_0x240038[_0x4d767b(0xfd)]),_0x15ca63=dirname(_0x23f0fe);mkdirSync(_0x15ca63,{'recursive':!![]});if(existsSync(_0x23f0fe)&&lstatSync(_0x23f0fe)[_0x4d767b(0x116)]())throw CliErrors[_0x4d767b(0x107)](_0x4d767b(0x118)+_0x23f0fe);writeFileSync(_0x23f0fe,_0x240038[_0x4d767b(0x10d)],'utf8');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x3a2ecd=a64_0x4b97;(function(_0x2b420f,_0x25e7fd){const _0x5bae48=a64_0x4b97,_0x41ef34=_0x2b420f();while(!![]){try{const _0x561b72=-parseInt(_0x5bae48(0x1c7))/0x1+parseInt(_0x5bae48(0x1d5))/0x2*(-parseInt(_0x5bae48(0x1bf))/0x3)+-parseInt(_0x5bae48(0x1b7))/0x4*(-parseInt(_0x5bae48(0x1b0))/0x5)+parseInt(_0x5bae48(0x1d2))/0x6*(parseInt(_0x5bae48(0x1cd))/0x7)+-parseInt(_0x5bae48(0x1bb))/0x8+parseInt(_0x5bae48(0x1cb))/0x9+parseInt(_0x5bae48(0x1b9))/0xa*(-parseInt(_0x5bae48(0x1c5))/0xb);if(_0x561b72===_0x25e7fd)break;else _0x41ef34['push'](_0x41ef34['shift']());}catch(_0x52b8d1){_0x41ef34['push'](_0x41ef34['shift']());}}}(a64_0x1c53,0xa44e8));function a64_0x1c53(){const _0x519535=['Created','found','action','6AVcEXv','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','diagram-show','diagram-validate','str','11EdBkCl','source-fingerprint','260532frBJXI','read','expectedDiagramRevision','scope','10677564rtnaAu','skillCode','1342425hHLsXP','Skill\x20diagram\x20validation\x20passed\x20for\x20','trim','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','company','30zYSMGy','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','isInteger','633736kkcuUc','expected-diagram-revision','Found\x20Skill\x20diagram\x20for\x20','version','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','num','89030eFUNZJ','\x20is\x20unchanged.','Updated','diagram-file','appCode','skill-code','skill','96SGefqY','validation','8232820ZOtioB',';\x20next\x20write\x20expects\x20revision\x20','1456520NanIft'];a64_0x1c53=function(){return _0x519535;};return a64_0x1c53();}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(_0x218bb6){const _0x4c7d7c=a64_0x4b97,_0x19eeb6=_0x218bb6['str'](_0x4c7d7c(0x1b5))['trim'](),_0x2f2bee=_0x218bb6['str'](_0x4c7d7c(0x1ad))['trim'](),_0x4735f3=_0x218bb6[_0x4c7d7c(0x1c4)](_0x4c7d7c(0x1ca));if(!_0x19eeb6||!_0x2f2bee||_0x4735f3!=='personal'&&_0x4735f3!==_0x4c7d7c(0x1d1))throw CliErrors['validation'](_0x4c7d7c(0x1c1));return{'skillCode':_0x19eeb6,'version':_0x2f2bee,'scope':_0x4735f3};}async function readDiagramWriteInput(_0x67e5ba){const _0x500062=a64_0x4b97,_0x2fe8f0=_0x67e5ba[_0x500062(0x1af)](_0x500062(0x1d6)),_0x805eaa=_0x67e5ba[_0x500062(0x1c4)](_0x500062(0x1c6))[_0x500062(0x1cf)]();if(!Number[_0x500062(0x1d4)](_0x2fe8f0)||_0x2fe8f0<0x0)throw CliErrors[_0x500062(0x1b8)]('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/['test'](_0x805eaa))throw CliErrors[_0x500062(0x1b8)](_0x500062(0x1d0));return{'expectedDiagramRevision':_0x2fe8f0,'sourceFingerprint':_0x805eaa,'diagram':await readRequiredSkillDiagram(_0x67e5ba[_0x500062(0x1c4)](_0x500062(0x1b3)))};}export const diagramValidateCommand={'service':'skill','command':a64_0x3a2ecd(0x1c3),'description':a64_0x3a2ecd(0x1ae),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x4bb2e7){const _0x8ed8c3=a64_0x3a2ecd,_0x3e2f0b=readDiagramTarget(_0x4bb2e7),_0x4b2b90=await validateRuntimeSkillVersionDiagram(_0x4bb2e7[_0x8ed8c3(0x1b4)],_0x3e2f0b['skillCode'],_0x3e2f0b['version'],_0x3e2f0b['scope'],await readDiagramWriteInput(_0x4bb2e7));return{'ok':!![],'data':_0x4b2b90,'message':_0x8ed8c3(0x1ce)+_0x3e2f0b[_0x8ed8c3(0x1cc)]+'@'+_0x3e2f0b[_0x8ed8c3(0x1ad)]+'.'};}};export const diagramPushCommand={'service':'skill','command':'diagram-push','description':a64_0x3a2ecd(0x1c0),'risk':'write','confirmationDescription':a64_0x3a2ecd(0x1d3),'flags':WRITE_FLAGS,async 'execute'(_0xec5a36){const _0x3c9f29=a64_0x3a2ecd,_0x121b9e=readDiagramTarget(_0xec5a36),_0x4473f4=await putRuntimeSkillVersionDiagram(_0xec5a36[_0x3c9f29(0x1b4)],_0x121b9e[_0x3c9f29(0x1cc)],_0x121b9e[_0x3c9f29(0x1ad)],_0x121b9e[_0x3c9f29(0x1ca)],await readDiagramWriteInput(_0xec5a36));return{'ok':!![],'data':_0x4473f4,'message':_0x4473f4['action']==='unchanged'?'Skill\x20diagram\x20for\x20'+_0x121b9e[_0x3c9f29(0x1cc)]+'@'+_0x121b9e[_0x3c9f29(0x1ad)]+_0x3c9f29(0x1b1):(_0x4473f4[_0x3c9f29(0x1be)]==='created'?_0x3c9f29(0x1bc):_0x3c9f29(0x1b2))+'\x20Skill\x20diagram\x20for\x20'+_0x121b9e[_0x3c9f29(0x1cc)]+'@'+_0x121b9e['version']+'.'};}};function a64_0x4b97(_0x39bfc9,_0x314498){_0x39bfc9=_0x39bfc9-0x1ad;const _0x1c536b=a64_0x1c53();let _0x4b97f0=_0x1c536b[_0x39bfc9];return _0x4b97f0;}export const diagramShowCommand={'service':a64_0x3a2ecd(0x1b6),'command':a64_0x3a2ecd(0x1c2),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':a64_0x3a2ecd(0x1c8),'flags':TARGET_FLAGS,async 'execute'(_0x31d170){const _0x773973=a64_0x3a2ecd,_0x3fe4c8=readDiagramTarget(_0x31d170),_0x131001=await getRuntimeSkillVersionDiagram(_0x31d170[_0x773973(0x1b4)],_0x3fe4c8['skillCode'],_0x3fe4c8[_0x773973(0x1ad)],_0x3fe4c8[_0x773973(0x1ca)]);return{'ok':!![],'data':_0x131001,'message':_0x131001[_0x773973(0x1bd)]?_0x773973(0x1d7)+_0x3fe4c8['skillCode']+'@'+_0x3fe4c8[_0x773973(0x1ad)]+_0x773973(0x1ba)+_0x131001[_0x773973(0x1c9)]+'.':'No\x20Skill\x20diagram\x20is\x20stored\x20for\x20'+_0x3fe4c8[_0x773973(0x1cc)]+'@'+_0x3fe4c8['version']+';\x20first\x20write\x20expects\x20revision\x20'+_0x131001[_0x773973(0x1c9)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a65_0x578385=a65_0x5156;(function(_0x1b992,_0x26e2a1){const _0x32509d=a65_0x5156,_0x24c1d1=_0x1b992();while(!![]){try{const _0x1263f5=parseInt(_0x32509d(0x1f6))/0x1*(-parseInt(_0x32509d(0x201))/0x2)+parseInt(_0x32509d(0x212))/0x3+-parseInt(_0x32509d(0x20e))/0x4*(-parseInt(_0x32509d(0x204))/0x5)+-parseInt(_0x32509d(0x1e7))/0x6*(-parseInt(_0x32509d(0x1f1))/0x7)+parseInt(_0x32509d(0x1f5))/0x8*(parseInt(_0x32509d(0x1fb))/0x9)+parseInt(_0x32509d(0x1fd))/0xa+-parseInt(_0x32509d(0x20b))/0xb;if(_0x1263f5===_0x26e2a1)break;else _0x24c1d1['push'](_0x24c1d1['shift']());}catch(_0x582945){_0x24c1d1['push'](_0x24c1d1['shift']());}}}(a65_0x2f31,0x1c865));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';const PACKAGE_DOWNLOAD_CONCURRENCY=0x4;export const installCommand={'service':'skill','command':a65_0x578385(0x210),'description':a65_0x578385(0x20d),'risk':a65_0x578385(0x1eb),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x33997f){return syncRuntimeSkills(_0x33997f);}};function a65_0x2f31(){const _0x2ca791=['trim','length','8DEWSeV','69014lcQjiu','../../../skills/runtime-skill-sync.js','min','all','map','1030023YffeRx','project','823710NGfVoo','bool','\x20company\x20Skill(s).','authRequired','4LKjqnm','company','envName','5wYJmPy','force','global','\x20personal\x20and\x20','includes','production','unchanged','2693724eWwofk','scope','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','608236NERziP','skipped','install','from','181830vRsgjX','skillCode','6WwVZkq','Installed\x20','removed','skillRoots','read','appCode','../../../core/api-client.js','action','filter','personal','631834yPOmOP','code'];a65_0x2f31=function(){return _0x2ca791;};return a65_0x2f31();}async function syncRuntimeSkills(_0x44c1f4){const _0x18a381=a65_0x578385,{downloadRuntimeSkillPackage:_0x5e3de7,listRuntimeSkills:_0x12e630}=await import(_0x18a381(0x1ed)),{linkEffectiveRuntimeSkills:_0x5233aa,materializeRuntimeSkill:_0x37a484,pruneStaleRuntimeSkillCache:_0x17b032,pruneStaleRuntimeSkillLinks:_0x35f24a,resolveRuntimeSkillInstallTarget:_0x2a7673,reuseMaterializedRuntimeSkill:_0x1c249c}=await import(_0x18a381(0x1f7)),_0x5e44cc=_0x44c1f4['str'](_0x18a381(0x1f2)),_0x4fe032=normalizeSyncScopes(_0x44c1f4['str']('scope')),_0x59d0a2=_0x44c1f4[_0x18a381(0x203)]??_0x18a381(0x209),_0x16c443=_0x44c1f4['accessKey'],_0x35ce7b=_0x44c1f4[_0x18a381(0x1fe)](_0x18a381(0x205));if(!_0x16c443)throw CliErrors[_0x18a381(0x200)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x53af8f=_0x2a7673(_0x44c1f4[_0x18a381(0x1ec)],_0x44c1f4[_0x18a381(0x1fe)](_0x18a381(0x1fc))?_0x18a381(0x1fc):_0x18a381(0x206)),_0x1bb8ba=_0x2a7673(_0x44c1f4[_0x18a381(0x1ec)],_0x53af8f['scope']===_0x18a381(0x1fc)?_0x18a381(0x206):_0x18a381(0x1fc)),_0x35729b=await _0x12e630({'appCode':_0x44c1f4[_0x18a381(0x1ec)],'scope':_0x4fe032[_0x18a381(0x1f4)]===0x1?_0x4fe032[0x0]:_0x18a381(0x1f9),'code':_0x5e44cc[_0x18a381(0x1f3)]()||undefined}),_0x57af90=_0x4fe032[_0x18a381(0x208)](_0x18a381(0x1f0))?_0x35729b['personal']:[],_0x3ad813=_0x4fe032[_0x18a381(0x208)](_0x18a381(0x202))?_0x35729b[_0x18a381(0x202)]:[],_0x3cedfc=new Set([..._0x57af90[_0x18a381(0x1fa)](_0x5c32de=>_0x5c32de[_0x18a381(0x1e6)]?.[_0x18a381(0x1f3)]())[_0x18a381(0x1ef)](_0x5627ed=>Boolean(_0x5627ed)),..._0x3ad813[_0x18a381(0x1fa)](_0x470994=>_0x470994['skillCode']?.[_0x18a381(0x1f3)]())[_0x18a381(0x1ef)](_0x43b404=>Boolean(_0x43b404))]),_0x3adfa6=_0x5e44cc[_0x18a381(0x1f3)]()?[_0x5e44cc[_0x18a381(0x1f3)]()]:undefined,_0x67f972=_0x4fe032[_0x18a381(0x1f4)]===0x2&&_0x4fe032[_0x18a381(0x208)](_0x18a381(0x1f0))&&_0x4fe032['includes'](_0x18a381(0x202)),_0x56fc63=_0x67f972?_0x35f24a(_0x53af8f,_0x3cedfc,_0x3adfa6):[],_0x179339=_0x17b032({'env':_0x59d0a2,'accessKey':_0x16c443,'appCode':_0x44c1f4[_0x18a381(0x1ec)],'activeSkillCodes':_0x3cedfc,'pruneSkillCodes':_0x3adfa6,'scopes':_0x4fe032,'protectedLinkRoots':_0x1bb8ba[_0x18a381(0x1ea)]}),_0x84694e=[..._0x57af90[_0x18a381(0x1fa)](_0x3ac383=>({'skill':_0x3ac383,'scope':_0x18a381(0x1f0)})),..._0x3ad813[_0x18a381(0x1fa)](_0x3db2cd=>({'skill':_0x3db2cd,'scope':'company'}))],_0x47d60e=await mapConcurrent(_0x84694e,PACKAGE_DOWNLOAD_CONCURRENCY,async({skill:_0x16a784,scope:_0x2a9fa8})=>{const _0x506f6b=_0x18a381,_0x5bd5ac=_0x1c249c(_0x16a784,_0x2a9fa8,{'env':_0x59d0a2,'accessKey':_0x16c443,'appCode':_0x44c1f4[_0x506f6b(0x1ec)]});if(_0x5bd5ac)return _0x5bd5ac;return _0x37a484(_0x16a784,_0x2a9fa8,{'env':_0x59d0a2,'accessKey':_0x16c443,'appCode':_0x44c1f4[_0x506f6b(0x1ec)],'force':_0x35ce7b,'packageBytes':await downloadSkillPackage(_0x16a784,_0x2a9fa8,_0x44c1f4[_0x506f6b(0x1ec)],_0x5e3de7)});}),_0x3c9c99=_0x5233aa(_0x47d60e,_0x53af8f),_0x4d22fc=countLinkActions(_0x3c9c99);return{'ok':!![],'data':{'appCode':_0x44c1f4[_0x18a381(0x1ec)],..._0x53af8f[_0x18a381(0x20c)]===_0x18a381(0x1fc)?{'installTarget':{'scope':_0x53af8f['scope'],'skillRoots':[..._0x53af8f[_0x18a381(0x1ea)]]}}:{},'personal':_0x57af90['length'],'company':_0x3ad813['length'],'materialized':_0x47d60e[_0x18a381(0x1f4)],'links':{'total':_0x3c9c99[_0x18a381(0x1f4)],'created':_0x4d22fc['created']??0x0,'updated':_0x4d22fc['updated']??0x0,'unchanged':_0x4d22fc[_0x18a381(0x20a)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x56fc63['filter'](_0x18d9b1=>_0x18d9b1[_0x18a381(0x1ee)]===_0x18a381(0x1e9))[_0x18a381(0x1f4)],'cacheDirs':_0x179339['filter'](_0x1cab4d=>_0x1cab4d[_0x18a381(0x1ee)]===_0x18a381(0x1e9))[_0x18a381(0x1f4)],'skipped':[..._0x56fc63,..._0x179339]['filter'](_0x30ffd4=>_0x30ffd4[_0x18a381(0x1ee)]===_0x18a381(0x20f))[_0x18a381(0x1f4)]},'skills':{'personal':_0x57af90[_0x18a381(0x1fa)](summarizeRuntimeSkill),'company':_0x3ad813[_0x18a381(0x1fa)](summarizeRuntimeSkill)}},'message':_0x18a381(0x1e8)+_0x57af90['length']+_0x18a381(0x207)+_0x3ad813[_0x18a381(0x1f4)]+_0x18a381(0x1ff)};}async function mapConcurrent(_0x1a8b29,_0x299db5,_0x44aac0){const _0x32c037=a65_0x578385,_0x45fc56=new Array(_0x1a8b29['length']);let _0x4d4b79=0x0;const _0x31a2b0=Array[_0x32c037(0x211)]({'length':Math[_0x32c037(0x1f8)](_0x299db5,_0x1a8b29['length'])},async()=>{const _0x598cce=_0x32c037;while(_0x4d4b79<_0x1a8b29[_0x598cce(0x1f4)]){const _0x20beac=_0x4d4b79;_0x4d4b79+=0x1,_0x45fc56[_0x20beac]=await _0x44aac0(_0x1a8b29[_0x20beac]);}});return await Promise[_0x32c037(0x1f9)](_0x31a2b0),_0x45fc56;}function a65_0x5156(_0x29c13e,_0x77ffaf){_0x29c13e=_0x29c13e-0x1e6;const _0x2f3132=a65_0x2f31();let _0x515605=_0x2f3132[_0x29c13e];return _0x515605;}async function downloadSkillPackage(_0x24a813,_0x3c0dd4,_0x3baef8,_0x39bade){const _0x413093=a65_0x578385,_0x46d63f=_0x24a813['version']?.[_0x413093(0x1f3)]();return _0x46d63f?_0x39bade(_0x3c0dd4,_0x24a813[_0x413093(0x1e6)],_0x3baef8,_0x46d63f):_0x39bade(_0x3c0dd4,_0x24a813[_0x413093(0x1e6)],_0x3baef8);}function countLinkActions(_0x18280b){return _0x18280b['reduce']((_0x3ca597,_0x47281d)=>{const _0xcaba97=a65_0x5156;return _0x3ca597[_0x47281d[_0xcaba97(0x1ee)]]=(_0x3ca597[_0x47281d[_0xcaba97(0x1ee)]]??0x0)+0x1,_0x3ca597;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x4c33e5=a66_0x3d48;(function(_0xba4c7e,_0x29be9f){const _0x102eee=a66_0x3d48,_0x29351a=_0xba4c7e();while(!![]){try{const _0x16cb84=-parseInt(_0x102eee(0x14f))/0x1+-parseInt(_0x102eee(0x149))/0x2+parseInt(_0x102eee(0x14e))/0x3*(parseInt(_0x102eee(0x13c))/0x4)+parseInt(_0x102eee(0x144))/0x5+-parseInt(_0x102eee(0x150))/0x6+-parseInt(_0x102eee(0x13e))/0x7*(-parseInt(_0x102eee(0x153))/0x8)+parseInt(_0x102eee(0x159))/0x9;if(_0x16cb84===_0x29be9f)break;else _0x29351a['push'](_0x29351a['shift']());}catch(_0x27c5d1){_0x29351a['push'](_0x29351a['shift']());}}}(a66_0x5885,0x6c313));function a66_0x3d48(_0x3cc887,_0x164130){_0x3cc887=_0x3cc887-0x13b;const _0x5885d7=a66_0x5885();let _0x3d48c6=_0x5885d7[_0x3cc887];return _0x3d48c6;}import{CliErrors}from'../../../errors.js';function a66_0x5885(){const _0x220911=['personal','code','length','authRequired','\x20local\x20Skill(s).','3759665tTjdKB','../../../core/api-client.js','company','accessKey','production','1016096TSxarP','project','envName','filter','skill','4647sKOPcw','828939UnKpIn','4208538xGwGsh','builtin','list','16424TjgZku','appCode','bool','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','scope','local','12783735XMAuyb','remote','str','../../../skills/runtime-skill-sync.js','Listed\x20','map','104ELxMgp','read','917SQCnmB'];a66_0x5885=function(){return _0x220911;};return a66_0x5885();}import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a66_0x4c33e5(0x14d),'command':a66_0x4c33e5(0x152),'description':a66_0x4c33e5(0x156),'risk':a66_0x4c33e5(0x13d),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0xfb4bcd){const _0x1738c2=a66_0x4c33e5,_0x3a1229=_0xfb4bcd[_0x1738c2(0x15b)](_0x1738c2(0x140)),_0x14a4c3=normalizeListScope(_0xfb4bcd[_0x1738c2(0x15b)](_0x1738c2(0x157)));if(_0xfb4bcd[_0x1738c2(0x155)]('local')){const _0x44a6f3=_0xfb4bcd[_0x1738c2(0x147)];if(!_0x44a6f3)throw CliErrors[_0x1738c2(0x142)]();const {listLocalRuntimeSkills:_0x5ef145,resolveRuntimeSkillInstallTarget:_0x25d9c3}=await import(_0x1738c2(0x15c)),_0x45a7f7=_0x25d9c3(_0xfb4bcd[_0x1738c2(0x154)],_0xfb4bcd[_0x1738c2(0x155)]('project')?_0x1738c2(0x14a):'global'),_0x3602d7=_0x5ef145({'env':_0xfb4bcd[_0x1738c2(0x14b)]??_0x1738c2(0x148),'accessKey':_0x44a6f3,'appCode':_0xfb4bcd['appCode'],'scopes':listScopeToRuntimeScopes(_0x14a4c3),'code':_0x3a1229['trim']()||undefined},_0x45a7f7),_0x5f40a5=groupLocalRuntimeSkills(_0x3602d7);return{'ok':!![],'data':{'appCode':_0xfb4bcd[_0x1738c2(0x154)],'source':_0x1738c2(0x158),..._0x45a7f7[_0x1738c2(0x157)]===_0x1738c2(0x14a)?{'installScope':_0x45a7f7[_0x1738c2(0x157)]}:{},'scope':_0x14a4c3,'total':_0x3602d7[_0x1738c2(0x141)],'personal':_0x5f40a5[_0x1738c2(0x13f)]['length'],'company':_0x5f40a5['company']['length'],'items':_0x3602d7[_0x1738c2(0x13b)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x5f40a5[_0x1738c2(0x13f)]['map'](summarizeLocalRuntimeSkill),'company':_0x5f40a5[_0x1738c2(0x146)][_0x1738c2(0x13b)](summarizeLocalRuntimeSkill)}},'message':'Listed\x20'+_0x3602d7[_0x1738c2(0x141)]+_0x1738c2(0x143)};}const {listRuntimeSkills:_0x2ea897}=await import(_0x1738c2(0x145)),_0x658399=await _0x2ea897({'appCode':_0xfb4bcd[_0x1738c2(0x154)],'scope':listScopeToRemoteScope(_0x14a4c3),'code':_0x3a1229['trim']()||undefined}),_0x2f7f28=shouldListScope(_0x14a4c3,_0x1738c2(0x13f))?_0x658399['personal']??[]:[],_0x390440=shouldListScope(_0x14a4c3,'company')?_0x658399['company']??[]:[],_0x414730=[..._0x2f7f28,..._0x390440];return{'ok':!![],'data':{'appCode':_0xfb4bcd['appCode'],'source':_0x1738c2(0x15a),'scope':_0x14a4c3,'total':_0x414730[_0x1738c2(0x141)],'personal':_0x2f7f28['length'],'company':_0x390440['length'],'items':_0x414730[_0x1738c2(0x13b)](summarizeRuntimeSkill),'skills':{'personal':_0x2f7f28['map'](summarizeRuntimeSkill),'company':_0x390440[_0x1738c2(0x13b)](summarizeRuntimeSkill)}},'message':_0x1738c2(0x15d)+_0x414730[_0x1738c2(0x141)]+'\x20remote\x20Skill(s).'};}};function groupLocalRuntimeSkills(_0x49af9f){const _0x3c65c0=a66_0x4c33e5;return{'personal':_0x49af9f['filter'](_0x29a282=>_0x29a282[_0x3c65c0(0x157)]===_0x3c65c0(0x13f)),'company':_0x49af9f[_0x3c65c0(0x14c)](_0x558a8d=>_0x558a8d[_0x3c65c0(0x157)]===_0x3c65c0(0x146)),'builtin':_0x49af9f['filter'](_0x1a31a2=>_0x1a31a2[_0x3c65c0(0x157)]===_0x3c65c0(0x151))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a67_0x42a7bf=a67_0x120b;(function(_0xbc7b15,_0x45dda3){const _0x2e4b7b=a67_0x120b,_0x9667ba=_0xbc7b15();while(!![]){try{const _0x565164=-parseInt(_0x2e4b7b(0x1eb))/0x1*(parseInt(_0x2e4b7b(0x1ef))/0x2)+-parseInt(_0x2e4b7b(0x1e6))/0x3*(-parseInt(_0x2e4b7b(0x1e4))/0x4)+-parseInt(_0x2e4b7b(0x1f0))/0x5+parseInt(_0x2e4b7b(0x1e7))/0x6*(parseInt(_0x2e4b7b(0x1e9))/0x7)+-parseInt(_0x2e4b7b(0x1f2))/0x8*(-parseInt(_0x2e4b7b(0x1ea))/0x9)+parseInt(_0x2e4b7b(0x1f3))/0xa+-parseInt(_0x2e4b7b(0x1ed))/0xb;if(_0x565164===_0x45dda3)break;else _0x9667ba['push'](_0x9667ba['shift']());}catch(_0x29ff77){_0x9667ba['push'](_0x9667ba['shift']());}}}(a67_0x4645,0xa030c));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';function a67_0x120b(_0x4fd061,_0x334096){_0x4fd061=_0x4fd061-0x1e4;const _0x4645da=a67_0x4645();let _0x120bdf=_0x4645da[_0x4fd061];return _0x120bdf;}import{skillPushDryRun,skillPushExecute}from'../push-execute.js';export const pushCommand={'service':a67_0x42a7bf(0x1e5),'command':a67_0x42a7bf(0x1f1),'description':a67_0x42a7bf(0x1ee),'risk':a67_0x42a7bf(0x1ec),'confirmationDescription':a67_0x42a7bf(0x1e8),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};function a67_0x4645(){const _0x153e74=['7365896ssNSGb','11656240uvkYqj','16BlocTg','skill','88635itMoaK','120cAldxX','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','172655uugJgp','9NOOTQZ','2072IFfZwh','write','7967795fxOPEq','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','530jNHGWk','3841380qjypPm','push'];a67_0x4645=function(){return _0x153e74;};return a67_0x4645();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a68_0x2bb8(_0x11c120,_0x4e6367){_0x11c120=_0x11c120-0x137;const _0x3254d5=a68_0x3254();let _0x2bb8ae=_0x3254d5[_0x11c120];return _0x2bb8ae;}const a68_0x5c1b9c=a68_0x2bb8;(function(_0x43b1c6,_0x4e4f0c){const _0x51477a=a68_0x2bb8,_0x21dae3=_0x43b1c6();while(!![]){try{const _0x122086=parseInt(_0x51477a(0x140))/0x1*(-parseInt(_0x51477a(0x147))/0x2)+parseInt(_0x51477a(0x141))/0x3+parseInt(_0x51477a(0x13b))/0x4+-parseInt(_0x51477a(0x14a))/0x5*(parseInt(_0x51477a(0x13c))/0x6)+-parseInt(_0x51477a(0x145))/0x7+-parseInt(_0x51477a(0x142))/0x8*(-parseInt(_0x51477a(0x139))/0x9)+-parseInt(_0x51477a(0x143))/0xa*(parseInt(_0x51477a(0x13a))/0xb);if(_0x122086===_0x4e4f0c)break;else _0x21dae3['push'](_0x21dae3['shift']());}catch(_0x21e006){_0x21dae3['push'](_0x21dae3['shift']());}}}(a68_0x3254,0x60fae));function a68_0x3254(){const _0x356419=['dir','strict','610dyaNcN','2369511VoSRyE','24yUOUPC','1690QPiHNv','skill','2494429BONtDF','Skill\x20validation\x20passed.','1038ugpysL','errors','str','515uqVWIW','warnings','bool','2190618hKhtkL','29711NQSkQr','459796mnESpr','6312HNMTBA','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package'];a68_0x3254=function(){return _0x356419;};return a68_0x3254();}import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a68_0x5c1b9c(0x144),'command':'validate','description':a68_0x5c1b9c(0x13d),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x3d1229){const _0x1dce80=a68_0x5c1b9c,_0x11d1e7=_0x3d1229[_0x1dce80(0x138)](_0x1dce80(0x13f)),_0x34942d=validateSkillDirectory(_0x3d1229[_0x1dce80(0x149)](_0x1dce80(0x13e)),{'strict':_0x11d1e7});return throwIfSkillValidationFailed(_0x34942d,_0x11d1e7),{'ok':!![],'data':{'dir':_0x34942d[_0x1dce80(0x13e)],'type':_0x34942d['type'],'errors':_0x34942d[_0x1dce80(0x148)],'warnings':_0x34942d[_0x1dce80(0x137)]},'message':_0x1dce80(0x146)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a69_0x59c2(_0x1c2b9e,_0x17873a){_0x1c2b9e=_0x1c2b9e-0xd7;const _0x451bde=a69_0x451b();let _0x59c2ca=_0x451bde[_0x1c2b9e];return _0x59c2ca;}(function(_0x5ec78d,_0x5d2efc){const _0x37f74f=a69_0x59c2,_0x1c83c7=_0x5ec78d();while(!![]){try{const _0x1765de=parseInt(_0x37f74f(0xdd))/0x1*(parseInt(_0x37f74f(0xd9))/0x2)+-parseInt(_0x37f74f(0xdc))/0x3+parseInt(_0x37f74f(0xe0))/0x4+parseInt(_0x37f74f(0xdb))/0x5*(-parseInt(_0x37f74f(0xd8))/0x6)+parseInt(_0x37f74f(0xde))/0x7+-parseInt(_0x37f74f(0xe5))/0x8*(-parseInt(_0x37f74f(0xda))/0x9)+-parseInt(_0x37f74f(0xe7))/0xa;if(_0x1765de===_0x5d2efc)break;else _0x1c83c7['push'](_0x1c83c7['shift']());}catch(_0x299f26){_0x1c83c7['push'](_0x1c83c7['shift']());}}}(a69_0x451b,0xbdd1b));import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x2dd0fd){const _0x51006c=a69_0x59c2;return(await readRequiredSkillDiagramInput(_0x2dd0fd))[_0x51006c(0xe2)];}export async function readRequiredSkillDiagramInput(_0xb287ce){const _0x2f1d5c=a69_0x59c2,_0x4bdbdb=_0xb287ce[_0x2f1d5c(0xeb)]();if(!_0x4bdbdb)throw CliErrors['validation'](_0x2f1d5c(0xe9),_0x2f1d5c(0xe3));let _0x39c311,_0x48209f;if(_0x4bdbdb==='-')try{_0x39c311=readFileSync(0x0,'utf8');}catch{throw CliErrors[_0x2f1d5c(0xee)](_0x2f1d5c(0xdf));}else{const _0x76c754=resolve(_0x4bdbdb);if(!existsSync(_0x76c754))throw CliErrors[_0x2f1d5c(0xee)]('Mermaid\x20flowchart\x20file\x20not\x20found:\x20'+_0x76c754);if(!statSync(_0x76c754)['isFile']())throw CliErrors[_0x2f1d5c(0xee)](_0x2f1d5c(0xe1)+_0x76c754);_0x48209f=realpathSync(_0x76c754),_0x39c311=readFileSync(_0x48209f,_0x2f1d5c(0xea));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x39c311)},'sourceFilePath':_0x48209f};}export async function validateAndCanonicalizeMermaid(_0x20c0e4){const _0x2f16a2=a69_0x59c2,_0x2395ad=_0x20c0e4[_0x2f16a2(0xec)](/\r\n/g,'\x0a')[_0x2f16a2(0xec)](/\r/g,'\x0a')[_0x2f16a2(0xec)](/\n+$/,'')+'\x0a';try{const _0x5c4818=await loadMermaidApi();await _0x5c4818['parse'](_0x2395ad);}catch{throw diagramValidationError();}return _0x2395ad;}function a69_0x451b(){const _0x14b9b3=['12893faaUmW','9605897tzhsjP','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','4442908MxHOnw','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','diagram','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','24qEtbmG','default','23021510wjgLvf','defineProperties','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','utf8','trim','replace','mermaid','validation','Mermaid\x20syntax\x20validation\x20failed.','document','24HlVFXl','8wRvcOz','3851271nAFgKf','704240GBqIhI','525855pVGhvL'];a69_0x451b=function(){return _0x14b9b3;};return a69_0x451b();}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x2df880=a69_0x59c2;if(!('window'in globalThis)||!(_0x2df880(0xd7)in globalThis)){const _0x2ac7c4=new JSDOM('');Object[_0x2df880(0xe8)](globalThis,{'window':{'configurable':!![],'value':_0x2ac7c4['window']},'document':{'configurable':!![],'value':_0x2ac7c4['window']['document']}});}return(await import(_0x2df880(0xed)))[_0x2df880(0xe6)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x14bd66=a69_0x59c2;return CliErrors[_0x14bd66(0xee)](_0x14bd66(0xef),_0x14bd66(0xe4));}
|