@lovrabet/lovrabet-cli 2.2.4-beta.1 → 2.2.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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.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/types.d.ts +1 -0
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +2 -2
- package/skills/lovrabet/references/lovrabet-skill-authoring.md +5 -4
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a57_0x5a117c=a57_0x47ab;(function(_0x476a31,_0x1d27de){const _0x36ac37=a57_0x47ab,_0x31a688=_0x476a31();while(!![]){try{const _0x5a99ee=parseInt(_0x36ac37(0x1e3))/0x1+-parseInt(_0x36ac37(0x1e2))/0x2+-parseInt(_0x36ac37(0x1bd))/0x3*(-parseInt(_0x36ac37(0x1cc))/0x4)+parseInt(_0x36ac37(0x1e5))/0x5+-parseInt(_0x36ac37(0x1ad))/0x6+-parseInt(_0x36ac37(0x1ef))/0x7*(-parseInt(_0x36ac37(0x1ea))/0x8)+parseInt(_0x36ac37(0x1d9))/0x9*(parseInt(_0x36ac37(0x1b8))/0xa);if(_0x5a99ee===_0x1d27de)break;else _0x31a688['push'](_0x31a688['shift']());}catch(_0x5cdce2){_0x31a688['push'](_0x31a688['shift']());}}}(a57_0xa78e,0x6496e));function a57_0x47ab(_0x39b948,_0x3cb060){_0x39b948=_0x39b948-0x1a7;const _0xa78ed6=a57_0xa78e();let _0x47abb8=_0xa78ed6[_0x39b948];return _0x47abb8;}import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a57_0x5a117c(0x1c6),'type':a57_0x5a117c(0x1c3),'required':!![],'enum':[a57_0x5a117c(0x1c9),a57_0x5a117c(0x1ba)],'description':a57_0x5a117c(0x1af)},CRON_FLAG={'name':a57_0x5a117c(0x1d6),'type':'string','description':a57_0x5a117c(0x1a8)},SCHEDULED_AT_FLAG={'name':a57_0x5a117c(0x1ce),'type':a57_0x5a117c(0x1c3),'description':a57_0x5a117c(0x1d7)},TITLE_FLAG={'name':a57_0x5a117c(0x1dc),'type':a57_0x5a117c(0x1c3),'required':!![],'description':a57_0x5a117c(0x1db)},PROMPT_FLAG={'name':a57_0x5a117c(0x1b7),'type':a57_0x5a117c(0x1c3),'required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},CHANNEL_FLAG={'name':a57_0x5a117c(0x1b5),'type':a57_0x5a117c(0x1c3),'enum':[a57_0x5a117c(0x1c0),a57_0x5a117c(0x1bb)],'default':a57_0x5a117c(0x1bb),'description':a57_0x5a117c(0x1cd)},SCHEDULE_ID_FLAG={'name':a57_0x5a117c(0x1cf),'type':a57_0x5a117c(0x1c3),'required':!![],'description':a57_0x5a117c(0x1c4),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a57_0x5a117c(0x1df)}},LIMIT_FLAG={'name':a57_0x5a117c(0x1dd),'type':a57_0x5a117c(0x1e7),'default':0x14,'description':'Page\x20size\x20from\x201\x20to\x20100'},CURSOR_FLAG={'name':a57_0x5a117c(0x1d1),'type':a57_0x5a117c(0x1c3),'description':a57_0x5a117c(0x1da)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x34f2b5){const _0x45004e=a57_0x5a117c,_0x5f5d52=_0x34f2b5[_0x45004e(0x1bc)]('kind'),_0x4be68a=_0x34f2b5['str'](_0x45004e(0x1dc))[_0x45004e(0x1b4)](),_0xd40ab2=_0x34f2b5[_0x45004e(0x1bc)](_0x45004e(0x1b7))['trim'](),_0x325e7a=_0x34f2b5['str'](_0x45004e(0x1b5)),_0x3ea79a=_0x34f2b5[_0x45004e(0x1bc)]('cron'),_0x2a3924=_0x34f2b5[_0x45004e(0x1bc)](_0x45004e(0x1ce));if(!_0x4be68a)throw CliErrors[_0x45004e(0x1d3)]('--title\x20must\x20not\x20be\x20blank.');if(!_0xd40ab2)throw CliErrors[_0x45004e(0x1d3)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x5f5d52==='CRON'){if(!_0x3ea79a||_0x2a3924)throw CliErrors[_0x45004e(0x1d3)](_0x45004e(0x1c1));return{'kind':_0x5f5d52,'timezone':'UTC','cron':_0x3ea79a,'title':_0x4be68a,'prompt':_0xd40ab2,'channel':_0x325e7a};}if(_0x5f5d52===_0x45004e(0x1ba)){if(!_0x2a3924||_0x3ea79a)throw CliErrors[_0x45004e(0x1d3)](_0x45004e(0x1b2));return{'kind':_0x5f5d52,'timezone':_0x45004e(0x1d2),'scheduledAt':_0x2a3924,'title':_0x4be68a,'prompt':_0xd40ab2,'channel':_0x325e7a};}throw CliErrors['validation'](_0x45004e(0x1ab));}function scheduleCollectionPath(_0x33de5e){const _0x69feea=a57_0x5a117c;return'/api/harness/apps/'+encodeURIComponent(_0x33de5e)+_0x69feea(0x1ed);}function a57_0xa78e(){const _0x3bdfb4=['POST','body','427192ZPRkNn','Task\x20channel:\x20auto\x20or\x20premium','scheduled-at','schedule-id','Created\x20','cursor','UTC','validation','read','validate','cron','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','description','3474gVUdwF','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','Schedule\x20title','title','limit','创建周期性或单次执行的\x20Agent\x20定时任务','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','Preview:\x20delete\x20schedule\x20','run','1152594vgLfZq','10879OhBQoy','scheduleId','1848585pWjUuH','detail','number','Preview:\x20create\x20an\x20Agent\x20schedule','delete','1336SUcrMc','isSafeInteger','schedule','/schedules','立即运行一次定时任务并创建\x20Task','21476yXEXnL','Deleted\x20schedule\x20','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','/run','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','build','4288554YqeTMp','Schedule\x20input\x20is\x20valid','Schedule\x20kind:\x20CRON\x20or\x20ONCE','create','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','trim','channel','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','prompt','1620oFJWFZ','list','ONCE','premium','str','21iVwtGd','length','num','auto','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','\x20schedule\x20','string','Schedule\x20UUID','appCode','kind','Queued\x20Task\x20','high-risk-write','CRON'];a57_0xa78e=function(){return _0x3bdfb4;};return a57_0xa78e();}function scheduleItemPath(_0x41d88b,_0x341961){return scheduleCollectionPath(_0x41d88b)+'/'+encodeURIComponent(_0x341961);}const scheduleValidate={'service':'schedule','command':a57_0x5a117c(0x1d5),'description':a57_0x5a117c(0x1b3),'risk':a57_0x5a117c(0x1d4),'flags':INPUT_FLAGS,async 'validate'(_0x225966){readScheduleInput(_0x225966);},async 'execute'(_0x7c6870){const _0x1c8e99=a57_0x5a117c,_0x2aaf3d=readScheduleInput(_0x7c6870),_0x5994ee=await validateRuntimeSchedule(_0x7c6870[_0x1c8e99(0x1c5)],_0x2aaf3d);return{'ok':!![],'data':_0x5994ee,'message':_0x1c8e99(0x1ae)};}},scheduleCreate={'service':a57_0x5a117c(0x1ec),'command':a57_0x5a117c(0x1b0),'description':a57_0x5a117c(0x1de),'risk':'high-risk-write','confirmationDescription':'将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','flags':INPUT_FLAGS,async 'validate'(_0x2df432){readScheduleInput(_0x2df432);},async 'execute'(_0x459907){const _0x4473d2=a57_0x5a117c,_0xccd1b3=readScheduleInput(_0x459907),_0x24540c=await validateRuntimeSchedule(_0x459907[_0x4473d2(0x1c5)],_0xccd1b3),_0x55d81f=await createRuntimeSchedule(_0x459907['appCode'],_0x24540c);return{'ok':!![],'data':_0x55d81f,'message':_0x4473d2(0x1d0)+_0x55d81f[_0x4473d2(0x1c6)]+_0x4473d2(0x1c2)+_0x55d81f[_0x4473d2(0x1e4)]};},async 'dryRun'(_0xfa9404){const _0x180d47=a57_0x5a117c,_0x2969bb=readScheduleInput(_0xfa9404);return dryRun('POST',scheduleCollectionPath(_0xfa9404[_0x180d47(0x1c5)]))[_0x180d47(0x1cb)](_0x2969bb)[_0x180d47(0x1d8)](_0x180d47(0x1e8))[_0x180d47(0x1ac)]();}},scheduleList={'service':'schedule','command':a57_0x5a117c(0x1b9),'description':a57_0x5a117c(0x1a9),'risk':'read','flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x114e54){const _0x269ec5=a57_0x5a117c,_0x4b76f4=_0x114e54[_0x269ec5(0x1bf)]('limit');if(!Number[_0x269ec5(0x1eb)](_0x4b76f4)||_0x4b76f4<0x1||_0x4b76f4>0x64)throw CliErrors[_0x269ec5(0x1d3)](_0x269ec5(0x1b1));const _0x3c3bf5=_0x114e54[_0x269ec5(0x1bc)](_0x269ec5(0x1d1));if(_0x3c3bf5&&(_0x3c3bf5[_0x269ec5(0x1be)]>0x400||_0x3c3bf5[_0x269ec5(0x1b4)]()!==_0x3c3bf5))throw CliErrors[_0x269ec5(0x1d3)](_0x269ec5(0x1b6));},async 'execute'(_0x7522a7){const _0x202d8c=a57_0x5a117c,_0x133709=_0x7522a7[_0x202d8c(0x1bc)](_0x202d8c(0x1d1)),_0x5f3ec5=await listRuntimeSchedules(_0x7522a7['appCode'],{'kind':_0x7522a7[_0x202d8c(0x1bc)](_0x202d8c(0x1c6)),'limit':_0x7522a7[_0x202d8c(0x1bf)](_0x202d8c(0x1dd)),..._0x133709?{'cursor':_0x133709}:{}});return{'ok':!![],'data':_0x5f3ec5};}},scheduleDetail={'service':a57_0x5a117c(0x1ec),'command':a57_0x5a117c(0x1e6),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1b6ccb){const _0xc54890=a57_0x5a117c,_0x104c32=await getRuntimeSchedule(_0x1b6ccb[_0xc54890(0x1c5)],_0x1b6ccb[_0xc54890(0x1bc)](_0xc54890(0x1cf)));return{'ok':!![],'data':_0x104c32};}},scheduleRun={'service':a57_0x5a117c(0x1ec),'command':a57_0x5a117c(0x1e1),'description':a57_0x5a117c(0x1ee),'risk':a57_0x5a117c(0x1c8),'confirmationDescription':'将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x120553){const _0x58eb2d=a57_0x5a117c,_0x44c1e2=_0x120553[_0x58eb2d(0x1bc)]('schedule-id'),_0x40f88b=await runRuntimeSchedule(_0x120553[_0x58eb2d(0x1c5)],_0x44c1e2);return{'ok':!![],'data':_0x40f88b,'message':_0x58eb2d(0x1c7)+_0x40f88b['taskId']+'\x20from\x20schedule\x20'+_0x44c1e2};},async 'dryRun'(_0x1b53a4){const _0x38b8dc=a57_0x5a117c,_0x3a50ab=_0x1b53a4[_0x38b8dc(0x1bc)](_0x38b8dc(0x1cf));return dryRun(_0x38b8dc(0x1ca),scheduleItemPath(_0x1b53a4[_0x38b8dc(0x1c5)],_0x3a50ab)+_0x38b8dc(0x1aa))[_0x38b8dc(0x1d8)]('Preview:\x20run\x20schedule\x20'+_0x3a50ab+'\x20immediately')[_0x38b8dc(0x1ac)]();}},scheduleDelete={'service':a57_0x5a117c(0x1ec),'command':a57_0x5a117c(0x1e9),'description':'删除定时任务并停止其后续触发','risk':'high-risk-write','confirmationDescription':'将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x4551e1){const _0x2bd1e2=a57_0x5a117c,_0x33ffa5=_0x4551e1[_0x2bd1e2(0x1bc)](_0x2bd1e2(0x1cf)),_0x939d89=await deleteRuntimeSchedule(_0x4551e1[_0x2bd1e2(0x1c5)],_0x33ffa5);return{'ok':!![],'data':_0x939d89,'message':_0x2bd1e2(0x1a7)+_0x33ffa5};},async 'dryRun'(_0x3ec084){const _0x451e82=a57_0x5a117c,_0x21af27=_0x3ec084['str'](_0x451e82(0x1cf));return dryRun('DELETE',scheduleItemPath(_0x3ec084['appCode'],_0x21af27))[_0x451e82(0x1d8)](_0x451e82(0x1e0)+_0x21af27)[_0x451e82(0x1ac)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
|
1
|
+
const a57_0x240d68=a57_0x30c3;(function(_0x1f9cf0,_0x3f1d95){const _0xfdb6ac=a57_0x30c3,_0x198b39=_0x1f9cf0();while(!![]){try{const _0x26a3d1=parseInt(_0xfdb6ac(0x8b))/0x1*(-parseInt(_0xfdb6ac(0x93))/0x2)+parseInt(_0xfdb6ac(0x8e))/0x3+-parseInt(_0xfdb6ac(0x92))/0x4+-parseInt(_0xfdb6ac(0x84))/0x5+parseInt(_0xfdb6ac(0xa0))/0x6*(parseInt(_0xfdb6ac(0xa6))/0x7)+parseInt(_0xfdb6ac(0x87))/0x8+-parseInt(_0xfdb6ac(0x8f))/0x9;if(_0x26a3d1===_0x3f1d95)break;else _0x198b39['push'](_0x198b39['shift']());}catch(_0x318738){_0x198b39['push'](_0x198b39['shift']());}}}(a57_0x5760,0xa34ad));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a57_0x30c3(_0x4f2531,_0x28e5b2){_0x4f2531=_0x4f2531-0x6d;const _0x5760ca=a57_0x5760();let _0x30c369=_0x5760ca[_0x4f2531];return _0x30c369;}const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':'kind','type':'string','required':!![],'enum':[a57_0x240d68(0xab),a57_0x240d68(0xa3)],'description':a57_0x240d68(0x9e)},CRON_FLAG={'name':a57_0x240d68(0x73),'type':a57_0x240d68(0x9c),'description':a57_0x240d68(0x7f)},SCHEDULED_AT_FLAG={'name':'scheduled-at','type':a57_0x240d68(0x9c),'description':a57_0x240d68(0x88)},TITLE_FLAG={'name':a57_0x240d68(0x7b),'type':'string','required':!![],'description':a57_0x240d68(0xa5)},PROMPT_FLAG={'name':'prompt','type':a57_0x240d68(0x9c),'required':!![],'description':a57_0x240d68(0x78)},CHANNEL_FLAG={'name':'channel','type':a57_0x240d68(0x9c),'enum':[a57_0x240d68(0x7c),'premium'],'default':a57_0x240d68(0x9f),'description':a57_0x240d68(0x7a)},SCHEDULE_ID_FLAG={'name':a57_0x240d68(0xa1),'type':a57_0x240d68(0x9c),'required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a57_0x240d68(0x82)}},LIMIT_FLAG={'name':a57_0x240d68(0x7e),'type':a57_0x240d68(0x9d),'default':0x14,'description':'Page\x20size\x20from\x201\x20to\x20100'},CURSOR_FLAG={'name':a57_0x240d68(0x70),'type':a57_0x240d68(0x9c),'description':a57_0x240d68(0x9b)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x52b1b3){const _0x423c30=a57_0x240d68,_0x640e3b=_0x52b1b3[_0x423c30(0xa7)](_0x423c30(0x95)),_0x2190e3=_0x52b1b3[_0x423c30(0xa7)](_0x423c30(0x7b))[_0x423c30(0x99)](),_0x49a82e=_0x52b1b3['str'](_0x423c30(0x8c))['trim'](),_0x128dfa=_0x52b1b3[_0x423c30(0xa7)](_0x423c30(0x89)),_0x410947=_0x52b1b3['str'](_0x423c30(0x73)),_0x50a378=_0x52b1b3[_0x423c30(0xa7)](_0x423c30(0x96));if(!_0x2190e3)throw CliErrors[_0x423c30(0xa8)]('--title\x20must\x20not\x20be\x20blank.');if(!_0x49a82e)throw CliErrors['validation'](_0x423c30(0x74));if(_0x640e3b==='CRON'){if(!_0x410947||_0x50a378)throw CliErrors[_0x423c30(0xa8)](_0x423c30(0x6e));return{'kind':_0x640e3b,'timezone':_0x423c30(0x79),'cron':_0x410947,'title':_0x2190e3,'prompt':_0x49a82e,'channel':_0x128dfa};}if(_0x640e3b===_0x423c30(0xa3)){if(!_0x50a378||_0x410947)throw CliErrors['validation'](_0x423c30(0x98));return{'kind':_0x640e3b,'timezone':_0x423c30(0x79),'scheduledAt':_0x50a378,'title':_0x2190e3,'prompt':_0x49a82e,'channel':_0x128dfa};}throw CliErrors[_0x423c30(0xa8)]('--kind\x20must\x20be\x20CRON\x20or\x20ONCE.');}function scheduleCollectionPath(_0x246301){const _0x141add=a57_0x240d68;return _0x141add(0xae)+encodeURIComponent(_0x246301)+_0x141add(0x83);}function scheduleItemPath(_0x165340,_0x2ea00c){return scheduleCollectionPath(_0x165340)+'/'+encodeURIComponent(_0x2ea00c);}const scheduleValidate={'service':'schedule','command':'validate','description':a57_0x240d68(0xad),'risk':a57_0x240d68(0x76),'flags':INPUT_FLAGS,async 'validate'(_0x3395ca){readScheduleInput(_0x3395ca);},async 'execute'(_0x2291c5){const _0x322347=a57_0x240d68,_0x26a792=readScheduleInput(_0x2291c5),_0x5e7acd=await validateRuntimeSchedule(_0x2291c5[_0x322347(0x72)],_0x26a792);return{'ok':!![],'data':_0x5e7acd,'message':'Schedule\x20input\x20is\x20valid'};}},scheduleCreate={'service':a57_0x240d68(0xa2),'command':a57_0x240d68(0x71),'description':a57_0x240d68(0xac),'risk':a57_0x240d68(0x75),'confirmationDescription':a57_0x240d68(0xa9),'flags':INPUT_FLAGS,async 'validate'(_0x9641c){readScheduleInput(_0x9641c);},async 'execute'(_0x1faa53){const _0x4aea0d=a57_0x240d68,_0x452622=readScheduleInput(_0x1faa53),_0x57a27d=await validateRuntimeSchedule(_0x1faa53[_0x4aea0d(0x72)],_0x452622),_0x369a03=await createRuntimeSchedule(_0x1faa53['appCode'],_0x57a27d);return{'ok':!![],'data':_0x369a03,'message':'Created\x20'+_0x369a03[_0x4aea0d(0x95)]+_0x4aea0d(0x9a)+_0x369a03[_0x4aea0d(0x97)]};},async 'dryRun'(_0x461067){const _0x32b103=a57_0x240d68,_0x103797=readScheduleInput(_0x461067);return dryRun(_0x32b103(0xa4),scheduleCollectionPath(_0x461067['appCode']))[_0x32b103(0x7d)](_0x103797)['description'](_0x32b103(0x77))[_0x32b103(0x6f)]();}},scheduleList={'service':a57_0x240d68(0xa2),'command':'list','description':a57_0x240d68(0x86),'risk':a57_0x240d68(0x76),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x778306){const _0x12319c=a57_0x240d68,_0x185678=_0x778306['num'](_0x12319c(0x7e));if(!Number['isSafeInteger'](_0x185678)||_0x185678<0x1||_0x185678>0x64)throw CliErrors[_0x12319c(0xa8)]('--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');const _0x444b6f=_0x778306[_0x12319c(0xa7)]('cursor');if(_0x444b6f&&(_0x444b6f['length']>0x400||_0x444b6f['trim']()!==_0x444b6f))throw CliErrors['validation'](_0x12319c(0x90));},async 'execute'(_0x14dc0f){const _0x5d6e33=a57_0x240d68,_0x59c9e4=_0x14dc0f[_0x5d6e33(0xa7)](_0x5d6e33(0x70)),_0x4948c0=await listRuntimeSchedules(_0x14dc0f['appCode'],{'kind':_0x14dc0f[_0x5d6e33(0xa7)](_0x5d6e33(0x95)),'limit':_0x14dc0f['num'](_0x5d6e33(0x7e)),..._0x59c9e4?{'cursor':_0x59c9e4}:{}});return{'ok':!![],'data':_0x4948c0};}},scheduleDetail={'service':a57_0x240d68(0xa2),'command':'detail','description':a57_0x240d68(0xaa),'risk':a57_0x240d68(0x76),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x159a52){const _0x594d88=a57_0x240d68,_0x50958f=await getRuntimeSchedule(_0x159a52[_0x594d88(0x72)],_0x159a52[_0x594d88(0xa7)](_0x594d88(0xa1)));return{'ok':!![],'data':_0x50958f};}},scheduleRun={'service':a57_0x240d68(0xa2),'command':a57_0x240d68(0x94),'description':'立即运行一次定时任务并创建\x20Task','risk':a57_0x240d68(0x75),'confirmationDescription':a57_0x240d68(0x81),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x47e702){const _0x3985e1=a57_0x240d68,_0x5aee8b=_0x47e702[_0x3985e1(0xa7)]('schedule-id'),_0xedef97=await runRuntimeSchedule(_0x47e702[_0x3985e1(0x72)],_0x5aee8b);return{'ok':!![],'data':_0xedef97,'message':_0x3985e1(0x8a)+_0xedef97['taskId']+_0x3985e1(0x80)+_0x5aee8b};},async 'dryRun'(_0x480d70){const _0x275a7a=a57_0x240d68,_0x2fde06=_0x480d70[_0x275a7a(0xa7)]('schedule-id');return dryRun(_0x275a7a(0xa4),scheduleItemPath(_0x480d70[_0x275a7a(0x72)],_0x2fde06)+_0x275a7a(0xaf))[_0x275a7a(0x85)]('Preview:\x20run\x20schedule\x20'+_0x2fde06+_0x275a7a(0x91))['build']();}},scheduleDelete={'service':a57_0x240d68(0xa2),'command':a57_0x240d68(0x8d),'description':a57_0x240d68(0xb0),'risk':a57_0x240d68(0x75),'confirmationDescription':a57_0x240d68(0x6d),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x31c290){const _0x50615f=a57_0x240d68,_0x471632=_0x31c290[_0x50615f(0xa7)]('schedule-id'),_0x3c59d8=await deleteRuntimeSchedule(_0x31c290['appCode'],_0x471632);return{'ok':!![],'data':_0x3c59d8,'message':'Deleted\x20schedule\x20'+_0x471632};},async 'dryRun'(_0x2d8de1){const _0x5a2051=a57_0x240d68,_0x27c8ec=_0x2d8de1[_0x5a2051(0xa7)](_0x5a2051(0xa1));return dryRun('DELETE',scheduleItemPath(_0x2d8de1[_0x5a2051(0x72)],_0x27c8ec))[_0x5a2051(0x85)]('Preview:\x20delete\x20schedule\x20'+_0x27c8ec)[_0x5a2051(0x6f)]();}};function a57_0x5760(){const _0x28684c=['a\x20UUID\x20returned\x20by\x20schedule\x20create/list','/schedules','4367955GiWHPr','description','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','8010872vXyEGv','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','channel','Queued\x20Task\x20','32753ISHwsK','prompt','delete','1419141PctgyL','2392587cSWkpd','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','\x20immediately','2897300RVFPrb','6OeHAIP','run','kind','scheduled-at','scheduleId','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','trim','\x20schedule\x20','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','string','number','Schedule\x20kind:\x20CRON\x20or\x20ONCE','premium','6938742czHqYo','schedule-id','schedule','ONCE','POST','Schedule\x20title','7Hwcdlg','str','validation','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','Show\x20one\x20schedule\x20by\x20schedule\x20ID','CRON','创建周期性或单次执行的\x20Agent\x20定时任务','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','/api/harness/apps/','/run','删除定时任务并停止其后续触发','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','build','cursor','create','appCode','cron','--prompt\x20must\x20not\x20be\x20blank.','high-risk-write','read','Preview:\x20create\x20an\x20Agent\x20schedule','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','UTC','Task\x20channel:\x20auto\x20or\x20premium','title','auto','body','limit','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','\x20from\x20schedule\x20','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。'];a57_0x5760=function(){return _0x28684c;};return a57_0x5760();}export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a58_0x3b04(_0x1d5e1e,_0x1c73a7){_0x1d5e1e=_0x1d5e1e-0x1e7;const _0x44bbce=a58_0x44bb();let _0x3b0404=_0x44bbce[_0x1d5e1e];return _0x3b0404;}const a58_0x213ba4=a58_0x3b04;(function(_0x59fc82,_0x73043e){const _0x36dba6=a58_0x3b04,_0x454e4c=_0x59fc82();while(!![]){try{const _0x2de743=-parseInt(_0x36dba6(0x1ef))/0x1*(-parseInt(_0x36dba6(0x1f0))/0x2)+parseInt(_0x36dba6(0x1ed))/0x3*(-parseInt(_0x36dba6(0x1e7))/0x4)+-parseInt(_0x36dba6(0x1ee))/0x5+parseInt(_0x36dba6(0x1f1))/0x6+-parseInt(_0x36dba6(0x1f2))/0x7*(parseInt(_0x36dba6(0x1eb))/0x8)+-parseInt(_0x36dba6(0x1ec))/0x9+parseInt(_0x36dba6(0x1ea))/0xa;if(_0x2de743===_0x73043e)break;else _0x454e4c['push'](_0x454e4c['shift']());}catch(_0x1d2174){_0x454e4c['push'](_0x454e4c['shift']());}}}(a58_0x44bb,0xaa9e6));function a58_0x44bb(){const _0x4b92c6=['71268qETbyF','read','export','30699010GmwKeS','296rgLUeU','8715762atMTuP','183QYdEFg','6503185zjKDFm','108649EILfgR','4tKKUAZ','8269170UrUIAi','115528kMtyAF'];a58_0x44bb=function(){return _0x4b92c6;};return a58_0x44bb();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x502e11){const _0x1989dd=await buildSchemaPayload();return{'ok':!![],'data':_0x1989dd};}export const schemaDefinition={'service':'schema','command':a58_0x213ba4(0x1e9),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a58_0x213ba4(0x1e8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x52e61f,_0x3304c0){const _0x296458=a59_0x21f5,_0xf6c0dc=_0x52e61f();while(!![]){try{const _0x182f9d=parseInt(_0x296458(0xf2))/0x1+-parseInt(_0x296458(0x128))/0x2+-parseInt(_0x296458(0x118))/0x3+-parseInt(_0x296458(0xf1))/0x4+parseInt(_0x296458(0x12c))/0x5+-parseInt(_0x296458(0xdc))/0x6+parseInt(_0x296458(0xe2))/0x7*(parseInt(_0x296458(0x103))/0x8);if(_0x182f9d===_0x3304c0)break;else _0xf6c0dc['push'](_0xf6c0dc['shift']());}catch(_0x4ef77f){_0xf6c0dc['push'](_0xf6c0dc['shift']());}}}(a59_0xcf23,0xbdc78));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(_0x5d9561,_0x30b9f8){const _0x37898c=a59_0x21f5,_0x105e2b=listLocalServiceTrees();let _0x4951b6;for(const _0x218f2f of _0x105e2b){const _0xb581eb=matchServiceTreeCommand(_0x218f2f,_0x5d9561);if(!_0xb581eb)continue;(!_0x4951b6||_0xb581eb[_0x37898c(0xe8)][_0x37898c(0xde)]['length']>_0x4951b6['command'][_0x37898c(0xde)][_0x37898c(0x119)])&&(_0x4951b6={'tree':_0x218f2f,'command':_0xb581eb[_0x37898c(0xe8)],'remainingArgs':_0xb581eb[_0x37898c(0x120)]});}if(!_0x4951b6)return undefined;const _0x54e395={..._0x30b9f8};return applyAppBinding(_0x4951b6['tree'],_0x4951b6[_0x37898c(0xe8)],_0x54e395),{'definition':buildDynamicCommandDefinition(_0x4951b6[_0x37898c(0xff)],_0x4951b6['command']),'args':_0x4951b6['remainingArgs'],'flags':_0x54e395,'tree':_0x4951b6[_0x37898c(0xff)],'command':_0x4951b6[_0x37898c(0xe8)]};}export function generateDynamicServiceHelp(_0x3e5efa){const _0x150a6d=a59_0x21f5,_0xc06939=listLocalServiceTrees()[_0x150a6d(0x124)](_0x273e00=>_0x273e00[_0x150a6d(0x10d)][_0x150a6d(0xed)]===_0x3e5efa);if(!_0xc06939)return undefined;const _0x44f26a=[CLI_BIN_NAME+'\x20'+_0x3e5efa+_0x150a6d(0xf4),'',_0xc06939[_0x150a6d(0x10d)][_0x150a6d(0x10f)]||_0x3e5efa,_0xc06939[_0x150a6d(0x10d)][_0x150a6d(0xfa)]?'\x20\x20'+_0xc06939[_0x150a6d(0x10d)]['description']:'','',_0x150a6d(0x13c),..._0xc06939['commands']['map'](_0x163462=>{const _0x1ac387=_0x150a6d,_0x265109=_0x163462[_0x1ac387(0xde)][_0x1ac387(0x106)](0x1)[_0x1ac387(0x137)]('\x20'),_0x17f6f4=_0x163462[_0x1ac387(0xfb)]===_0x1ac387(0xf0)?'':'\x20['+_0x163462['risk']+']';return'\x20\x20'+_0x265109[_0x1ac387(0xe9)](0x18)+'\x20'+(_0x163462['description']||'')+_0x17f6f4;}),'',_0x150a6d(0x121)+CLI_BIN_NAME+_0x150a6d(0xe7)+_0x3e5efa+_0x150a6d(0x127)][_0x150a6d(0x135)](Boolean);return _0x44f26a[_0x150a6d(0x137)]('\x0a');}export function listDynamicServiceEntries(){const _0x43f906=a59_0x21f5;return listLocalServices()[_0x43f906(0x102)](_0x1bc266=>{const _0x17e127=_0x43f906,_0x414730=_0x1bc266[_0x17e127(0x134)];return{'service':_0x414730[_0x17e127(0x10d)]['code'],'label':_0x414730[_0x17e127(0x10d)]['name']||_0x414730['service'][_0x17e127(0xed)],'commands':_0x414730[_0x17e127(0xf3)][_0x17e127(0x102)](_0x5ea1c1=>({'command':dynamicCommandName(_0x5ea1c1),'description':_0x5ea1c1['description']||'Run\x20service\x20command\x20'+_0x5ea1c1[_0x17e127(0xdd)],'tag':riskTag(_0x5ea1c1['risk'])}))};});}export function getDynamicServiceEntry(_0x87ebd9){const _0x28e7bc=a59_0x21f5;return listDynamicServiceEntries()['find'](_0x2fbaa9=>_0x2fbaa9[_0x28e7bc(0x10d)]===_0x87ebd9);}export function listDynamicServiceDefinitions(_0x3e4c4e){const _0x3f0c38=a59_0x21f5;return listLocalServiceTrees()[_0x3f0c38(0x135)](_0x4319ee=>!_0x3e4c4e||_0x4319ee['service'][_0x3f0c38(0xed)]===_0x3e4c4e)[_0x3f0c38(0x12e)](_0x1ea903=>_0x1ea903[_0x3f0c38(0xf3)][_0x3f0c38(0x102)](_0x5df139=>buildDynamicCommandDefinition(_0x1ea903,_0x5df139)));}export function getDynamicServiceDefinitions(_0xe5d631){const _0x1ef23d=a59_0x21f5,_0x52ce99=listDynamicServiceDefinitions(_0xe5d631);return _0x52ce99[_0x1ef23d(0x119)]>0x0?_0x52ce99:undefined;}export function findDynamicServiceDefinition(_0x11f52a,_0x5ceb53){const _0xb5c878=a59_0x21f5;return listDynamicServiceDefinitions(_0x11f52a)[_0xb5c878(0x124)](_0x16546b=>_0x16546b['command']===_0x5ceb53);}export function buildDynamicCommandDefinition(_0x2e539e,_0x541670){const _0x26fc0a=a59_0x21f5;return{'service':_0x2e539e['service'][_0x26fc0a(0xed)],'command':dynamicCommandName(_0x541670),'description':_0x541670[_0x26fc0a(0xfa)]||_0x26fc0a(0xee)+_0x541670[_0x26fc0a(0xdd)],'risk':_0x541670['risk'],..._0x541670['risk']==='read'?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x541670)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x541670[_0x26fc0a(0x115)][_0x26fc0a(0x102)](_0x10e751=>({'name':_0x10e751[_0x26fc0a(0x10f)],'description':_0x10e751['description']||_0x10e751['name'],'required':_0x10e751[_0x26fc0a(0x104)]})),'flags':_0x541670[_0x26fc0a(0x112)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x541670),async 'dryRun'(_0x31b708){const _0x453b46=_0x26fc0a,_0x4d1040=await compilePlan(_0x541670,_0x31b708);return{'method':'SERVICE_TREE','url':_0x541670[_0x453b46(0xdd)],'body':{'target':targetPreview(_0x4d1040),'params':_0x4d1040[_0x453b46(0x114)]},'description':_0x453b46(0x131)+_0x541670[_0x453b46(0xdd)]};},async 'execute'(_0x70dcb7){const _0x4d7c0e=_0x26fc0a,_0x5ea731=await compilePlan(_0x541670,_0x70dcb7),_0x4e9fbe=Date[_0x4d7c0e(0xd7)](),_0x161713=await executePlan(_0x5ea731,_0x541670,_0x70dcb7),_0x5a8e5b=Date['now']()-_0x4e9fbe;return{'ok':!![],'data':{'service':_0x2e539e[_0x4d7c0e(0x10d)],'command':_0x541670[_0x4d7c0e(0xdd)],'target':targetPreview(_0x5ea731),'result':_0x161713,'elapsed':_0x5a8e5b},'message':_0x4d7c0e(0x130)+_0x541670['cliPath']+_0x4d7c0e(0xdb)+_0x5a8e5b+'ms'};}};}function buildDynamicConfirmationDescription(_0x442119){const _0x8007be=a59_0x21f5,_0x1a8ef9=_0x442119['description']||_0x442119[_0x8007be(0xdd)],_0x59123b=_0x442119[_0x8007be(0xfb)]===_0x8007be(0xea)?_0x8007be(0x12f):_0x8007be(0x13b);return _0x8007be(0x136)+_0x1a8ef9+'”。'+_0x59123b;}function dynamicCommandName(_0x181305){const _0x456761=a59_0x21f5;return _0x181305['fullPath'][_0x456761(0x106)](0x1)[_0x456761(0x137)]('\x20');}function a59_0x21f5(_0x2e4199,_0x381a60){_0x2e4199=_0x2e4199-0xd2;const _0xcf2322=a59_0xcf23();let _0x21f59a=_0xcf2322[_0x2e4199];return _0x21f59a;}function riskTag(_0x2325c3){const _0x53ed17=a59_0x21f5;return _0x2325c3===_0x53ed17(0xf0)?'':_0x53ed17(0xeb)+_0x2325c3+']';}function flagToCommandFlag(_0x246ec9){const _0x2b2618=a59_0x21f5;return{'name':_0x246ec9[_0x2b2618(0x10a)],'type':_0x246ec9[_0x2b2618(0xd8)]==='json'?_0x2b2618(0x10b):_0x246ec9[_0x2b2618(0xd8)],'description':_0x246ec9[_0x2b2618(0xfa)]||_0x246ec9[_0x2b2618(0x10f)],'required':_0x246ec9[_0x2b2618(0x104)],'default':isPrimitiveFlagDefault(_0x246ec9['default'])?_0x246ec9[_0x2b2618(0x105)]:undefined,'enum':_0x246ec9[_0x2b2618(0x126)]};}async function compilePlan(_0x45d759,_0x8f302b){const _0x5a80b7=a59_0x21f5;return compileServiceTreeCommand(_0x45d759,{'flags':_0x8f302b[_0x5a80b7(0xd3)],'args':_0x8f302b[_0x5a80b7(0x115)],'context':await buildServiceContext(_0x45d759,_0x8f302b)});}async function buildServiceContext(_0x3dc57b,_0x228ce2){const _0x3ec258=a59_0x21f5,_0x4bdabf={'appCode':_0x228ce2[_0x3ec258(0x12b)],'env':_0x228ce2['envName'],'envName':_0x228ce2['envName']};if(!usesRuntimeContext(_0x3dc57b))return _0x4bdabf;const _0x50fa4b=await getLoginUserInfo(),_0x47f7dd=pickFirst(_0x50fa4b['userId'],_0x50fa4b['id']);return{..._0x4bdabf,'user':_0x50fa4b,'userId':_0x47f7dd,'id':_0x50fa4b['id'],'username':pickFirst(_0x50fa4b[_0x3ec258(0x10e)],_0x50fa4b[_0x3ec258(0xf8)],_0x50fa4b[_0x3ec258(0xd5)]),'userName':_0x50fa4b[_0x3ec258(0xf8)],'nickname':pickFirst(_0x50fa4b['nickname'],_0x50fa4b[_0x3ec258(0x10c)]),'nickName':_0x50fa4b[_0x3ec258(0x10c)],'tenantCode':_0x50fa4b[_0x3ec258(0xe3)],'employeeId':_0x50fa4b[_0x3ec258(0x11b)]};}function a59_0xcf23(){const _0xb24b2c=['tableName','employeeId','\x20requires\x20target.sqlCode.','scriptName','startsWith','sqlCode','remainingArgs','Use\x20`','target','\x20\x20\x20\x20sqlCode:\x20','find','context.','enum','`\x20to\x20inspect\x20the\x20manifest.','2672570EsRFmJ','Unknown\x20appRef\x20\x22','appRef','appCode','3426420gCauqv','boolean','flatMap','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','Service\x20command\x20','Preview\x20dynamic\x20service\x20command:\x20','mapTo','appBindings','normalizedManifest','filter','将通过\x20Service\x20Tree\x20执行“','join','\x20\x20\x20\x20functionName:\x20','bff','dbtableConfig','该命令被清单标记为写入,可能修改业务数据或服务状态。','Commands:','ctx.','rawFlags','\x20requires\x20target.functionName.','loginName','source','now','type','operator','datasetCode','\x20completed\x20in\x20','7667688toBdmB','cliPath','fullPath','env','validation','\x20\x20\x20\x20kind:\x20\x20\x20\x20','7snCPmi','tenantCode','kind','\x20\x20\x20\x20','app','\x20service\x20detail\x20--service\x20','command','padEnd','high-risk-write','\x20\x20[','Cannot\x20resolve\x20datatable\x20\x22','code','Run\x20service\x20command\x20','\x20\x20\x20\x20command:\x20','read','1778644UgIaiQ','425582fwtIfA','commands','\x20<command>\x20[flags]','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','fromEntries','bffId','userName','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','description','risk','\x20\x20\x20\x20datasetCode:\x20','datatable','push','tree','Unsupported\x20service\x20target\x20kind:\x20','bffCode','map','23093912tlpegi','required','default','slice','\x20\x20MAP\x20TO','appcode','const','cliName','string','nickName','service','username','name','trim','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','flags','\x20->\x20','params','args','\x20\x20SERVICE\x20TREE\x20TARGET','sql','484125cBYtOB','length'];a59_0xcf23=function(){return _0xb24b2c;};return a59_0xcf23();}function usesRuntimeContext(_0x489090){const _0x1bcee3=a59_0x21f5;return _0x489090[_0x1bcee3(0x132)]['some'](_0x2cb9a6=>typeof _0x2cb9a6[_0x1bcee3(0xd6)]===_0x1bcee3(0x10b)&&(_0x2cb9a6['source'][_0x1bcee3(0x11e)](_0x1bcee3(0x125))||_0x2cb9a6[_0x1bcee3(0xd6)][_0x1bcee3(0x11e)](_0x1bcee3(0xd2))));}function pickFirst(..._0x21fd2d){const _0x1e84d6=a59_0x21f5;return _0x21fd2d[_0x1e84d6(0x124)](_0x53fb1a=>_0x53fb1a!==undefined&&_0x53fb1a!==null);}async function executePlan(_0x41044c,_0x321790,_0x1557c5){const _0x1285e0=a59_0x21f5;if(_0x41044c['kind']==='data'){const _0x29be3a=await resolveDatasetCode(_0x41044c,_0x321790,_0x1557c5);return executeData(_0x29be3a,_0x41044c[_0x1285e0(0xe8)],_0x41044c[_0x1285e0(0x114)]);}if(_0x41044c[_0x1285e0(0xe4)]===_0x1285e0(0x117)){if(!_0x41044c['sqlCode'])throw CliErrors[_0x1285e0(0xe0)]('Service\x20command\x20'+_0x321790[_0x1285e0(0xdd)]+_0x1285e0(0x11c));return executeSdkSql(_0x41044c[_0x1285e0(0x11f)],normalizeScalarParams(_0x41044c[_0x1285e0(0x114)]));}if(_0x41044c[_0x1285e0(0xe4)]===_0x1285e0(0x139)){const _0x5aef51=_0x41044c[_0x1285e0(0x11d)]||_0x41044c[_0x1285e0(0x101)]||(_0x41044c['bffId']==null?'':String(_0x41044c[_0x1285e0(0xf7)]));if(!_0x5aef51)throw CliErrors[_0x1285e0(0xe0)](_0x1285e0(0x130)+_0x321790['cliPath']+_0x1285e0(0xd4));return executeSdkBff(_0x5aef51,_0x41044c[_0x1285e0(0x114)]);}throw CliErrors['validation'](_0x1285e0(0x100)+_0x41044c[_0x1285e0(0xe4)]);}async function resolveDatasetCode(_0x3dadcc,_0xfa36ca,_0x41cdb5){const _0x3f1b70=a59_0x21f5;if(_0x3dadcc['datasetCode'])return _0x3dadcc['datasetCode'];if(!_0x3dadcc[_0x3f1b70(0xfd)])throw CliErrors[_0x3f1b70(0xe0)](_0x3f1b70(0x130)+_0xfa36ca['cliPath']+_0x3f1b70(0xf9));const _0x305375=await listDatasets(_0x41cdb5[_0x3f1b70(0x12b)]),_0x54b0b1=_0x305375[_0x3f1b70(0x124)](_0x314583=>_0x314583[_0x3f1b70(0x13a)]?.[_0x3f1b70(0x11a)]===_0x3dadcc[_0x3f1b70(0xfd)]);if(!_0x54b0b1?.[_0x3f1b70(0xed)])throw CliErrors[_0x3f1b70(0xe0)](_0x3f1b70(0xec)+_0x3dadcc[_0x3f1b70(0xfd)]+_0x3f1b70(0x111)+_0x41cdb5['appCode']+'.',_0x3f1b70(0xf5));return _0x54b0b1[_0x3f1b70(0xed)];}function applyAppBinding(_0x42afed,_0x273a67,_0x524f9a){const _0xb2e1a2=a59_0x21f5,_0x215c9f=_0x273a67[_0xb2e1a2(0x122)][_0xb2e1a2(0x12a)];if(!_0x215c9f)return;const _0x2a2811=_0x42afed[_0xb2e1a2(0x133)][_0x215c9f];if(!_0x2a2811)throw CliErrors['validation'](_0xb2e1a2(0x129)+_0x215c9f+'\x22\x20in\x20service\x20command\x20'+_0x273a67[_0xb2e1a2(0xdd)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0xcb28d0=_0x2a2811[_0xb2e1a2(0x108)]||_0x2a2811[_0xb2e1a2(0x12b)];_0xcb28d0&&!hasText(_0x524f9a['appcode'])&&(_0x524f9a['appcode']=_0xcb28d0),_0x2a2811[_0xb2e1a2(0xe6)]&&!hasText(_0x524f9a[_0xb2e1a2(0xe6)])&&!hasText(_0x524f9a[_0xb2e1a2(0x108)])&&(_0x524f9a[_0xb2e1a2(0xe6)]=_0x2a2811[_0xb2e1a2(0xe6)]),_0x2a2811[_0xb2e1a2(0xdf)]&&!hasText(_0x524f9a[_0xb2e1a2(0xdf)])&&(_0x524f9a[_0xb2e1a2(0xdf)]=_0x2a2811['env']);}function renderDynamicCommandHelp(_0x199a25){const _0x2ce2c7=a59_0x21f5,_0x5db1cc=[_0x2ce2c7(0x116),_0x2ce2c7(0xe1)+_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0xe4)],_0x2ce2c7(0xef)+_0x199a25[_0x2ce2c7(0x122)]['command']];if(_0x199a25['target'][_0x2ce2c7(0xda)])_0x5db1cc['push'](_0x2ce2c7(0xfc)+_0x199a25['target']['datasetCode']);if(_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0xfd)])_0x5db1cc[_0x2ce2c7(0xfe)]('\x20\x20\x20\x20datatable:\x20'+_0x199a25[_0x2ce2c7(0x122)]['datatable']);if(_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0x11f)])_0x5db1cc[_0x2ce2c7(0xfe)](_0x2ce2c7(0x123)+_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0x11f)]);if(_0x199a25['target'][_0x2ce2c7(0x11d)])_0x5db1cc['push'](_0x2ce2c7(0x138)+_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0x11d)]);if(_0x199a25[_0x2ce2c7(0x132)]['length']>0x0){_0x5db1cc[_0x2ce2c7(0xfe)]('',_0x2ce2c7(0x107));for(const _0x4ee534 of _0x199a25[_0x2ce2c7(0x132)]){_0x5db1cc[_0x2ce2c7(0xfe)](_0x2ce2c7(0xe5)+(_0x4ee534[_0x2ce2c7(0xd6)]||_0x2ce2c7(0x109))+_0x2ce2c7(0x113)+_0x4ee534[_0x2ce2c7(0x122)]+(_0x4ee534[_0x2ce2c7(0xd9)]?'.'+_0x4ee534[_0x2ce2c7(0xd9)]:''));}}return _0x5db1cc['join']('\x0a');}function targetPreview(_0x475a21){const _0xeadc65=a59_0x21f5;return{'kind':_0x475a21[_0xeadc65(0xe4)],'command':_0x475a21[_0xeadc65(0xe8)],'appRef':_0x475a21[_0xeadc65(0x12a)],'datasetCode':_0x475a21['datasetCode'],'datatable':_0x475a21[_0xeadc65(0xfd)],'sqlCode':_0x475a21[_0xeadc65(0x11f)],'bffCode':_0x475a21[_0xeadc65(0x101)],'bffId':_0x475a21[_0xeadc65(0xf7)],'functionName':_0x475a21[_0xeadc65(0x11d)]};}function normalizeScalarParams(_0x444a74){const _0x4d1515=a59_0x21f5;return Object[_0x4d1515(0xf6)](Object['entries'](_0x444a74)['filter'](([,_0xe83ba])=>typeof _0xe83ba===_0x4d1515(0x10b)||typeof _0xe83ba==='number'));}function hasText(_0x26dc5b){const _0x5818b6=a59_0x21f5;return typeof _0x26dc5b===_0x5818b6(0x10b)&&_0x26dc5b[_0x5818b6(0x110)]()[_0x5818b6(0x119)]>0x0;}function isPrimitiveFlagDefault(_0x4665a4){const _0x1ea6e0=a59_0x21f5;return _0x4665a4===undefined||typeof _0x4665a4===_0x1ea6e0(0x10b)||typeof _0x4665a4==='number'||typeof _0x4665a4===_0x1ea6e0(0x12d);}
|
|
1
|
+
(function(_0x4a4a54,_0x4e96a7){const _0x260169=a59_0x5d37,_0x1f70c5=_0x4a4a54();while(!![]){try{const _0x422250=-parseInt(_0x260169(0x212))/0x1+parseInt(_0x260169(0x1b6))/0x2*(-parseInt(_0x260169(0x1e0))/0x3)+-parseInt(_0x260169(0x1bf))/0x4*(parseInt(_0x260169(0x1d6))/0x5)+parseInt(_0x260169(0x1c5))/0x6+parseInt(_0x260169(0x1fe))/0x7+parseInt(_0x260169(0x1e2))/0x8+parseInt(_0x260169(0x1f4))/0x9;if(_0x422250===_0x4e96a7)break;else _0x1f70c5['push'](_0x1f70c5['shift']());}catch(_0x55550e){_0x1f70c5['push'](_0x1f70c5['shift']());}}}(a59_0x42e1,0x77837));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(_0x58405a,_0x356875){const _0xef7f25=a59_0x5d37,_0x25e038=listLocalServiceTrees();let _0x2a8585;for(const _0xeb9756 of _0x25e038){const _0x271679=matchServiceTreeCommand(_0xeb9756,_0x58405a);if(!_0x271679)continue;(!_0x2a8585||_0x271679[_0xef7f25(0x1c7)][_0xef7f25(0x1ff)][_0xef7f25(0x1e9)]>_0x2a8585[_0xef7f25(0x1c7)][_0xef7f25(0x1ff)][_0xef7f25(0x1e9)])&&(_0x2a8585={'tree':_0xeb9756,'command':_0x271679['command'],'remainingArgs':_0x271679[_0xef7f25(0x211)]});}if(!_0x2a8585)return undefined;const _0x47872d={..._0x356875};return applyAppBinding(_0x2a8585[_0xef7f25(0x1e1)],_0x2a8585['command'],_0x47872d),{'definition':buildDynamicCommandDefinition(_0x2a8585[_0xef7f25(0x1e1)],_0x2a8585['command']),'args':_0x2a8585[_0xef7f25(0x211)],'flags':_0x47872d,'tree':_0x2a8585[_0xef7f25(0x1e1)],'command':_0x2a8585['command']};}export function generateDynamicServiceHelp(_0x3ade8f){const _0x3cb397=a59_0x5d37,_0x64cadc=listLocalServiceTrees()['find'](_0x46619f=>_0x46619f[_0x3cb397(0x21b)][_0x3cb397(0x1d7)]===_0x3ade8f);if(!_0x64cadc)return undefined;const _0x31a919=[CLI_BIN_NAME+'\x20'+_0x3ade8f+'\x20<command>\x20[flags]','',_0x64cadc['service'][_0x3cb397(0x1cf)]||_0x3ade8f,_0x64cadc['service']['description']?'\x20\x20'+_0x64cadc[_0x3cb397(0x21b)][_0x3cb397(0x1ea)]:'','',_0x3cb397(0x1b8),..._0x64cadc[_0x3cb397(0x1f1)][_0x3cb397(0x1fd)](_0x59d0db=>{const _0x2aeb08=_0x3cb397,_0x46bfec=_0x59d0db['fullPath'][_0x2aeb08(0x219)](0x1)[_0x2aeb08(0x214)]('\x20'),_0x613a48=_0x59d0db[_0x2aeb08(0x1ce)]===_0x2aeb08(0x1f5)?'':'\x20['+_0x59d0db[_0x2aeb08(0x1ce)]+']';return'\x20\x20'+_0x46bfec[_0x2aeb08(0x1b5)](0x18)+'\x20'+(_0x59d0db['description']||'')+_0x613a48;}),'',_0x3cb397(0x1eb)+CLI_BIN_NAME+_0x3cb397(0x1ba)+_0x3ade8f+'`\x20to\x20inspect\x20the\x20manifest.'][_0x3cb397(0x21c)](Boolean);return _0x31a919[_0x3cb397(0x214)]('\x0a');}export function listDynamicServiceEntries(){const _0x2eca4f=a59_0x5d37;return listLocalServices()[_0x2eca4f(0x1fd)](_0x310fed=>{const _0x488e4c=_0x2eca4f,_0x25b90b=_0x310fed[_0x488e4c(0x1c8)];return{'service':_0x25b90b['service'][_0x488e4c(0x1d7)],'label':_0x25b90b['service'][_0x488e4c(0x1cf)]||_0x25b90b['service']['code'],'commands':_0x25b90b[_0x488e4c(0x1f1)]['map'](_0x15f0c4=>({'command':dynamicCommandName(_0x15f0c4),'description':_0x15f0c4[_0x488e4c(0x1ea)]||_0x488e4c(0x218)+_0x15f0c4[_0x488e4c(0x1f8)],'tag':riskTag(_0x15f0c4[_0x488e4c(0x1ce)])}))};});}export function getDynamicServiceEntry(_0x1c5426){const _0x3661b9=a59_0x5d37;return listDynamicServiceEntries()['find'](_0x416f01=>_0x416f01[_0x3661b9(0x21b)]===_0x1c5426);}export function listDynamicServiceDefinitions(_0x1a291f){const _0x35d8e7=a59_0x5d37;return listLocalServiceTrees()['filter'](_0x9f77b7=>!_0x1a291f||_0x9f77b7[_0x35d8e7(0x21b)][_0x35d8e7(0x1d7)]===_0x1a291f)[_0x35d8e7(0x1e8)](_0x347486=>_0x347486['commands'][_0x35d8e7(0x1fd)](_0x3046ec=>buildDynamicCommandDefinition(_0x347486,_0x3046ec)));}export function getDynamicServiceDefinitions(_0x5cdff9){const _0x3fea01=a59_0x5d37,_0x3dfd70=listDynamicServiceDefinitions(_0x5cdff9);return _0x3dfd70[_0x3fea01(0x1e9)]>0x0?_0x3dfd70:undefined;}export function findDynamicServiceDefinition(_0x41c7ac,_0x55a67c){const _0x418946=a59_0x5d37;return listDynamicServiceDefinitions(_0x41c7ac)[_0x418946(0x215)](_0x5e23d0=>_0x5e23d0['command']===_0x55a67c);}export function buildDynamicCommandDefinition(_0x5ebf82,_0x2d3c36){const _0x2d0305=a59_0x5d37;return{'service':_0x5ebf82[_0x2d0305(0x21b)][_0x2d0305(0x1d7)],'command':dynamicCommandName(_0x2d3c36),'description':_0x2d3c36[_0x2d0305(0x1ea)]||'Run\x20service\x20command\x20'+_0x2d3c36['cliPath'],'risk':_0x2d3c36[_0x2d0305(0x1ce)],..._0x2d3c36[_0x2d0305(0x1ce)]==='read'?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x2d3c36)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x2d3c36[_0x2d0305(0x208)][_0x2d0305(0x1fd)](_0x40743e=>({'name':_0x40743e[_0x2d0305(0x1cf)],'description':_0x40743e[_0x2d0305(0x1ea)]||_0x40743e['name'],'required':_0x40743e[_0x2d0305(0x205)]})),'flags':_0x2d3c36[_0x2d0305(0x1b9)][_0x2d0305(0x1fd)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x2d3c36),async 'dryRun'(_0x366a6d){const _0x126cb1=_0x2d0305,_0xbbd15c=await compilePlan(_0x2d3c36,_0x366a6d);return{'method':'SERVICE_TREE','url':_0x2d3c36[_0x126cb1(0x1f8)],'body':{'target':targetPreview(_0xbbd15c),'params':_0xbbd15c['params']},'description':_0x126cb1(0x1fc)+_0x2d3c36[_0x126cb1(0x1f8)]};},async 'execute'(_0x5c9c51){const _0x76d95f=_0x2d0305,_0x839763=await compilePlan(_0x2d3c36,_0x5c9c51),_0x29d905=Date[_0x76d95f(0x21d)](),_0x5666f0=await executePlan(_0x839763,_0x2d3c36,_0x5c9c51),_0x206dae=Date[_0x76d95f(0x21d)]()-_0x29d905;return{'ok':!![],'data':{'service':_0x5ebf82['service'],'command':_0x2d3c36['cliPath'],'target':targetPreview(_0x839763),'result':_0x5666f0,'elapsed':_0x206dae},'message':_0x76d95f(0x1c9)+_0x2d3c36[_0x76d95f(0x1f8)]+_0x76d95f(0x1dc)+_0x206dae+'ms'};}};}function a59_0x5d37(_0x3bbe0d,_0x483f6d){_0x3bbe0d=_0x3bbe0d-0x1b0;const _0x42e127=a59_0x42e1();let _0x5d3785=_0x42e127[_0x3bbe0d];return _0x5d3785;}function buildDynamicConfirmationDescription(_0x686261){const _0x40b117=a59_0x5d37,_0xf3c1ad=_0x686261[_0x40b117(0x1ea)]||_0x686261['cliPath'],_0x56a8b8=_0x686261[_0x40b117(0x1ce)]==='high-risk-write'?_0x40b117(0x1c4):_0x40b117(0x1d1);return _0x40b117(0x1b3)+_0xf3c1ad+'”。'+_0x56a8b8;}function dynamicCommandName(_0x2871e3){const _0x3d299f=a59_0x5d37;return _0x2871e3[_0x3d299f(0x1ff)][_0x3d299f(0x219)](0x1)['join']('\x20');}function riskTag(_0x3ade31){const _0x4c20c5=a59_0x5d37;return _0x3ade31==='read'?'':_0x4c20c5(0x21a)+_0x3ade31+']';}function flagToCommandFlag(_0x5e05f8){const _0x4c21b1=a59_0x5d37;return{'name':_0x5e05f8[_0x4c21b1(0x1df)],'type':_0x5e05f8['type']===_0x4c21b1(0x1e5)?_0x4c21b1(0x1e6):_0x5e05f8['type'],'description':_0x5e05f8['description']||_0x5e05f8[_0x4c21b1(0x1cf)],'required':_0x5e05f8[_0x4c21b1(0x205)],'default':isPrimitiveFlagDefault(_0x5e05f8['default'])?_0x5e05f8[_0x4c21b1(0x204)]:undefined,'enum':_0x5e05f8[_0x4c21b1(0x217)]};}async function compilePlan(_0x4084a1,_0x57853c){const _0x1e08fb=a59_0x5d37;return compileServiceTreeCommand(_0x4084a1,{'flags':_0x57853c[_0x1e08fb(0x213)],'args':_0x57853c[_0x1e08fb(0x208)],'context':await buildServiceContext(_0x4084a1,_0x57853c)});}async function buildServiceContext(_0x48919e,_0x540ef5){const _0x30b289=a59_0x5d37,_0x1ca59f={'appCode':_0x540ef5[_0x30b289(0x1ee)],'env':_0x540ef5[_0x30b289(0x1b0)],'envName':_0x540ef5[_0x30b289(0x1b0)]};if(!usesRuntimeContext(_0x48919e))return _0x1ca59f;const _0x459837=await getLoginUserInfo(),_0x3b339b=pickFirst(_0x459837[_0x30b289(0x1ec)],_0x459837['id']);return{..._0x1ca59f,'user':_0x459837,'userId':_0x3b339b,'id':_0x459837['id'],'username':pickFirst(_0x459837[_0x30b289(0x1f3)],_0x459837[_0x30b289(0x1d5)],_0x459837['loginName']),'userName':_0x459837[_0x30b289(0x1d5)],'nickname':pickFirst(_0x459837['nickname'],_0x459837['nickName']),'nickName':_0x459837[_0x30b289(0x1f2)],'tenantCode':_0x459837[_0x30b289(0x20c)],'employeeId':_0x459837[_0x30b289(0x1c3)]};}function usesRuntimeContext(_0x30937f){const _0x38fd54=a59_0x5d37;return _0x30937f[_0x38fd54(0x1f6)][_0x38fd54(0x1b2)](_0x20b6ce=>typeof _0x20b6ce[_0x38fd54(0x20f)]==='string'&&(_0x20b6ce[_0x38fd54(0x20f)][_0x38fd54(0x1de)](_0x38fd54(0x1c0))||_0x20b6ce[_0x38fd54(0x20f)][_0x38fd54(0x1de)](_0x38fd54(0x1cb))));}function pickFirst(..._0x136d68){return _0x136d68['find'](_0x587b5d=>_0x587b5d!==undefined&&_0x587b5d!==null);}function a59_0x42e1(){const _0x4ab510=['mapTo','\x20\x20\x20\x20functionName:\x20','cliPath','scriptName','boolean','\x20->\x20','Preview\x20dynamic\x20service\x20command:\x20','map','2952215OHCLWQ','fullPath','Cannot\x20resolve\x20datatable\x20\x22','env','dbtableConfig','app','default','required','bffCode','operator','args','\x20\x20\x20\x20datatable:\x20','\x20\x20\x20\x20','appRef','tenantCode','datasetCode','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','source','\x20requires\x20target.functionName.','remainingArgs','192377zWtUPe','rawFlags','join','find','bff','enum','Run\x20service\x20command\x20','slice','\x20\x20[','service','filter','now','envName','target','some','将通过\x20Service\x20Tree\x20执行“','entries','padEnd','4luZqfg','params','Commands:','flags','\x20service\x20detail\x20--service\x20','\x20\x20\x20\x20sqlCode:\x20','const','sqlCode','\x22\x20in\x20service\x20command\x20','124pYmZOP','context.','\x20requires\x20target.sqlCode.','\x20\x20\x20\x20datasetCode:\x20','employeeId','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','1472226sohFCu','\x20\x20\x20\x20command:\x20','command','normalizedManifest','Service\x20command\x20','validation','ctx.','Unsupported\x20service\x20target\x20kind:\x20','\x20\x20SERVICE\x20TREE\x20TARGET','risk','name','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','该命令被清单标记为写入,可能修改业务数据或服务状态。','bffId','appBindings','number','userName','132985Ceetwt','code','datatable','push','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','kind','\x20completed\x20in\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','startsWith','cliName','1088733wIHodS','tree','6655832VRZqdS','\x20\x20MAP\x20TO','appcode','json','string','sql','flatMap','length','description','Use\x20`','userId','tableName','appCode','trim','Unknown\x20appRef\x20\x22','commands','nickName','username','6598242mgXFFj','read'];a59_0x42e1=function(){return _0x4ab510;};return a59_0x42e1();}async function executePlan(_0x1a305f,_0x1c559c,_0x5d8f82){const _0x47ae4a=a59_0x5d37;if(_0x1a305f[_0x47ae4a(0x1db)]==='data'){const _0x2b4e0d=await resolveDatasetCode(_0x1a305f,_0x1c559c,_0x5d8f82);return executeData(_0x2b4e0d,_0x1a305f[_0x47ae4a(0x1c7)],_0x1a305f[_0x47ae4a(0x1b7)]);}if(_0x1a305f[_0x47ae4a(0x1db)]===_0x47ae4a(0x1e7)){if(!_0x1a305f[_0x47ae4a(0x1bd)])throw CliErrors[_0x47ae4a(0x1ca)](_0x47ae4a(0x1c9)+_0x1c559c[_0x47ae4a(0x1f8)]+_0x47ae4a(0x1c1));return executeSdkSql(_0x1a305f['sqlCode'],normalizeScalarParams(_0x1a305f[_0x47ae4a(0x1b7)]));}if(_0x1a305f[_0x47ae4a(0x1db)]===_0x47ae4a(0x216)){const _0x4ea546=_0x1a305f[_0x47ae4a(0x1f9)]||_0x1a305f[_0x47ae4a(0x206)]||(_0x1a305f[_0x47ae4a(0x1d2)]==null?'':String(_0x1a305f['bffId']));if(!_0x4ea546)throw CliErrors[_0x47ae4a(0x1ca)](_0x47ae4a(0x1c9)+_0x1c559c[_0x47ae4a(0x1f8)]+_0x47ae4a(0x210));return executeSdkBff(_0x4ea546,_0x1a305f['params']);}throw CliErrors[_0x47ae4a(0x1ca)](_0x47ae4a(0x1cc)+_0x1a305f[_0x47ae4a(0x1db)]);}async function resolveDatasetCode(_0x37455b,_0x4df812,_0x5c9ab7){const _0x2b3f56=a59_0x5d37;if(_0x37455b[_0x2b3f56(0x20d)])return _0x37455b['datasetCode'];if(!_0x37455b[_0x2b3f56(0x1d8)])throw CliErrors[_0x2b3f56(0x1ca)]('Service\x20command\x20'+_0x4df812[_0x2b3f56(0x1f8)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x550e21=await listDatasets(_0x5c9ab7[_0x2b3f56(0x1ee)]),_0x2d6a19=_0x550e21['find'](_0x5df4cc=>_0x5df4cc[_0x2b3f56(0x202)]?.[_0x2b3f56(0x1ed)]===_0x37455b['datatable']);if(!_0x2d6a19?.['code'])throw CliErrors['validation'](_0x2b3f56(0x200)+_0x37455b[_0x2b3f56(0x1d8)]+_0x2b3f56(0x20e)+_0x5c9ab7[_0x2b3f56(0x1ee)]+'.',_0x2b3f56(0x1d0));return _0x2d6a19['code'];}function applyAppBinding(_0x10f3fe,_0x144303,_0x1c80e0){const _0x5299da=a59_0x5d37,_0x511a9d=_0x144303['target']['appRef'];if(!_0x511a9d)return;const _0x5c84b0=_0x10f3fe[_0x5299da(0x1d3)][_0x511a9d];if(!_0x5c84b0)throw CliErrors[_0x5299da(0x1ca)](_0x5299da(0x1f0)+_0x511a9d+_0x5299da(0x1be)+_0x144303[_0x5299da(0x1f8)]+'.',_0x5299da(0x1da));const _0x55ff53=_0x5c84b0['appcode']||_0x5c84b0[_0x5299da(0x1ee)];_0x55ff53&&!hasText(_0x1c80e0['appcode'])&&(_0x1c80e0['appcode']=_0x55ff53),_0x5c84b0[_0x5299da(0x203)]&&!hasText(_0x1c80e0[_0x5299da(0x203)])&&!hasText(_0x1c80e0[_0x5299da(0x1e4)])&&(_0x1c80e0[_0x5299da(0x203)]=_0x5c84b0[_0x5299da(0x203)]),_0x5c84b0[_0x5299da(0x201)]&&!hasText(_0x1c80e0[_0x5299da(0x201)])&&(_0x1c80e0['env']=_0x5c84b0[_0x5299da(0x201)]);}function renderDynamicCommandHelp(_0x47c0e3){const _0xb98829=a59_0x5d37,_0x1ef5e8=[_0xb98829(0x1cd),_0xb98829(0x1dd)+_0x47c0e3['target']['kind'],_0xb98829(0x1c6)+_0x47c0e3['target']['command']];if(_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x20d)])_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x1c2)+_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x20d)]);if(_0x47c0e3['target']['datatable'])_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x209)+_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1d8)]);if(_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1bd)])_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x1bb)+_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1bd)]);if(_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1f9)])_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x1f7)+_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1f9)]);if(_0x47c0e3[_0xb98829(0x1f6)]['length']>0x0){_0x1ef5e8[_0xb98829(0x1d9)]('',_0xb98829(0x1e3));for(const _0x5e2ac7 of _0x47c0e3[_0xb98829(0x1f6)]){_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x20a)+(_0x5e2ac7['source']||_0xb98829(0x1bc))+_0xb98829(0x1fb)+_0x5e2ac7[_0xb98829(0x1b1)]+(_0x5e2ac7[_0xb98829(0x207)]?'.'+_0x5e2ac7[_0xb98829(0x207)]:''));}}return _0x1ef5e8['join']('\x0a');}function targetPreview(_0x2ef79d){const _0xf35d5=a59_0x5d37;return{'kind':_0x2ef79d[_0xf35d5(0x1db)],'command':_0x2ef79d['command'],'appRef':_0x2ef79d[_0xf35d5(0x20b)],'datasetCode':_0x2ef79d[_0xf35d5(0x20d)],'datatable':_0x2ef79d[_0xf35d5(0x1d8)],'sqlCode':_0x2ef79d[_0xf35d5(0x1bd)],'bffCode':_0x2ef79d['bffCode'],'bffId':_0x2ef79d[_0xf35d5(0x1d2)],'functionName':_0x2ef79d[_0xf35d5(0x1f9)]};}function normalizeScalarParams(_0x4283a0){const _0x5c70ba=a59_0x5d37;return Object['fromEntries'](Object[_0x5c70ba(0x1b4)](_0x4283a0)[_0x5c70ba(0x21c)](([,_0x91c4a1])=>typeof _0x91c4a1===_0x5c70ba(0x1e6)||typeof _0x91c4a1===_0x5c70ba(0x1d4)));}function hasText(_0x5b7303){const _0x5f2212=a59_0x5d37;return typeof _0x5b7303===_0x5f2212(0x1e6)&&_0x5b7303[_0x5f2212(0x1ef)]()[_0x5f2212(0x1e9)]>0x0;}function isPrimitiveFlagDefault(_0xc53005){const _0x1e55e8=a59_0x5d37;return _0xc53005===undefined||typeof _0xc53005==='string'||typeof _0xc53005===_0x1e55e8(0x1d4)||typeof _0xc53005===_0x1e55e8(0x1fa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5a3c84,_0x3af5ce){const _0x149cea=a60_0x33cf,_0x34cc38=_0x5a3c84();while(!![]){try{const _0x45cbe3=parseInt(_0x149cea(0x141))/0x1+parseInt(_0x149cea(0x12a))/0x2*(-parseInt(_0x149cea(0x132))/0x3)+parseInt(_0x149cea(0x135))/0x4*(parseInt(_0x149cea(0x143))/0x5)+-parseInt(_0x149cea(0x144))/0x6+-parseInt(_0x149cea(0x125))/0x7+parseInt(_0x149cea(0x12b))/0x8*(-parseInt(_0x149cea(0x13c))/0x9)+parseInt(_0x149cea(0x149))/0xa;if(_0x45cbe3===_0x3af5ce)break;else _0x34cc38['push'](_0x34cc38['shift']());}catch(_0x354b8e){_0x34cc38['push'](_0x34cc38['shift']());}}}(a60_0x44e7,0x93b54));export function adaptServiceTreeManifestForLegacyFramework(_0x4814a5){const _0x5c65d9=a60_0x33cf,_0x57210d=cloneJsonValue(_0x4814a5),_0x57e9c2=[];if(!isObjectRecord(_0x57210d))return{'manifest':_0x57210d,'errors':_0x57e9c2};return Array[_0x5c65d9(0x140)](_0x57210d[_0x5c65d9(0x13e)])&&_0x57210d[_0x5c65d9(0x13e)][_0x5c65d9(0x14a)]((_0x4e4dac,_0x58d435)=>{const _0x6a593f=_0x5c65d9;if(!isObjectRecord(_0x4e4dac))return;adaptBffTarget(_0x4e4dac['target'],_0x6a593f(0x134)+_0x58d435+'].target',_0x57e9c2);}),adaptResources(_0x57210d['resources'],_0x5c65d9(0x133),_0x57e9c2),{'manifest':_0x57210d,'errors':_0x57e9c2};}export function toPublicServiceTreeTarget(_0x417574){const _0x251b06=a60_0x33cf,{scriptName:_0x5ec92c,..._0x83c9e1}=_0x417574;return typeof _0x5ec92c===_0x251b06(0x13b)&&_0x5ec92c[_0x251b06(0x146)]()&&(_0x83c9e1['functionName']=_0x5ec92c),_0x83c9e1;}export function toPublicNormalizedServiceTree(_0x5e83a4){const _0x5ba677=a60_0x33cf;return{..._0x5e83a4,'commands':_0x5e83a4[_0x5ba677(0x13e)][_0x5ba677(0x12c)](_0x316eda=>({..._0x316eda,'target':toPublicServiceTreeTarget(_0x316eda[_0x5ba677(0x127)])}))};}function adaptResources(_0xe8444,_0x20c3a4,_0x4b1dc9){const _0x4f1ed7=a60_0x33cf;if(!isObjectRecord(_0xe8444))return;for(const [_0x5c61e0,_0x34f6c2]of Object[_0x4f1ed7(0x142)](_0xe8444)){if(!isObjectRecord(_0x34f6c2))continue;const _0x532c8c=_0x20c3a4+'.'+_0x5c61e0;if(isObjectRecord(_0x34f6c2['actions']))for(const [_0x5e7346,_0x1e0938]of Object[_0x4f1ed7(0x142)](_0x34f6c2[_0x4f1ed7(0x13d)])){if(!isObjectRecord(_0x1e0938))continue;const _0x44d44a=_0x532c8c+_0x4f1ed7(0x13f)+_0x5e7346,_0x407799=isObjectRecord(_0x1e0938[_0x4f1ed7(0x127)])&&_0x1e0938['target'][_0x4f1ed7(0x138)]===_0x4f1ed7(0x147);adaptBffTarget(_0x1e0938[_0x4f1ed7(0x127)],_0x44d44a+_0x4f1ed7(0x139),_0x4b1dc9),(_0x407799||isBffAction(_0x1e0938))&&adaptFunctionNameField(_0x1e0938,_0x44d44a,_0x4b1dc9);}adaptResources(_0x34f6c2['resources'],_0x532c8c+_0x4f1ed7(0x129),_0x4b1dc9);}}function adaptBffTarget(_0x139362,_0x523562,_0xdc06b2){const _0x3046d8=a60_0x33cf;if(!isObjectRecord(_0x139362)||_0x139362[_0x3046d8(0x138)]!=='bff')return;adaptFunctionNameField(_0x139362,_0x523562,_0xdc06b2);}function a60_0x33cf(_0x56ba1b,_0x4627dc){_0x56ba1b=_0x56ba1b-0x125;const _0x44e7fd=a60_0x44e7();let _0x33cf72=_0x44e7fd[_0x56ba1b];return _0x33cf72;}function adaptFunctionNameField(_0x1f50c6,_0x4fca08,_0x2cac9a){const _0x450182=a60_0x33cf;Object[_0x450182(0x137)][_0x450182(0x12e)][_0x450182(0x128)](_0x1f50c6,'scriptName')&&_0x2cac9a['push']({'level':_0x450182(0x145),'path':_0x4fca08+_0x450182(0x148),'message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object[_0x450182(0x137)][_0x450182(0x12e)][_0x450182(0x128)](_0x1f50c6,_0x450182(0x13a))){if(typeof _0x1f50c6[_0x450182(0x13a)]!==_0x450182(0x13b)||!_0x1f50c6['functionName'][_0x450182(0x146)]()){_0x2cac9a[_0x450182(0x12f)]({'level':'error','path':_0x4fca08+_0x450182(0x12d),'message':_0x450182(0x136)}),delete _0x1f50c6[_0x450182(0x13a)];return;}_0x1f50c6['scriptName']=_0x1f50c6[_0x450182(0x13a)],delete _0x1f50c6[_0x450182(0x13a)];}}function isBffAction(_0x2bbff5){const _0x465a2c=a60_0x33cf;return _0x2bbff5[_0x465a2c(0x138)]===_0x465a2c(0x147)||_0x2bbff5[_0x465a2c(0x126)]===_0x465a2c(0x130)||_0x2bbff5['target']===_0x465a2c(0x130);}function cloneJsonValue(_0x23addf){const _0x3087e4=a60_0x33cf;if(Array[_0x3087e4(0x140)](_0x23addf))return _0x23addf[_0x3087e4(0x12c)](_0x1464b=>cloneJsonValue(_0x1464b));if(isObjectRecord(_0x23addf))return Object[_0x3087e4(0x131)](Object[_0x3087e4(0x142)](_0x23addf)[_0x3087e4(0x12c)](([_0x12ca19,_0x17a651])=>[_0x12ca19,cloneJsonValue(_0x17a651)]));return _0x23addf;}function isObjectRecord(_0xbf442f){const _0x2a098e=a60_0x33cf;return Boolean(_0xbf442f)&&typeof _0xbf442f==='object'&&!Array[_0x2a098e(0x140)](_0xbf442f);}function a60_0x44e7(){const _0x2102c7=['7444BFzbsT','functionName\x20must\x20be\x20a\x20non-empty\x20string.','prototype','kind','.target','functionName','string','10249299gfKwve','actions','commands','.actions.','isArray','1063498rMEWMJ','entries','1905hvBpHu','3929730Mkgjqv','error','trim','bff','.scriptName','19530830tEsECk','forEach','5171908gCALmT','action','target','call','.resources','4000LHFaUh','8CxylaU','map','.functionName','hasOwnProperty','push','bff.exec','fromEntries','882XaOpqN','$.resources','$.commands['];a60_0x44e7=function(){return _0x2102c7;};return a60_0x44e7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a61_0x32084e=a61_0x3add;function a61_0x11d7(){const _0x3d1288=['7rxXguY','WRITE','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','detail','cliPath','commands','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','2aLtmor','warnings','Imported\x20','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','Removed\x20service\x20','Service\x20Tree\x20manifest\x20file\x20path','serviceCount','registryServiceCode','5MzACjw','required','Imported','validate','errors','export','从本地运行态注册表移除\x20Service\x20Tree\x20清单','8dkzqjC','serviceCode','length','Service\x20registry\x20validation\x20passed.','list','Service\x20manifest\x20validation\x20passed.','13205070bCSJgv','write','kind','read','14713722GTOhJG','\x20service(s).','manifests','\x20service\x20','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','risk','imported','9938247otTEnk','version','entry','updated','7213566nNvLHg','remove','entries','122068vcnJJj','description','\x20service(s),\x20updated\x20','replaced','2905236QQrfDm','3634182YJwRbH','target','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','file','filePath','registryPath','normalizedManifest','name','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','source','manifest','Local\x20service\x20code,\x20for\x20example\x20crm','Local\x20service\x20not\x20found:\x20','cliName','将\x20Service\x20Tree\x20清单导入本地运行态注册表','hash','map','report','Exported\x20service\x20','str','service'];a61_0x11d7=function(){return _0x3d1288;};return a61_0x11d7();}(function(_0x15d629,_0x22acfb){const _0x4005cf=a61_0x3add,_0x923838=_0x15d629();while(!![]){try{const _0x480b42=parseInt(_0x4005cf(0x1e0))/0x1*(parseInt(_0x4005cf(0x1b9))/0x2)+-parseInt(_0x4005cf(0x1e5))/0x3+-parseInt(_0x4005cf(0x1e4))/0x4*(parseInt(_0x4005cf(0x1c1))/0x5)+parseInt(_0x4005cf(0x1dd))/0x6*(-parseInt(_0x4005cf(0x1b1))/0x7)+parseInt(_0x4005cf(0x1c8))/0x8*(parseInt(_0x4005cf(0x1d2))/0x9)+parseInt(_0x4005cf(0x1ce))/0xa+parseInt(_0x4005cf(0x1d9))/0xb;if(_0x480b42===_0x22acfb)break;else _0x923838['push'](_0x923838['shift']());}catch(_0x15e832){_0x923838['push'](_0x923838['shift']());}}}(a61_0x11d7,0xcd4f2));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a61_0x3add(_0x1d612f,_0x222fb0){_0x1d612f=_0x1d612f-0x1ad;const _0x11d73a=a61_0x11d7();let _0x3addc4=_0x11d73a[_0x1d612f];return _0x3addc4;}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a61_0x32084e(0x1e8),'type':'string','required':!![],'description':a61_0x32084e(0x1be)},SERVICE_FLAG={'name':'service','type':'string','required':!![],'description':a61_0x32084e(0x1f1),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x17688e){const _0x463997=a61_0x32084e;return{'serviceCode':_0x17688e[_0x463997(0x1c9)],'name':_0x17688e[_0x463997(0x1eb)][_0x463997(0x1b0)][_0x463997(0x1ec)],'version':_0x17688e[_0x463997(0x1da)],'importedAt':_0x17688e['importedAt'],'source':_0x17688e[_0x463997(0x1ef)],'commandCount':_0x17688e['normalizedManifest']['commands'][_0x463997(0x1ca)],'commands':_0x17688e['normalizedManifest'][_0x463997(0x1b6)][_0x463997(0x1f6)](_0x5b9cdf=>({'path':_0x5b9cdf[_0x463997(0x1b5)],'description':_0x5b9cdf[_0x463997(0x1e1)],'risk':_0x5b9cdf['risk'],'target':toPublicServiceTreeTarget(_0x5b9cdf[_0x463997(0x1e6)]),'flags':_0x5b9cdf['flags'][_0x463997(0x1f6)](_0x72f659=>({'name':_0x72f659[_0x463997(0x1ec)],'cliName':_0x72f659[_0x463997(0x1f3)],'type':_0x72f659['type'],'required':_0x72f659[_0x463997(0x1c2)]===!![]}))}))};}function summarizeLoadedManifest(_0x31aba3){const _0x3883e9=a61_0x32084e;return{'service':_0x31aba3[_0x3883e9(0x1eb)]?.[_0x3883e9(0x1b0)],'version':_0x31aba3['normalizedManifest']?.[_0x3883e9(0x1da)],'commandCount':_0x31aba3[_0x3883e9(0x1eb)]?.['commands'][_0x3883e9(0x1ca)]??0x0,'commands':_0x31aba3['normalizedManifest']?.[_0x3883e9(0x1b6)]['map'](_0x1908d4=>({'path':_0x1908d4['cliPath'],'risk':_0x1908d4['risk'],'target':toPublicServiceTreeTarget(_0x1908d4[_0x3883e9(0x1e6)])}))??[],'registryIndex':_0x31aba3['registryIndex'],'registryServiceCode':_0x31aba3[_0x3883e9(0x1c0)],'errors':_0x31aba3[_0x3883e9(0x1ad)]['errors'],'warnings':_0x31aba3[_0x3883e9(0x1ad)]['warnings']};}export const serviceDefinitions=[{'service':a61_0x32084e(0x1b0),'command':a61_0x32084e(0x1c4),'description':a61_0x32084e(0x1ed),'risk':a61_0x32084e(0x1d1),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x3d9d4c){const _0x37a302=a61_0x32084e,_0x194e17=loadServiceManifestFromFile(_0x3d9d4c[_0x37a302(0x1af)]('file'));if(!_0x194e17['report']['ok'])return{'ok':![],'data':{'file':_0x194e17['filePath'],'hash':_0x194e17[_0x37a302(0x1f5)],'kind':_0x194e17[_0x37a302(0x1d0)],'serviceCount':_0x194e17['manifests'][_0x37a302(0x1ca)],'services':_0x194e17['manifests']['map'](summarizeLoadedManifest),'errors':_0x194e17[_0x37a302(0x1ad)][_0x37a302(0x1c5)],'warnings':_0x194e17[_0x37a302(0x1ad)][_0x37a302(0x1ba)]},'message':formatValidationFailure(_0x194e17[_0x37a302(0x1ad)])};if(_0x194e17[_0x37a302(0x1d0)]==='registry'||_0x194e17[_0x37a302(0x1d4)][_0x37a302(0x1ca)]!==0x1)return{'ok':!![],'data':{'file':_0x194e17['filePath'],'hash':_0x194e17[_0x37a302(0x1f5)],'kind':_0x194e17['kind'],'serviceCount':_0x194e17[_0x37a302(0x1d4)][_0x37a302(0x1ca)],'commandCount':_0x194e17[_0x37a302(0x1d4)]['reduce']((_0x39a34e,_0x4d2a10)=>_0x39a34e+(_0x4d2a10[_0x37a302(0x1eb)]?.[_0x37a302(0x1b6)][_0x37a302(0x1ca)]??0x0),0x0),'services':_0x194e17[_0x37a302(0x1d4)][_0x37a302(0x1f6)](summarizeLoadedManifest),'warnings':_0x194e17[_0x37a302(0x1ad)]['warnings']},'message':_0x37a302(0x1cb)};return{'ok':!![],'data':{'file':_0x194e17['filePath'],'hash':_0x194e17['hash'],'kind':_0x194e17[_0x37a302(0x1d0)],'service':_0x194e17[_0x37a302(0x1eb)]?.[_0x37a302(0x1b0)],'version':_0x194e17[_0x37a302(0x1eb)]?.[_0x37a302(0x1da)],'commandCount':_0x194e17[_0x37a302(0x1eb)]?.[_0x37a302(0x1b6)]['length']??0x0,'commands':_0x194e17[_0x37a302(0x1eb)]?.[_0x37a302(0x1b6)]['map'](_0x55c491=>({'path':_0x55c491[_0x37a302(0x1b5)],'risk':_0x55c491[_0x37a302(0x1d7)],'target':toPublicServiceTreeTarget(_0x55c491[_0x37a302(0x1e6)])})),'warnings':_0x194e17[_0x37a302(0x1ad)][_0x37a302(0x1ba)]},'message':_0x37a302(0x1cd)};}},{'service':'service','command':'import','description':a61_0x32084e(0x1f4),'risk':'write','confirmationDescription':a61_0x32084e(0x1d6),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2bbd16){const _0x56ec16=a61_0x32084e,_0x5f47de=loadServiceManifestFromFile(_0x2bbd16['str'](_0x56ec16(0x1e8)));return{'method':_0x56ec16(0x1b2),'url':getServiceRegistryPath(),'body':{'file':_0x5f47de[_0x56ec16(0x1e9)],'hash':_0x5f47de['hash'],'kind':_0x5f47de['kind'],'ok':_0x5f47de[_0x56ec16(0x1ad)]['ok'],'service':_0x5f47de[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1b0)],'version':_0x5f47de[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1da)],'serviceCount':_0x5f47de[_0x56ec16(0x1d4)][_0x56ec16(0x1ca)],'services':_0x5f47de[_0x56ec16(0x1d4)][_0x56ec16(0x1f6)](_0x4072e4=>({'service':_0x4072e4['normalizedManifest']?.[_0x56ec16(0x1b0)],'version':_0x4072e4[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1da)],'commandCount':_0x4072e4[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1b6)][_0x56ec16(0x1ca)]??0x0,'errors':_0x4072e4[_0x56ec16(0x1ad)][_0x56ec16(0x1c5)]})),'errors':_0x5f47de[_0x56ec16(0x1ad)][_0x56ec16(0x1c5)],'commandCount':_0x5f47de[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1b6)]['length']??0x0},'description':_0x56ec16(0x1e7)};},async 'execute'(_0x5ac284){const _0x132f11=a61_0x32084e,_0xac3064=importServiceManifest(_0x5ac284[_0x132f11(0x1af)](_0x132f11(0x1e8)));if(_0xac3064['entries'][_0x132f11(0x1ca)]!==0x1)return{'ok':!![],'data':{'registryPath':_0xac3064[_0x132f11(0x1ea)],'imported':_0xac3064[_0x132f11(0x1d8)],'updated':_0xac3064[_0x132f11(0x1dc)],'serviceCount':_0xac3064[_0x132f11(0x1bf)],'services':_0xac3064[_0x132f11(0x1df)][_0x132f11(0x1f6)](summarizeService)},'message':_0x132f11(0x1bb)+_0xac3064[_0x132f11(0x1d8)]+_0x132f11(0x1e2)+_0xac3064[_0x132f11(0x1dc)]+_0x132f11(0x1d3)};return{'ok':!![],'data':{'registryPath':_0xac3064[_0x132f11(0x1ea)],'replaced':_0xac3064['replaced'],'imported':_0xac3064[_0x132f11(0x1d8)],'updated':_0xac3064[_0x132f11(0x1dc)],'serviceCount':_0xac3064[_0x132f11(0x1bf)],'service':summarizeService(_0xac3064[_0x132f11(0x1db)])},'message':(_0xac3064[_0x132f11(0x1e3)]?'Updated':_0x132f11(0x1c3))+_0x132f11(0x1d5)+_0xac3064['entry'][_0x132f11(0x1c9)]+'.'};}},{'service':a61_0x32084e(0x1b0),'command':a61_0x32084e(0x1c6),'description':'将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','risk':a61_0x32084e(0x1cf),'confirmationDescription':a61_0x32084e(0x1bc),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x42197a){const _0x1f5d52=a61_0x32084e,_0x27b1bb=getLocalServiceEntry(_0x42197a[_0x1f5d52(0x1af)](_0x1f5d52(0x1b0)));return{'method':_0x1f5d52(0x1b2),'url':_0x42197a[_0x1f5d52(0x1af)]('file'),'body':{'service':_0x42197a[_0x1f5d52(0x1af)](_0x1f5d52(0x1b0)),'found':Boolean(_0x27b1bb),'version':_0x27b1bb?.[_0x1f5d52(0x1da)],'source':_0x27b1bb?.['source']},'description':_0x1f5d52(0x1ee)};},async 'execute'(_0x30accd){const _0x533f56=a61_0x32084e,_0x281fc0=exportServiceManifest(_0x30accd[_0x533f56(0x1af)](_0x533f56(0x1b0)),_0x30accd['str'](_0x533f56(0x1e8)));return{'ok':!![],'data':{'registryPath':_0x281fc0[_0x533f56(0x1ea)],'file':_0x281fc0['filePath'],'service':summarizeService(_0x281fc0[_0x533f56(0x1db)])},'message':_0x533f56(0x1ae)+_0x281fc0['entry'][_0x533f56(0x1c9)]+'.'};}},{'service':a61_0x32084e(0x1b0),'command':a61_0x32084e(0x1cc),'description':a61_0x32084e(0x1b3),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x29a257=a61_0x32084e,_0x5d6f13=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x5d6f13[_0x29a257(0x1ca)],'services':_0x5d6f13['map'](summarizeService)}};}},{'service':a61_0x32084e(0x1b0),'command':a61_0x32084e(0x1de),'description':a61_0x32084e(0x1c7),'risk':a61_0x32084e(0x1cf),'confirmationDescription':a61_0x32084e(0x1b7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x51f872){const _0x3454a5=a61_0x32084e,_0x82c9c0=getLocalServiceEntry(_0x51f872[_0x3454a5(0x1af)](_0x3454a5(0x1b0)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x51f872[_0x3454a5(0x1af)](_0x3454a5(0x1b0)),'found':Boolean(_0x82c9c0),'version':_0x82c9c0?.[_0x3454a5(0x1da)],'source':_0x82c9c0?.[_0x3454a5(0x1ef)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x1eb630){const _0x59c160=a61_0x32084e,_0x3f3d20=removeServiceManifest(_0x1eb630[_0x59c160(0x1af)](_0x59c160(0x1b0)));return{'ok':!![],'data':{'registryPath':_0x3f3d20[_0x59c160(0x1ea)],'serviceCount':_0x3f3d20[_0x59c160(0x1bf)],'service':summarizeService(_0x3f3d20[_0x59c160(0x1db)])},'message':_0x59c160(0x1bd)+_0x3f3d20[_0x59c160(0x1db)]['serviceCode']+'.'};}},{'service':'service','command':a61_0x32084e(0x1b4),'description':a61_0x32084e(0x1b8),'risk':a61_0x32084e(0x1d1),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x413fa1){const _0x55b1ec=a61_0x32084e,_0x594c79=getLocalServiceEntry(_0x413fa1[_0x55b1ec(0x1af)]('service'));if(!_0x594c79)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x413fa1[_0x55b1ec(0x1af)](_0x55b1ec(0x1b0))},'message':_0x55b1ec(0x1f2)+_0x413fa1[_0x55b1ec(0x1af)](_0x55b1ec(0x1b0))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x594c79),'manifest':_0x594c79[_0x55b1ec(0x1f0)],'normalizedManifest':toPublicNormalizedServiceTree(_0x594c79[_0x55b1ec(0x1eb)])}};}}];
|
|
1
|
+
const a61_0x2aae0a=a61_0x2d1a;(function(_0x1f89f4,_0x27524f){const _0x281690=a61_0x2d1a,_0x3d91fb=_0x1f89f4();while(!![]){try{const _0x41f152=parseInt(_0x281690(0x1b7))/0x1*(-parseInt(_0x281690(0x186))/0x2)+-parseInt(_0x281690(0x181))/0x3*(parseInt(_0x281690(0x196))/0x4)+parseInt(_0x281690(0x185))/0x5*(parseInt(_0x281690(0x1b4))/0x6)+-parseInt(_0x281690(0x17c))/0x7+parseInt(_0x281690(0x1b2))/0x8+-parseInt(_0x281690(0x1b3))/0x9*(-parseInt(_0x281690(0x188))/0xa)+parseInt(_0x281690(0x173))/0xb;if(_0x41f152===_0x27524f)break;else _0x3d91fb['push'](_0x3d91fb['shift']());}catch(_0x2bb657){_0x3d91fb['push'](_0x3d91fb['shift']());}}}(a61_0x3276,0x3f274));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a61_0x2d1a(_0x2145a9,_0x4d9ef0){_0x2145a9=_0x2145a9-0x16e;const _0x3276af=a61_0x3276();let _0x2d1abc=_0x3276af[_0x2145a9];return _0x2d1abc;}function a61_0x3276(){const _0xe1d3cc=['hash','service','manifest','length','180300FfKfRq','Imported\x20','str','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','entry','entries','Exported\x20service\x20','list','Local\x20service\x20code,\x20for\x20example\x20crm','description','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','read','import','importedAt','write','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','cliPath','将\x20Service\x20Tree\x20清单导入本地运行态注册表','Service\x20registry\x20validation\x20passed.','kind','map','export','registryIndex','required','lower\x20kebab-case\x20service\x20code','normalizedManifest','manifests','warnings','678936iayxaF','1293687AKAeHk','24IUelBJ','\x20service(s),\x20updated\x20','version','1rwXkaV','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','serviceCount','name','Service\x20manifest\x20validation\x20passed.','string','4082903ciTAsl','commands','errors','registryPath','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','source','remove','Imported','file','994329zpJMuC','registryServiceCode','target','type','report','33kXCXSv','filePath','risk','serviceCode','602655Ejrhli','370718XXFoxj','imported','10ZFZIvA','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Removed\x20service\x20','updated','Updated','WRITE','reduce','cliName','replaced'];a61_0x3276=function(){return _0xe1d3cc;};return a61_0x3276();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a61_0x2aae0a(0x17b),'type':a61_0x2aae0a(0x172),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':'service','type':a61_0x2aae0a(0x172),'required':!![],'description':a61_0x2aae0a(0x19e),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a61_0x2aae0a(0x1ae)}};function summarizeService(_0x3075b5){const _0x57a4fc=a61_0x2aae0a;return{'serviceCode':_0x3075b5[_0x57a4fc(0x184)],'name':_0x3075b5[_0x57a4fc(0x1af)]['service'][_0x57a4fc(0x170)],'version':_0x3075b5[_0x57a4fc(0x1b6)],'importedAt':_0x3075b5[_0x57a4fc(0x1a3)],'source':_0x3075b5[_0x57a4fc(0x178)],'commandCount':_0x3075b5['normalizedManifest'][_0x57a4fc(0x174)][_0x57a4fc(0x195)],'commands':_0x3075b5[_0x57a4fc(0x1af)][_0x57a4fc(0x174)][_0x57a4fc(0x1aa)](_0x4fb204=>({'path':_0x4fb204[_0x57a4fc(0x1a6)],'description':_0x4fb204[_0x57a4fc(0x19f)],'risk':_0x4fb204[_0x57a4fc(0x183)],'target':toPublicServiceTreeTarget(_0x4fb204[_0x57a4fc(0x17e)]),'flags':_0x4fb204['flags'][_0x57a4fc(0x1aa)](_0x4f8924=>({'name':_0x4f8924[_0x57a4fc(0x170)],'cliName':_0x4f8924[_0x57a4fc(0x190)],'type':_0x4f8924[_0x57a4fc(0x17f)],'required':_0x4f8924[_0x57a4fc(0x1ad)]===!![]}))}))};}function summarizeLoadedManifest(_0xbcb2a1){const _0x5e4af=a61_0x2aae0a;return{'service':_0xbcb2a1[_0x5e4af(0x1af)]?.[_0x5e4af(0x193)],'version':_0xbcb2a1[_0x5e4af(0x1af)]?.[_0x5e4af(0x1b6)],'commandCount':_0xbcb2a1['normalizedManifest']?.[_0x5e4af(0x174)][_0x5e4af(0x195)]??0x0,'commands':_0xbcb2a1[_0x5e4af(0x1af)]?.[_0x5e4af(0x174)][_0x5e4af(0x1aa)](_0x41fbd7=>({'path':_0x41fbd7['cliPath'],'risk':_0x41fbd7['risk'],'target':toPublicServiceTreeTarget(_0x41fbd7[_0x5e4af(0x17e)])}))??[],'registryIndex':_0xbcb2a1[_0x5e4af(0x1ac)],'registryServiceCode':_0xbcb2a1[_0x5e4af(0x17d)],'errors':_0xbcb2a1[_0x5e4af(0x180)][_0x5e4af(0x175)],'warnings':_0xbcb2a1[_0x5e4af(0x180)]['warnings']};}export const serviceDefinitions=[{'service':a61_0x2aae0a(0x193),'command':'validate','description':a61_0x2aae0a(0x18a),'risk':a61_0x2aae0a(0x1a1),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x54ac8e){const _0x13e7eb=a61_0x2aae0a,_0x9dc0a0=loadServiceManifestFromFile(_0x54ac8e[_0x13e7eb(0x198)](_0x13e7eb(0x17b)));if(!_0x9dc0a0[_0x13e7eb(0x180)]['ok'])return{'ok':![],'data':{'file':_0x9dc0a0[_0x13e7eb(0x182)],'hash':_0x9dc0a0[_0x13e7eb(0x192)],'kind':_0x9dc0a0[_0x13e7eb(0x1a9)],'serviceCount':_0x9dc0a0['manifests'][_0x13e7eb(0x195)],'services':_0x9dc0a0[_0x13e7eb(0x1b0)][_0x13e7eb(0x1aa)](summarizeLoadedManifest),'errors':_0x9dc0a0[_0x13e7eb(0x180)][_0x13e7eb(0x175)],'warnings':_0x9dc0a0[_0x13e7eb(0x180)][_0x13e7eb(0x1b1)]},'message':formatValidationFailure(_0x9dc0a0[_0x13e7eb(0x180)])};if(_0x9dc0a0[_0x13e7eb(0x1a9)]==='registry'||_0x9dc0a0[_0x13e7eb(0x1b0)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x9dc0a0[_0x13e7eb(0x182)],'hash':_0x9dc0a0[_0x13e7eb(0x192)],'kind':_0x9dc0a0[_0x13e7eb(0x1a9)],'serviceCount':_0x9dc0a0[_0x13e7eb(0x1b0)][_0x13e7eb(0x195)],'commandCount':_0x9dc0a0[_0x13e7eb(0x1b0)][_0x13e7eb(0x18f)]((_0x1c395e,_0x5815c4)=>_0x1c395e+(_0x5815c4['normalizedManifest']?.[_0x13e7eb(0x174)][_0x13e7eb(0x195)]??0x0),0x0),'services':_0x9dc0a0['manifests']['map'](summarizeLoadedManifest),'warnings':_0x9dc0a0[_0x13e7eb(0x180)][_0x13e7eb(0x1b1)]},'message':_0x13e7eb(0x1a8)};return{'ok':!![],'data':{'file':_0x9dc0a0['filePath'],'hash':_0x9dc0a0[_0x13e7eb(0x192)],'kind':_0x9dc0a0[_0x13e7eb(0x1a9)],'service':_0x9dc0a0[_0x13e7eb(0x1af)]?.['service'],'version':_0x9dc0a0['normalizedManifest']?.[_0x13e7eb(0x1b6)],'commandCount':_0x9dc0a0[_0x13e7eb(0x1af)]?.[_0x13e7eb(0x174)][_0x13e7eb(0x195)]??0x0,'commands':_0x9dc0a0['normalizedManifest']?.[_0x13e7eb(0x174)][_0x13e7eb(0x1aa)](_0x333121=>({'path':_0x333121['cliPath'],'risk':_0x333121[_0x13e7eb(0x183)],'target':toPublicServiceTreeTarget(_0x333121[_0x13e7eb(0x17e)])})),'warnings':_0x9dc0a0[_0x13e7eb(0x180)][_0x13e7eb(0x1b1)]},'message':_0x13e7eb(0x171)};}},{'service':a61_0x2aae0a(0x193),'command':a61_0x2aae0a(0x1a2),'description':a61_0x2aae0a(0x1a7),'risk':a61_0x2aae0a(0x1a4),'confirmationDescription':a61_0x2aae0a(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x117043){const _0x3befa8=a61_0x2aae0a,_0x572bd8=loadServiceManifestFromFile(_0x117043[_0x3befa8(0x198)](_0x3befa8(0x17b)));return{'method':_0x3befa8(0x18e),'url':getServiceRegistryPath(),'body':{'file':_0x572bd8[_0x3befa8(0x182)],'hash':_0x572bd8[_0x3befa8(0x192)],'kind':_0x572bd8[_0x3befa8(0x1a9)],'ok':_0x572bd8[_0x3befa8(0x180)]['ok'],'service':_0x572bd8[_0x3befa8(0x1af)]?.[_0x3befa8(0x193)],'version':_0x572bd8[_0x3befa8(0x1af)]?.[_0x3befa8(0x1b6)],'serviceCount':_0x572bd8[_0x3befa8(0x1b0)][_0x3befa8(0x195)],'services':_0x572bd8['manifests'][_0x3befa8(0x1aa)](_0x37cd34=>({'service':_0x37cd34[_0x3befa8(0x1af)]?.[_0x3befa8(0x193)],'version':_0x37cd34[_0x3befa8(0x1af)]?.['version'],'commandCount':_0x37cd34[_0x3befa8(0x1af)]?.[_0x3befa8(0x174)][_0x3befa8(0x195)]??0x0,'errors':_0x37cd34[_0x3befa8(0x180)][_0x3befa8(0x175)]})),'errors':_0x572bd8[_0x3befa8(0x180)][_0x3befa8(0x175)],'commandCount':_0x572bd8['normalizedManifest']?.['commands'][_0x3befa8(0x195)]??0x0},'description':_0x3befa8(0x16e)};},async 'execute'(_0x4e2697){const _0x43c868=a61_0x2aae0a,_0x54ca4c=importServiceManifest(_0x4e2697[_0x43c868(0x198)](_0x43c868(0x17b)));if(_0x54ca4c[_0x43c868(0x19b)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x54ca4c[_0x43c868(0x176)],'imported':_0x54ca4c['imported'],'updated':_0x54ca4c['updated'],'serviceCount':_0x54ca4c['serviceCount'],'services':_0x54ca4c[_0x43c868(0x19b)][_0x43c868(0x1aa)](summarizeService)},'message':_0x43c868(0x197)+_0x54ca4c[_0x43c868(0x187)]+_0x43c868(0x1b5)+_0x54ca4c[_0x43c868(0x18c)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x54ca4c[_0x43c868(0x176)],'replaced':_0x54ca4c['replaced'],'imported':_0x54ca4c[_0x43c868(0x187)],'updated':_0x54ca4c[_0x43c868(0x18c)],'serviceCount':_0x54ca4c[_0x43c868(0x16f)],'service':summarizeService(_0x54ca4c['entry'])},'message':(_0x54ca4c[_0x43c868(0x191)]?_0x43c868(0x18d):_0x43c868(0x17a))+'\x20service\x20'+_0x54ca4c['entry'][_0x43c868(0x184)]+'.'};}},{'service':'service','command':a61_0x2aae0a(0x1ab),'description':a61_0x2aae0a(0x189),'risk':a61_0x2aae0a(0x1a4),'confirmationDescription':a61_0x2aae0a(0x1a5),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x32220b){const _0xb5bc89=a61_0x2aae0a,_0x21a57e=getLocalServiceEntry(_0x32220b[_0xb5bc89(0x198)](_0xb5bc89(0x193)));return{'method':'WRITE','url':_0x32220b[_0xb5bc89(0x198)](_0xb5bc89(0x17b)),'body':{'service':_0x32220b[_0xb5bc89(0x198)](_0xb5bc89(0x193)),'found':Boolean(_0x21a57e),'version':_0x21a57e?.['version'],'source':_0x21a57e?.['source']},'description':_0xb5bc89(0x199)};},async 'execute'(_0x3eb64b){const _0x4d9069=a61_0x2aae0a,_0x911c05=exportServiceManifest(_0x3eb64b['str']('service'),_0x3eb64b['str'](_0x4d9069(0x17b)));return{'ok':!![],'data':{'registryPath':_0x911c05[_0x4d9069(0x176)],'file':_0x911c05['filePath'],'service':summarizeService(_0x911c05[_0x4d9069(0x19a)])},'message':_0x4d9069(0x19c)+_0x911c05[_0x4d9069(0x19a)]['serviceCode']+'.'};}},{'service':a61_0x2aae0a(0x193),'command':a61_0x2aae0a(0x19d),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a61_0x2aae0a(0x1a1),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x3ced05=a61_0x2aae0a,_0x571bf8=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x571bf8[_0x3ced05(0x195)],'services':_0x571bf8[_0x3ced05(0x1aa)](summarizeService)}};}},{'service':a61_0x2aae0a(0x193),'command':a61_0x2aae0a(0x179),'description':'从本地运行态注册表移除\x20Service\x20Tree\x20清单','risk':a61_0x2aae0a(0x1a4),'confirmationDescription':'将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x5ab8d8){const _0x290a62=a61_0x2aae0a,_0x15bff7=getLocalServiceEntry(_0x5ab8d8[_0x290a62(0x198)](_0x290a62(0x193)));return{'method':_0x290a62(0x18e),'url':getServiceRegistryPath(),'body':{'service':_0x5ab8d8[_0x290a62(0x198)](_0x290a62(0x193)),'found':Boolean(_0x15bff7),'version':_0x15bff7?.['version'],'source':_0x15bff7?.[_0x290a62(0x178)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x181a3e){const _0x2f237=a61_0x2aae0a,_0x52f9b7=removeServiceManifest(_0x181a3e[_0x2f237(0x198)](_0x2f237(0x193)));return{'ok':!![],'data':{'registryPath':_0x52f9b7[_0x2f237(0x176)],'serviceCount':_0x52f9b7[_0x2f237(0x16f)],'service':summarizeService(_0x52f9b7['entry'])},'message':_0x2f237(0x18b)+_0x52f9b7[_0x2f237(0x19a)][_0x2f237(0x184)]+'.'};}},{'service':a61_0x2aae0a(0x193),'command':'detail','description':a61_0x2aae0a(0x1a0),'risk':a61_0x2aae0a(0x1a1),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x9bbf6c){const _0xf6e3d4=a61_0x2aae0a,_0x15712e=getLocalServiceEntry(_0x9bbf6c[_0xf6e3d4(0x198)]('service'));if(!_0x15712e)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x9bbf6c['str'](_0xf6e3d4(0x193))},'message':'Local\x20service\x20not\x20found:\x20'+_0x9bbf6c['str']('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x15712e),'manifest':_0x15712e[_0xf6e3d4(0x194)],'normalizedManifest':toPublicNormalizedServiceTree(_0x15712e['normalizedManifest'])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a62_0x4371ec=a62_0xb9ba;(function(_0x3b954e,_0x429ee3){const _0x413261=a62_0xb9ba,_0x47a972=_0x3b954e();while(!![]){try{const _0x18a8f0=parseInt(_0x413261(0x1b9))/0x1+-parseInt(_0x413261(0x1be))/0x2+parseInt(_0x413261(0x1ea))/0x3*(-parseInt(_0x413261(0x1b5))/0x4)+parseInt(_0x413261(0x1e7))/0x5+-parseInt(_0x413261(0x1c2))/0x6*(parseInt(_0x413261(0x1c1))/0x7)+-parseInt(_0x413261(0x1b4))/0x8+-parseInt(_0x413261(0x1f2))/0x9*(-parseInt(_0x413261(0x1eb))/0xa);if(_0x18a8f0===_0x429ee3)break;else _0x47a972['push'](_0x47a972['shift']());}catch(_0xf2e932){_0x47a972['push'](_0x47a972['shift']());}}}(a62_0x2f75,0xe1d2d));function a62_0x2f75(){const _0x57fc25=['validation','report','version','length','flatMap','toISOString','117sDyOgs','$.services[','Invalid\x20service\x20registry\x20JSON:\x20','].manifest','message','Service\x20manifest\x20file\x20not\x20found:\x20','splice','services','parse','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','manifests','map','service','command','find','Unsupported\x20service\x20registry\x20schemaVersion:\x20','Cannot\x20write\x20service\x20registry:\x20','homeDirName','11507368HhivSL','28232LelMoL','slice','description','updatedAt','459974lLiDzf','commandCount','ENOENT','name','warnings','1052304LQEJkk','push','trim','7pPKGAT','1435578GItySL','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','startsWith','Service\x20manifest\x20validation\x20failed:\x0a','sha256','.tmp','utf8','manifest','invalid','errors','now','serviceCode','Local\x20service\x20not\x20found:\x20','code','schemaVersion','path','].manifest.','Remove\x20or\x20migrate\x20','sort','hex','digest','registryIndex','missing','importedAt','bff\x20target\x20requires\x20functionName.','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','service.json','localeCompare','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','object','string','empty','stringify','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','normalizedManifest','reduce','isArray','2423480qGXnku','filePath','homeDir','222bBKzkm','2081870CybMBD'];a62_0x2f75=function(){return _0x57fc25;};return a62_0x2f75();}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_0x4371ec(0x1dc);export function getServiceRegistryPath(_0x193461={}){const _0x214265=a62_0x4371ec;return resolve(_0x193461[_0x214265(0x1e9)]??homedir(),PRODUCT_CONFIG[_0x214265(0x1b3)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x5c184a={}){const _0x32c37f=a62_0x4371ec,_0x5654ef=getServiceRegistryPath(_0x5c184a);if(!existsSync(_0x5654ef))return emptyServiceRegistry();try{const _0x2fbf10=readFileSync(_0x5654ef,_0x32c37f(0x1c8));if(!_0x2fbf10[_0x32c37f(0x1c0)]())return emptyServiceRegistry();const _0x14b177=JSON[_0x32c37f(0x1aa)](_0x2fbf10);if(_0x14b177[_0x32c37f(0x1d0)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x32c37f(0x1ec)](_0x32c37f(0x1b1)+String(_0x14b177[_0x32c37f(0x1d0)]),_0x32c37f(0x1d3)+_0x5654ef+'.');if(!Array[_0x32c37f(0x1e6)](_0x14b177[_0x32c37f(0x1a9)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x14b177[_0x32c37f(0x1b8)],'services':_0x14b177['services']};}catch(_0x77542){if(_0x77542 instanceof Error&&_0x77542[_0x32c37f(0x1bc)]==='CliError')throw _0x77542;throw CliErrors['validation'](_0x32c37f(0x1a4)+_0x5654ef,_0x32c37f(0x1de));}}export function writeServiceRegistry(_0x48709d,_0x421ff4={}){const _0x2ac495=a62_0x4371ec,_0x47ca80=getServiceRegistryPath(_0x421ff4),_0xf6c20=dirname(_0x47ca80);!existsSync(_0xf6c20)&&mkdirSync(_0xf6c20,{'recursive':!![]});const _0x15c9f4=_0x47ca80+_0x2ac495(0x1c7);try{writeFileSync(_0x15c9f4,JSON[_0x2ac495(0x1e2)](_0x48709d,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x15c9f4,_0x47ca80);}catch(_0x3b4719){try{unlinkSync(_0x15c9f4);}catch{}if(_0x3b4719?.[_0x2ac495(0x1cf)]===_0x2ac495(0x1bb))throw CliErrors['validation'](_0x2ac495(0x1b2)+_0x47ca80);throw _0x3b4719;}return _0x47ca80;}export function loadServiceManifestFromFile(_0x1f64cd){const _0x267a2f=a62_0x4371ec,_0x41d248=resolve(_0x1f64cd);if(!existsSync(_0x41d248))throw CliErrors[_0x267a2f(0x1ec)](_0x267a2f(0x1a7)+_0x1f64cd);let _0x19c208;const _0x4fcb7d=readFileSync(_0x41d248,_0x267a2f(0x1c8));try{_0x19c208=JSON[_0x267a2f(0x1aa)](_0x4fcb7d);}catch{throw CliErrors[_0x267a2f(0x1ec)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x1f64cd,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x133c74=sha256(_0x4fcb7d),_0x3d828f=extractLoadedServiceManifests(_0x19c208,_0x133c74),_0x3591a0=aggregateValidationReports(_0x3d828f),_0x2d95b5=_0x3d828f[0x0];return{'filePath':_0x41d248,'hash':_0x133c74,'kind':isServiceRegistryLike(_0x19c208)?'registry':_0x267a2f(0x1c9),'manifest':_0x2d95b5?.[_0x267a2f(0x1c9)]??_0x19c208,'report':_0x3591a0,'normalizedManifest':_0x3d828f[_0x267a2f(0x1ef)]===0x1?_0x2d95b5?.['normalizedManifest']:undefined,'manifests':_0x3d828f};}export function importServiceManifest(_0x1e94a8,_0x51c6a7={}){const _0x7c4cc9=a62_0x4371ec,_0x10b352=loadServiceManifestFromFile(_0x1e94a8);if(!_0x10b352[_0x7c4cc9(0x1ed)]['ok'])throw CliErrors[_0x7c4cc9(0x1ec)](formatValidationFailure(_0x10b352[_0x7c4cc9(0x1ed)]),_0x7c4cc9(0x1c3));if(_0x10b352[_0x7c4cc9(0x1ac)][_0x7c4cc9(0x1ef)]===0x0)throw CliErrors[_0x7c4cc9(0x1ec)](_0x7c4cc9(0x1ab),_0x7c4cc9(0x1db));const _0x34e126=readServiceRegistry(_0x51c6a7),_0x333a0c=(_0x51c6a7[_0x7c4cc9(0x1cc)]??(()=>new Date()))()[_0x7c4cc9(0x1f1)](),_0x4e3fb1=[];let _0x4d559d=0x0,_0x18d59b=0x0;for(const _0x39239e of _0x10b352[_0x7c4cc9(0x1ac)]){if(!_0x39239e[_0x7c4cc9(0x1e4)])continue;const _0x395c42=_0x39239e[_0x7c4cc9(0x1e4)][_0x7c4cc9(0x1ae)][_0x7c4cc9(0x1cf)],_0x3e043d={'serviceCode':_0x395c42,'version':_0x39239e[_0x7c4cc9(0x1e4)][_0x7c4cc9(0x1ee)],'importedAt':_0x333a0c,'source':{'type':'file','path':_0x10b352[_0x7c4cc9(0x1e8)],'hash':_0x39239e['sourceHash']},'manifest':_0x39239e['manifest'],'normalizedManifest':_0x39239e[_0x7c4cc9(0x1e4)]},_0x47a2ee=_0x34e126[_0x7c4cc9(0x1a9)]['findIndex'](_0x3169f8=>_0x3169f8['serviceCode']===_0x395c42);_0x47a2ee>=0x0?(_0x34e126[_0x7c4cc9(0x1a9)][_0x47a2ee]=_0x3e043d,_0x18d59b++):(_0x34e126['services'][_0x7c4cc9(0x1bf)](_0x3e043d),_0x4d559d++),_0x4e3fb1[_0x7c4cc9(0x1bf)](_0x3e043d);}_0x34e126[_0x7c4cc9(0x1a9)][_0x7c4cc9(0x1d4)]((_0x1cba94,_0x5013ca)=>_0x1cba94[_0x7c4cc9(0x1cd)][_0x7c4cc9(0x1dd)](_0x5013ca[_0x7c4cc9(0x1cd)])),_0x34e126[_0x7c4cc9(0x1b8)]=_0x333a0c;const _0x385766=writeServiceRegistry(_0x34e126,_0x51c6a7);return{'registryPath':_0x385766,'entry':_0x4e3fb1[0x0],'replaced':_0x4e3fb1[_0x7c4cc9(0x1ef)]===0x1?_0x18d59b===0x1:_0x18d59b>0x0,'entries':_0x4e3fb1,'imported':_0x4d559d,'updated':_0x18d59b,'serviceCount':_0x34e126['services'][_0x7c4cc9(0x1ef)]};}export function exportServiceManifest(_0x1a7df0,_0x4bf072,_0x3f5621={}){const _0x27c614=a62_0x4371ec,_0x533ae0=getServiceRegistryPath(_0x3f5621),_0x4c81d8=getLocalServiceEntry(_0x1a7df0,_0x3f5621);if(!_0x4c81d8)throw CliErrors[_0x27c614(0x1ec)]('Local\x20service\x20not\x20found:\x20'+_0x1a7df0,_0x27c614(0x1e3));const _0x14df6d=resolve(_0x4bf072),_0x167fde=dirname(_0x14df6d);return!existsSync(_0x167fde)&&mkdirSync(_0x167fde,{'recursive':!![]}),writeFileSync(_0x14df6d,JSON[_0x27c614(0x1e2)](_0x4c81d8[_0x27c614(0x1c9)],null,0x2)+'\x0a',{'encoding':_0x27c614(0x1c8),'mode':0x180}),{'registryPath':_0x533ae0,'filePath':_0x14df6d,'entry':_0x4c81d8};}export function removeServiceManifest(_0x21c274,_0x1e5bf8={}){const _0x5c5191=a62_0x4371ec,_0x37dda6=readServiceRegistry(_0x1e5bf8),_0x59d86d=_0x21c274['trim'](),_0x29d8a4=_0x37dda6[_0x5c5191(0x1a9)]['findIndex'](_0x5c8902=>_0x5c8902['serviceCode']===_0x59d86d);if(_0x29d8a4<0x0)throw CliErrors[_0x5c5191(0x1ec)](_0x5c5191(0x1ce)+_0x59d86d,_0x5c5191(0x1e3));const [_0x7d93b4]=_0x37dda6[_0x5c5191(0x1a9)][_0x5c5191(0x1a8)](_0x29d8a4,0x1),_0x3e7577=(_0x1e5bf8[_0x5c5191(0x1cc)]??(()=>new Date()))()[_0x5c5191(0x1f1)]();_0x37dda6['updatedAt']=_0x3e7577;const _0x5ac822=writeServiceRegistry(_0x37dda6,_0x1e5bf8);return{'registryPath':_0x5ac822,'entry':_0x7d93b4,'serviceCount':_0x37dda6[_0x5c5191(0x1a9)][_0x5c5191(0x1ef)]};}export function listLocalServices(_0x209b58={}){const _0x5517cb=a62_0x4371ec;return readServiceRegistry(_0x209b58)[_0x5517cb(0x1a9)];}export function getLocalServiceEntry(_0x56f2ad,_0x2df5f2={}){const _0x44b726=a62_0x4371ec;return readServiceRegistry(_0x2df5f2)[_0x44b726(0x1a9)][_0x44b726(0x1b0)](_0x457d52=>_0x457d52[_0x44b726(0x1cd)]===_0x56f2ad[_0x44b726(0x1c0)]());}export function listLocalServiceTrees(_0x17e0c8={}){const _0xa3edc9=a62_0x4371ec;return readServiceRegistry(_0x17e0c8)[_0xa3edc9(0x1a9)][_0xa3edc9(0x1ad)](_0x25625f=>_0x25625f[_0xa3edc9(0x1e4)]);}export function inspectServiceRegistry(_0x3310b5={}){const _0x1981c5=a62_0x4371ec,_0x157f9f=getServiceRegistryPath(_0x3310b5);if(!existsSync(_0x157f9f))return emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1d8),![]);try{const _0x138a84=readFileSync(_0x157f9f,'utf8');if(!_0x138a84[_0x1981c5(0x1c0)]())return emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1e1),!![]);const _0x109870=JSON[_0x1981c5(0x1aa)](_0x138a84);if(_0x109870['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1ca),!![]),'schemaVersion':_0x109870[_0x1981c5(0x1d0)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x109870[_0x1981c5(0x1d0)])};if(!Array['isArray'](_0x109870[_0x1981c5(0x1a9)]))return{...emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1ca),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x109870[_0x1981c5(0x1b8)],'message':'services\x20must\x20be\x20an\x20array'};const _0x58dd45=_0x109870['services'][_0x1981c5(0x1ad)](summarizeLocalServiceEntry);return{'registryPath':_0x157f9f,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x109870[_0x1981c5(0x1b8)],'serviceCount':_0x58dd45['length'],'commandCount':_0x58dd45[_0x1981c5(0x1e5)]((_0x338f9a,_0x465af4)=>_0x338f9a+_0x465af4[_0x1981c5(0x1ba)],0x0),'services':_0x58dd45};}catch(_0x3be9cb){return{...emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1ca),!![]),'message':_0x3be9cb instanceof Error?_0x3be9cb[_0x1981c5(0x1a6)]:String(_0x3be9cb)};}}export function formatValidationFailure(_0x1fa23b){const _0xb87149=a62_0x4371ec,_0x1988cf=_0x1fa23b[_0xb87149(0x1cb)][_0xb87149(0x1ad)](_0x24374a=>_0x24374a[_0xb87149(0x1d1)]+':\x20'+_0x24374a[_0xb87149(0x1a6)]);return _0xb87149(0x1c5)+_0x1988cf['join']('\x0a');}function a62_0xb9ba(_0x2dcea3,_0x5d9d37){_0x2dcea3=_0x2dcea3-0x1a4;const _0x2f751c=a62_0x2f75();let _0xb9bab2=_0x2f751c[_0x2dcea3];return _0xb9bab2;}function extractLoadedServiceManifests(_0x32de52,_0x231e2b){const _0x242b0b=a62_0x4371ec;if(!isServiceRegistryLike(_0x32de52)){const _0x32a6d6=_0x32de52,{manifest:_0x1e3c02,errors:_0x46e5c8}=adaptServiceTreeManifestForLegacyFramework(_0x32a6d6),_0x5e7e31=validateServiceTreeManifest(_0x1e3c02),_0x2259c6=mergeValidationErrors(_0x5e7e31,_0x46e5c8);return[{'manifest':_0x32a6d6,'report':_0x2259c6,'normalizedManifest':_0x2259c6['ok']?normalizeServiceTreeManifest(_0x1e3c02):undefined,'sourceHash':_0x231e2b}];}return _0x32de52['services'][_0x242b0b(0x1ad)]((_0x3ccb4e,_0x4d2745)=>{const _0x1e08f9=_0x242b0b,_0x36386d=isObjectRecord(_0x3ccb4e)?_0x3ccb4e[_0x1e08f9(0x1c9)]:undefined,{manifest:_0x558ed5,errors:_0x16b539}=adaptServiceTreeManifestForLegacyFramework(_0x36386d),_0x312b52=validateServiceTreeManifest(_0x558ed5),_0x2c669f=mergeValidationErrors(_0x312b52,_0x16b539),_0x3b1445=isObjectRecord(_0x3ccb4e)&&typeof _0x3ccb4e['serviceCode']===_0x1e08f9(0x1e0)?_0x3ccb4e[_0x1e08f9(0x1cd)]:undefined;return{'manifest':_0x36386d,'report':_0x2c669f,'normalizedManifest':_0x2c669f['ok']?normalizeServiceTreeManifest(_0x558ed5):undefined,'sourceHash':sha256(JSON[_0x1e08f9(0x1e2)](_0x36386d,null,0x2)+'\x0a'),'registryIndex':_0x4d2745,'registryServiceCode':_0x3b1445};});}function mergeValidationErrors(_0x22d42e,_0x5b765c){const _0xd8bc3b=a62_0x4371ec,_0x1cf8c2=_0x22d42e[_0xd8bc3b(0x1cb)][_0xd8bc3b(0x1ad)](_0xc8d8a6=>_0xc8d8a6[_0xd8bc3b(0x1a6)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0xc8d8a6,'message':_0xd8bc3b(0x1da)}:_0xc8d8a6),_0x45cedf=[..._0x5b765c,..._0x1cf8c2];return{'ok':_0x45cedf[_0xd8bc3b(0x1ef)]===0x0,'errors':_0x45cedf,'warnings':_0x22d42e['warnings']};}function aggregateValidationReports(_0x10ab4a){const _0x4dcdcc=a62_0x4371ec,_0xb42a0f=_0x10ab4a[_0x4dcdcc(0x1f0)](_0x70c4f2=>_0x70c4f2['registryIndex']===undefined?_0x70c4f2['report'][_0x4dcdcc(0x1cb)]:_0x70c4f2[_0x4dcdcc(0x1ed)][_0x4dcdcc(0x1cb)][_0x4dcdcc(0x1ad)](_0x5909e8=>({..._0x5909e8,'path':prefixRegistryIssuePath(_0x70c4f2[_0x4dcdcc(0x1d7)],_0x5909e8[_0x4dcdcc(0x1d1)])}))),_0x8168ba=_0x10ab4a['flatMap'](_0xb5664=>_0xb5664[_0x4dcdcc(0x1d7)]===undefined?_0xb5664[_0x4dcdcc(0x1ed)][_0x4dcdcc(0x1bd)]:_0xb5664[_0x4dcdcc(0x1ed)][_0x4dcdcc(0x1bd)]['map'](_0x1752d5=>({..._0x1752d5,'path':prefixRegistryIssuePath(_0xb5664[_0x4dcdcc(0x1d7)],_0x1752d5[_0x4dcdcc(0x1d1)])})));return{'ok':_0xb42a0f[_0x4dcdcc(0x1ef)]===0x0,'errors':_0xb42a0f,'warnings':_0x8168ba};}function prefixRegistryIssuePath(_0x54a458,_0x4f7873){const _0x47d5d2=a62_0x4371ec;if(_0x4f7873==='$')return _0x47d5d2(0x1f3)+_0x54a458+_0x47d5d2(0x1a5);if(_0x4f7873[_0x47d5d2(0x1c4)]('$.'))return _0x47d5d2(0x1f3)+_0x54a458+_0x47d5d2(0x1a5)+_0x4f7873[_0x47d5d2(0x1b6)](0x1);if(_0x4f7873['startsWith']('$['))return _0x47d5d2(0x1f3)+_0x54a458+_0x47d5d2(0x1a5)+_0x4f7873[_0x47d5d2(0x1b6)](0x1);return _0x47d5d2(0x1f3)+_0x54a458+_0x47d5d2(0x1d2)+_0x4f7873;}function isServiceRegistryLike(_0x1fce58){const _0xe36dfd=a62_0x4371ec;return isObjectRecord(_0x1fce58)&&_0x1fce58['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0xe36dfd(0x1e6)](_0x1fce58['services']);}function isObjectRecord(_0x26bf18){const _0x57567a=a62_0x4371ec;return Boolean(_0x26bf18)&&typeof _0x26bf18===_0x57567a(0x1df)&&!Array['isArray'](_0x26bf18);}function emptyServiceRegistryInspection(_0x46020b,_0x2fd962,_0xdb8521){return{'registryPath':_0x46020b,'exists':_0xdb8521,'status':_0x2fd962,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x4b1b59){const _0x45460c=a62_0x4371ec,_0x402c5e=_0x4b1b59[_0x45460c(0x1e4)],_0x315e0c=_0x402c5e['commands'][_0x45460c(0x1ad)](_0x1699a9=>({'path':_0x1699a9['cliPath'],'description':_0x1699a9[_0x45460c(0x1b7)],'risk':_0x1699a9['risk'],'targetKind':_0x1699a9['target']['kind'],'targetCommand':_0x1699a9['target'][_0x45460c(0x1af)]}));return{'serviceCode':_0x4b1b59['serviceCode'],'name':_0x402c5e[_0x45460c(0x1ae)][_0x45460c(0x1bc)],'description':_0x402c5e[_0x45460c(0x1ae)][_0x45460c(0x1b7)],'version':_0x4b1b59[_0x45460c(0x1ee)],'importedAt':_0x4b1b59[_0x45460c(0x1d9)],'source':_0x4b1b59['source'],'commandCount':_0x315e0c[_0x45460c(0x1ef)],'commands':_0x315e0c};}function sha256(_0x2a8a88){const _0x4fe1dc=a62_0x4371ec;return createHash(_0x4fe1dc(0x1c6))['update'](_0x2a8a88)[_0x4fe1dc(0x1d6)](_0x4fe1dc(0x1d5));}
|
|
1
|
+
const a62_0x15322d=a62_0x43bf;(function(_0x31f68a,_0x30b0dc){const _0x3b0b5f=a62_0x43bf,_0x1f6601=_0x31f68a();while(!![]){try{const _0x428efb=-parseInt(_0x3b0b5f(0x184))/0x1*(parseInt(_0x3b0b5f(0x1be))/0x2)+-parseInt(_0x3b0b5f(0x1ad))/0x3+-parseInt(_0x3b0b5f(0x18b))/0x4+-parseInt(_0x3b0b5f(0x186))/0x5*(parseInt(_0x3b0b5f(0x1d4))/0x6)+parseInt(_0x3b0b5f(0x1a7))/0x7+-parseInt(_0x3b0b5f(0x197))/0x8+parseInt(_0x3b0b5f(0x182))/0x9;if(_0x428efb===_0x30b0dc)break;else _0x1f6601['push'](_0x1f6601['shift']());}catch(_0x158111){_0x1f6601['push'](_0x1f6601['shift']());}}}(a62_0x538b,0xbe06b));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_0x15322d(0x1bb);export function getServiceRegistryPath(_0x50b32b={}){const _0x482cb4=a62_0x15322d;return resolve(_0x50b32b[_0x482cb4(0x181)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x5e8e71={}){const _0x4f2d04=a62_0x15322d,_0x4b2ead=getServiceRegistryPath(_0x5e8e71);if(!existsSync(_0x4b2ead))return emptyServiceRegistry();try{const _0x5ce480=readFileSync(_0x4b2ead,'utf8');if(!_0x5ce480[_0x4f2d04(0x1b9)]())return emptyServiceRegistry();const _0x123ff2=JSON[_0x4f2d04(0x19e)](_0x5ce480);if(_0x123ff2[_0x4f2d04(0x1d1)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x4f2d04(0x1a3)](_0x4f2d04(0x1c4)+String(_0x123ff2[_0x4f2d04(0x1d1)]),_0x4f2d04(0x19b)+_0x4b2ead+'.');if(!Array[_0x4f2d04(0x1a2)](_0x123ff2[_0x4f2d04(0x1b1)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x123ff2['updatedAt'],'services':_0x123ff2['services']};}catch(_0x427fae){if(_0x427fae instanceof Error&&_0x427fae[_0x4f2d04(0x1d6)]==='CliError')throw _0x427fae;throw CliErrors['validation'](_0x4f2d04(0x183)+_0x4b2ead,_0x4f2d04(0x1b4));}}export function writeServiceRegistry(_0x13b309,_0x16315c={}){const _0x4222e1=a62_0x15322d,_0x68c09e=getServiceRegistryPath(_0x16315c),_0x407938=dirname(_0x68c09e);!existsSync(_0x407938)&&mkdirSync(_0x407938,{'recursive':!![]});const _0x49b776=_0x68c09e+_0x4222e1(0x18f);try{writeFileSync(_0x49b776,JSON['stringify'](_0x13b309,null,0x2)+'\x0a',{'encoding':_0x4222e1(0x1c2),'mode':0x180}),renameSync(_0x49b776,_0x68c09e);}catch(_0x4f3cc6){try{unlinkSync(_0x49b776);}catch{}if(_0x4f3cc6?.['code']===_0x4222e1(0x1ab))throw CliErrors[_0x4222e1(0x1a3)](_0x4222e1(0x1cf)+_0x68c09e);throw _0x4f3cc6;}return _0x68c09e;}export function loadServiceManifestFromFile(_0x17c91e){const _0x3cb7e4=a62_0x15322d,_0x4cd426=resolve(_0x17c91e);if(!existsSync(_0x4cd426))throw CliErrors[_0x3cb7e4(0x1a3)](_0x3cb7e4(0x1b8)+_0x17c91e);let _0x11b215;const _0x49aab6=readFileSync(_0x4cd426,_0x3cb7e4(0x1c2));try{_0x11b215=JSON[_0x3cb7e4(0x19e)](_0x49aab6);}catch{throw CliErrors['validation'](_0x3cb7e4(0x18e)+_0x17c91e,_0x3cb7e4(0x1bf));}const _0x1fb186=sha256(_0x49aab6),_0x2565ec=extractLoadedServiceManifests(_0x11b215,_0x1fb186),_0x4c5813=aggregateValidationReports(_0x2565ec),_0x34c608=_0x2565ec[0x0];return{'filePath':_0x4cd426,'hash':_0x1fb186,'kind':isServiceRegistryLike(_0x11b215)?_0x3cb7e4(0x1ce):_0x3cb7e4(0x1d0),'manifest':_0x34c608?.[_0x3cb7e4(0x1d0)]??_0x11b215,'report':_0x4c5813,'normalizedManifest':_0x2565ec[_0x3cb7e4(0x19c)]===0x1?_0x34c608?.[_0x3cb7e4(0x1d5)]:undefined,'manifests':_0x2565ec};}export function importServiceManifest(_0x27e2e5,_0x3441ad={}){const _0xf79a34=a62_0x15322d,_0x26324d=loadServiceManifestFromFile(_0x27e2e5);if(!_0x26324d['report']['ok'])throw CliErrors[_0xf79a34(0x1a3)](formatValidationFailure(_0x26324d[_0xf79a34(0x199)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x26324d[_0xf79a34(0x1c5)]['length']===0x0)throw CliErrors[_0xf79a34(0x1a3)](_0xf79a34(0x1bd),_0xf79a34(0x195));const _0x3b7f94=readServiceRegistry(_0x3441ad),_0x289eb7=(_0x3441ad[_0xf79a34(0x1a0)]??(()=>new Date()))()[_0xf79a34(0x1a4)](),_0x37e58a=[];let _0x220f04=0x0,_0x5108d2=0x0;for(const _0x204505 of _0x26324d['manifests']){if(!_0x204505[_0xf79a34(0x1d5)])continue;const _0x16290c=_0x204505[_0xf79a34(0x1d5)]['service']['code'],_0x38e21a={'serviceCode':_0x16290c,'version':_0x204505[_0xf79a34(0x1d5)][_0xf79a34(0x1c0)],'importedAt':_0x289eb7,'source':{'type':_0xf79a34(0x1d3),'path':_0x26324d[_0xf79a34(0x185)],'hash':_0x204505['sourceHash']},'manifest':_0x204505[_0xf79a34(0x1d0)],'normalizedManifest':_0x204505['normalizedManifest']},_0x20473a=_0x3b7f94[_0xf79a34(0x1b1)][_0xf79a34(0x1b5)](_0x4601aa=>_0x4601aa[_0xf79a34(0x1cd)]===_0x16290c);_0x20473a>=0x0?(_0x3b7f94['services'][_0x20473a]=_0x38e21a,_0x5108d2++):(_0x3b7f94[_0xf79a34(0x1b1)][_0xf79a34(0x1cb)](_0x38e21a),_0x220f04++),_0x37e58a[_0xf79a34(0x1cb)](_0x38e21a);}_0x3b7f94['services'][_0xf79a34(0x198)]((_0x9234dc,_0x154a65)=>_0x9234dc['serviceCode'][_0xf79a34(0x1ae)](_0x154a65[_0xf79a34(0x1cd)])),_0x3b7f94['updatedAt']=_0x289eb7;const _0x395847=writeServiceRegistry(_0x3b7f94,_0x3441ad);return{'registryPath':_0x395847,'entry':_0x37e58a[0x0],'replaced':_0x37e58a['length']===0x1?_0x5108d2===0x1:_0x5108d2>0x0,'entries':_0x37e58a,'imported':_0x220f04,'updated':_0x5108d2,'serviceCount':_0x3b7f94['services']['length']};}export function exportServiceManifest(_0x27a61f,_0x1a075a,_0xa9169f={}){const _0x128682=a62_0x15322d,_0x56c36f=getServiceRegistryPath(_0xa9169f),_0x39128e=getLocalServiceEntry(_0x27a61f,_0xa9169f);if(!_0x39128e)throw CliErrors[_0x128682(0x1a3)](_0x128682(0x1c8)+_0x27a61f,_0x128682(0x190));const _0x34c789=resolve(_0x1a075a),_0x2b82c2=dirname(_0x34c789);return!existsSync(_0x2b82c2)&&mkdirSync(_0x2b82c2,{'recursive':!![]}),writeFileSync(_0x34c789,JSON['stringify'](_0x39128e[_0x128682(0x1d0)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0x56c36f,'filePath':_0x34c789,'entry':_0x39128e};}export function removeServiceManifest(_0x31765a,_0x419d63={}){const _0x570235=a62_0x15322d,_0x2d7edf=readServiceRegistry(_0x419d63),_0x5de44b=_0x31765a[_0x570235(0x1b9)](),_0x4c2d7b=_0x2d7edf[_0x570235(0x1b1)]['findIndex'](_0x4d11e0=>_0x4d11e0[_0x570235(0x1cd)]===_0x5de44b);if(_0x4c2d7b<0x0)throw CliErrors[_0x570235(0x1a3)](_0x570235(0x1c8)+_0x5de44b,_0x570235(0x190));const [_0x6e165f]=_0x2d7edf[_0x570235(0x1b1)][_0x570235(0x19a)](_0x4c2d7b,0x1),_0x3dfa44=(_0x419d63[_0x570235(0x1a0)]??(()=>new Date()))()['toISOString']();_0x2d7edf['updatedAt']=_0x3dfa44;const _0x2339c2=writeServiceRegistry(_0x2d7edf,_0x419d63);return{'registryPath':_0x2339c2,'entry':_0x6e165f,'serviceCount':_0x2d7edf[_0x570235(0x1b1)][_0x570235(0x19c)]};}export function listLocalServices(_0x3d825c={}){const _0x4a16ef=a62_0x15322d;return readServiceRegistry(_0x3d825c)[_0x4a16ef(0x1b1)];}export function getLocalServiceEntry(_0x130a78,_0x590e33={}){const _0x5953e0=a62_0x15322d;return readServiceRegistry(_0x590e33)[_0x5953e0(0x1b1)][_0x5953e0(0x1a9)](_0x394183=>_0x394183[_0x5953e0(0x1cd)]===_0x130a78[_0x5953e0(0x1b9)]());}export function listLocalServiceTrees(_0x2f4056={}){const _0x561049=a62_0x15322d;return readServiceRegistry(_0x2f4056)[_0x561049(0x1b1)][_0x561049(0x18a)](_0x16207d=>_0x16207d[_0x561049(0x1d5)]);}export function inspectServiceRegistry(_0x1c14ba={}){const _0x19abfc=a62_0x15322d,_0x2b497d=getServiceRegistryPath(_0x1c14ba);if(!existsSync(_0x2b497d))return emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x191),![]);try{const _0x5bff0c=readFileSync(_0x2b497d,_0x19abfc(0x1c2));if(!_0x5bff0c['trim']())return emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x194),!![]);const _0x3bda80=JSON['parse'](_0x5bff0c);if(_0x3bda80[_0x19abfc(0x1d1)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x188),!![]),'schemaVersion':_0x3bda80['schemaVersion'],'message':_0x19abfc(0x18d)+String(_0x3bda80[_0x19abfc(0x1d1)])};if(!Array[_0x19abfc(0x1a2)](_0x3bda80[_0x19abfc(0x1b1)]))return{...emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x188),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3bda80[_0x19abfc(0x193)],'message':_0x19abfc(0x1b2)};const _0x4b2d7e=_0x3bda80[_0x19abfc(0x1b1)][_0x19abfc(0x18a)](summarizeLocalServiceEntry);return{'registryPath':_0x2b497d,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3bda80['updatedAt'],'serviceCount':_0x4b2d7e['length'],'commandCount':_0x4b2d7e['reduce']((_0x3d5a89,_0x109e8a)=>_0x3d5a89+_0x109e8a[_0x19abfc(0x18c)],0x0),'services':_0x4b2d7e};}catch(_0x3ca3c4){return{...emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x188),!![]),'message':_0x3ca3c4 instanceof Error?_0x3ca3c4[_0x19abfc(0x1c7)]:String(_0x3ca3c4)};}}export function formatValidationFailure(_0x311261){const _0x5a56b9=a62_0x15322d,_0x53c8c2=_0x311261[_0x5a56b9(0x1bc)]['map'](_0x51c7de=>_0x51c7de[_0x5a56b9(0x1b6)]+':\x20'+_0x51c7de['message']);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x53c8c2['join']('\x0a');}function extractLoadedServiceManifests(_0xd7e1e7,_0x11f31d){const _0xba47b4=a62_0x15322d;if(!isServiceRegistryLike(_0xd7e1e7)){const _0x21404f=_0xd7e1e7,{manifest:_0x3cafe1,errors:_0x1e01a7}=adaptServiceTreeManifestForLegacyFramework(_0x21404f),_0x1c123e=validateServiceTreeManifest(_0x3cafe1),_0x14bbb6=mergeValidationErrors(_0x1c123e,_0x1e01a7);return[{'manifest':_0x21404f,'report':_0x14bbb6,'normalizedManifest':_0x14bbb6['ok']?normalizeServiceTreeManifest(_0x3cafe1):undefined,'sourceHash':_0x11f31d}];}return _0xd7e1e7[_0xba47b4(0x1b1)][_0xba47b4(0x18a)]((_0x3a2af7,_0x1d764d)=>{const _0x236f1b=_0xba47b4,_0x2cd629=isObjectRecord(_0x3a2af7)?_0x3a2af7[_0x236f1b(0x1d0)]:undefined,{manifest:_0x53137e,errors:_0x3a068b}=adaptServiceTreeManifestForLegacyFramework(_0x2cd629),_0x26cddd=validateServiceTreeManifest(_0x53137e),_0x431ec8=mergeValidationErrors(_0x26cddd,_0x3a068b),_0x5a6ae7=isObjectRecord(_0x3a2af7)&&typeof _0x3a2af7[_0x236f1b(0x1cd)]===_0x236f1b(0x1c1)?_0x3a2af7[_0x236f1b(0x1cd)]:undefined;return{'manifest':_0x2cd629,'report':_0x431ec8,'normalizedManifest':_0x431ec8['ok']?normalizeServiceTreeManifest(_0x53137e):undefined,'sourceHash':sha256(JSON[_0x236f1b(0x187)](_0x2cd629,null,0x2)+'\x0a'),'registryIndex':_0x1d764d,'registryServiceCode':_0x5a6ae7};});}function a62_0x43bf(_0x2bb7eb,_0x1506ab){_0x2bb7eb=_0x2bb7eb-0x181;const _0x538b47=a62_0x538b();let _0x43bf7a=_0x538b47[_0x2bb7eb];return _0x43bf7a;}function mergeValidationErrors(_0x5ae5fc,_0x51fab4){const _0x518f58=a62_0x15322d,_0x55fd91=_0x5ae5fc[_0x518f58(0x1bc)][_0x518f58(0x18a)](_0x108e82=>_0x108e82[_0x518f58(0x1c7)]===_0x518f58(0x1a5)?{..._0x108e82,'message':_0x518f58(0x196)}:_0x108e82),_0x3eb8a5=[..._0x51fab4,..._0x55fd91];return{'ok':_0x3eb8a5[_0x518f58(0x19c)]===0x0,'errors':_0x3eb8a5,'warnings':_0x5ae5fc['warnings']};}function aggregateValidationReports(_0x10f8a4){const _0x27f373=a62_0x15322d,_0x169972=_0x10f8a4[_0x27f373(0x1af)](_0x2e9067=>_0x2e9067[_0x27f373(0x1a8)]===undefined?_0x2e9067[_0x27f373(0x199)][_0x27f373(0x1bc)]:_0x2e9067[_0x27f373(0x199)][_0x27f373(0x1bc)][_0x27f373(0x18a)](_0x4496c5=>({..._0x4496c5,'path':prefixRegistryIssuePath(_0x2e9067['registryIndex'],_0x4496c5[_0x27f373(0x1b6)])}))),_0x2d6780=_0x10f8a4[_0x27f373(0x1af)](_0x287533=>_0x287533[_0x27f373(0x1a8)]===undefined?_0x287533[_0x27f373(0x199)][_0x27f373(0x1d2)]:_0x287533[_0x27f373(0x199)][_0x27f373(0x1d2)][_0x27f373(0x18a)](_0x8b7dc0=>({..._0x8b7dc0,'path':prefixRegistryIssuePath(_0x287533['registryIndex'],_0x8b7dc0[_0x27f373(0x1b6)])})));return{'ok':_0x169972[_0x27f373(0x19c)]===0x0,'errors':_0x169972,'warnings':_0x2d6780};}function prefixRegistryIssuePath(_0x380bab,_0x2d984f){const _0x3bff81=a62_0x15322d;if(_0x2d984f==='$')return _0x3bff81(0x1c9)+_0x380bab+_0x3bff81(0x1c3);if(_0x2d984f[_0x3bff81(0x1cc)]('$.'))return _0x3bff81(0x1c9)+_0x380bab+'].manifest'+_0x2d984f[_0x3bff81(0x1a6)](0x1);if(_0x2d984f[_0x3bff81(0x1cc)]('$['))return _0x3bff81(0x1c9)+_0x380bab+_0x3bff81(0x1c3)+_0x2d984f['slice'](0x1);return _0x3bff81(0x1c9)+_0x380bab+_0x3bff81(0x19f)+_0x2d984f;}function a62_0x538b(){const _0x4060c7=['Invalid\x20service\x20manifest\x20JSON:\x20','.tmp','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','missing','importedAt','updatedAt','empty','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','bff\x20target\x20requires\x20functionName.','5198368xXkdVk','sort','report','splice','Remove\x20or\x20migrate\x20','length','hex','parse','].manifest.','now','command','isArray','validation','toISOString','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','slice','5986344Wubvtb','registryIndex','find','service','ENOENT','risk','4353597ubWfBS','localeCompare','flatMap','commands','services','services\x20must\x20be\x20an\x20array','kind','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','findIndex','path','source','Service\x20manifest\x20file\x20not\x20found:\x20','trim','description','service.json','errors','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','1409112LAVknO','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','version','string','utf8','].manifest','Unsupported\x20service\x20registry\x20schemaVersion:\x20','manifests','digest','message','Local\x20service\x20not\x20found:\x20','$.services[','target','push','startsWith','serviceCode','registry','Cannot\x20write\x20service\x20registry:\x20','manifest','schemaVersion','warnings','file','6Sttglc','normalizedManifest','name','homeDir','46796004cgVfxI','Invalid\x20service\x20registry\x20JSON:\x20','1yPHUXS','filePath','6544670VHpzbl','stringify','invalid','object','map','4647664pyRqUa','commandCount','Unsupported\x20schemaVersion:\x20'];a62_0x538b=function(){return _0x4060c7;};return a62_0x538b();}function isServiceRegistryLike(_0x76dfbc){const _0x227fbd=a62_0x15322d;return isObjectRecord(_0x76dfbc)&&_0x76dfbc['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x227fbd(0x1a2)](_0x76dfbc[_0x227fbd(0x1b1)]);}function isObjectRecord(_0x13c4b8){const _0x1aee54=a62_0x15322d;return Boolean(_0x13c4b8)&&typeof _0x13c4b8===_0x1aee54(0x189)&&!Array[_0x1aee54(0x1a2)](_0x13c4b8);}function emptyServiceRegistryInspection(_0xfe133,_0x233ed0,_0xb7a8d){return{'registryPath':_0xfe133,'exists':_0xb7a8d,'status':_0x233ed0,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x38aa36){const _0x51f957=a62_0x15322d,_0x552cdb=_0x38aa36[_0x51f957(0x1d5)],_0x12af5f=_0x552cdb[_0x51f957(0x1b0)][_0x51f957(0x18a)](_0x3abf76=>({'path':_0x3abf76['cliPath'],'description':_0x3abf76[_0x51f957(0x1ba)],'risk':_0x3abf76[_0x51f957(0x1ac)],'targetKind':_0x3abf76[_0x51f957(0x1ca)][_0x51f957(0x1b3)],'targetCommand':_0x3abf76[_0x51f957(0x1ca)][_0x51f957(0x1a1)]}));return{'serviceCode':_0x38aa36[_0x51f957(0x1cd)],'name':_0x552cdb['service'][_0x51f957(0x1d6)],'description':_0x552cdb[_0x51f957(0x1aa)][_0x51f957(0x1ba)],'version':_0x38aa36[_0x51f957(0x1c0)],'importedAt':_0x38aa36[_0x51f957(0x192)],'source':_0x38aa36[_0x51f957(0x1b7)],'commandCount':_0x12af5f[_0x51f957(0x19c)],'commands':_0x12af5f};}function sha256(_0x4a900e){const _0x2ee270=a62_0x15322d;return createHash('sha256')['update'](_0x4a900e)[_0x2ee270(0x1c6)](_0x2ee270(0x19d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x1336d5=a63_0x50bf;function a63_0x9393(){const _0x330a9c=['str','map','name','5251851SMqWNM','rendered','bool','356lBOzXy','941908ohiQBv','path','skillName','content','isDirectory','1047378vXnWud','read','8499WJIODL','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','type','Created\x20local\x20Skill\x20draft\x20','target','Refusing\x20to\x20overwrite\x20symlink:\x20','validation','14WMzrju','WRITE','2813455mHknWJ','创建本地自包含的运行态\x20Skill\x20草稿','files','skill','1634480sxOvBX','skillDir','isSymbolicLink','471708tSZQPu','trim'];a63_0x9393=function(){return _0x330a9c;};return a63_0x9393();}(function(_0x3ccf45,_0x4e3c60){const _0x4b0cd7=a63_0x50bf,_0x36ec80=_0x3ccf45();while(!![]){try{const _0x529624=parseInt(_0x4b0cd7(0x1ef))/0x1+-parseInt(_0x4b0cd7(0x1f8))/0x2+-parseInt(_0x4b0cd7(0x1ff))/0x3*(parseInt(_0x4b0cd7(0x1f7))/0x4)+-parseInt(_0x4b0cd7(0x1e8))/0x5+parseInt(_0x4b0cd7(0x1fd))/0x6*(parseInt(_0x4b0cd7(0x1e6))/0x7)+parseInt(_0x4b0cd7(0x1ec))/0x8+parseInt(_0x4b0cd7(0x1f4))/0x9;if(_0x529624===_0x4e3c60)break;else _0x36ec80['push'](_0x36ec80['shift']());}catch(_0x43b66f){_0x36ec80['push'](_0x36ec80['shift']());}}}(a63_0x9393,0x4ed55));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';function a63_0x50bf(_0x6584a3,_0x3f3683){_0x6584a3=_0x6584a3-0x1e6;const _0x9393f3=a63_0x9393();let _0x50bfe8=_0x9393f3[_0x6584a3];return _0x50bfe8;}export const createCommand={'service':a63_0x1336d5(0x1eb),'command':'create','description':a63_0x1336d5(0x1e9),'risk':a63_0x1336d5(0x1fe),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x4ab243){const _0x51b31e=a63_0x1336d5,_0x49d6cc=buildSkillCreatePlan(_0x4ab243[_0x51b31e(0x1f1)](_0x51b31e(0x1f3)),_0x4ab243[_0x51b31e(0x1f1)]('type'),_0x4ab243['str']('target'));return{'method':_0x51b31e(0x1e7),'url':_0x49d6cc[_0x51b31e(0x1ed)],'body':{'skillName':_0x49d6cc['rendered']['skillName'],'type':_0x49d6cc[_0x51b31e(0x1f5)][_0x51b31e(0x203)],'selfContained':!![],'files':_0x49d6cc[_0x51b31e(0x1f5)][_0x51b31e(0x1ea)][_0x51b31e(0x1f2)](_0x2853a8=>_0x2853a8[_0x51b31e(0x1f9)])},'description':'Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.'};},async 'execute'(_0x590230){const _0x222856=a63_0x1336d5,_0x3577ef=buildSkillCreatePlan(_0x590230[_0x222856(0x1f1)]('name'),_0x590230[_0x222856(0x1f1)](_0x222856(0x203)),_0x590230[_0x222856(0x1f1)](_0x222856(0x205)));return writeSkillDraft(_0x3577ef,_0x590230[_0x222856(0x1f6)]('force')),{'ok':!![],'data':{'skillName':_0x3577ef[_0x222856(0x1f5)][_0x222856(0x1fa)],'type':_0x3577ef[_0x222856(0x1f5)]['type'],'dir':_0x3577ef[_0x222856(0x1ed)],'files':_0x3577ef[_0x222856(0x1f5)][_0x222856(0x1ea)][_0x222856(0x1f2)](_0x3579e5=>_0x3579e5[_0x222856(0x1f9)])},'message':_0x222856(0x204)+_0x3577ef['rendered']['skillName']};}};function buildSkillCreatePlan(_0xf66f3,_0x5486e8,_0x18db94){const _0x42a02e=a63_0x1336d5,_0x185e75=_0x5486e8['trim'](),_0x93a39b=renderSkillTemplate({'skillName':_0xf66f3,'type':_0x185e75});!_0x185e75&&writeCliSideChannelLine(_0x42a02e(0x200));const _0x5f5cc8=resolve(normalizeSkillTarget(_0x18db94));return{'rendered':_0x93a39b,'targetRoot':_0x5f5cc8,'skillDir':resolve(_0x5f5cc8,_0x93a39b[_0x42a02e(0x1fa)])};}function normalizeSkillTarget(_0x5bea72){const _0x6d7afc=a63_0x1336d5;return(_0x5bea72||DEFAULT_SKILL_TARGET)[_0x6d7afc(0x1f0)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x205c87,_0x15bd63){const _0x4d1397=a63_0x1336d5;if(existsSync(_0x205c87[_0x4d1397(0x1ed)])){const _0x213559=lstatSync(_0x205c87['skillDir']);if(!_0x213559[_0x4d1397(0x1fc)]()||_0x213559[_0x4d1397(0x1ee)]())throw CliErrors[_0x4d1397(0x207)](_0x4d1397(0x201)+_0x205c87[_0x4d1397(0x1ed)]);if(!_0x15bd63)throw CliErrors[_0x4d1397(0x207)]('Skill\x20directory\x20already\x20exists:\x20'+_0x205c87['skillDir'],_0x4d1397(0x202));}for(const _0x47d0b8 of _0x205c87[_0x4d1397(0x1f5)][_0x4d1397(0x1ea)]){const _0x4bcc08=resolve(_0x205c87[_0x4d1397(0x1ed)],_0x47d0b8[_0x4d1397(0x1f9)]),_0x1d1ce6=dirname(_0x4bcc08);mkdirSync(_0x1d1ce6,{'recursive':!![]});if(existsSync(_0x4bcc08)&&lstatSync(_0x4bcc08)[_0x4d1397(0x1ee)]())throw CliErrors['validation'](_0x4d1397(0x206)+_0x4bcc08);writeFileSync(_0x4bcc08,_0x47d0b8[_0x4d1397(0x1fb)],'utf8');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x57ab30=a64_0xc3a2;(function(_0x36db70,_0x32d9cf){const _0x2f8906=a64_0xc3a2,_0xf18c53=_0x36db70();while(!![]){try{const _0x38d570=parseInt(_0x2f8906(0xd4))/0x1*(parseInt(_0x2f8906(0xeb))/0x2)+-parseInt(_0x2f8906(0xee))/0x3*(parseInt(_0x2f8906(0xf0))/0x4)+parseInt(_0x2f8906(0xd3))/0x5+-parseInt(_0x2f8906(0xf4))/0x6*(-parseInt(_0x2f8906(0xd1))/0x7)+-parseInt(_0x2f8906(0xd0))/0x8*(-parseInt(_0x2f8906(0xce))/0x9)+parseInt(_0x2f8906(0xf1))/0xa+parseInt(_0x2f8906(0xd8))/0xb*(-parseInt(_0x2f8906(0xf8))/0xc);if(_0x38d570===_0x32d9cf)break;else _0xf18c53['push'](_0xf18c53['shift']());}catch(_0x44b5a8){_0xf18c53['push'](_0xf18c53['shift']());}}}(a64_0x27a1,0x844e5));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';function a64_0xc3a2(_0x54d1d6,_0x28123a){_0x54d1d6=_0x54d1d6-0xce;const _0x27a12c=a64_0x27a1();let _0xc3a226=_0x27a12c[_0x54d1d6];return _0xc3a226;}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(_0x5d80b4){const _0x5b9f46=a64_0xc3a2,_0xc1e03=_0x5d80b4[_0x5b9f46(0xe5)](_0x5b9f46(0xe6))[_0x5b9f46(0xf2)](),_0x5ce591=_0x5d80b4['str'](_0x5b9f46(0xf5))['trim'](),_0x2e2805=_0x5d80b4[_0x5b9f46(0xe5)](_0x5b9f46(0xd6));if(!_0xc1e03||!_0x5ce591||_0x2e2805!==_0x5b9f46(0xdb)&&_0x2e2805!==_0x5b9f46(0xf3))throw CliErrors[_0x5b9f46(0xe4)](_0x5b9f46(0xdc));return{'skillCode':_0xc1e03,'version':_0x5ce591,'scope':_0x2e2805};}async function readDiagramWriteInput(_0x59b554){const _0x3b1910=a64_0xc3a2,_0x11e7c8=_0x59b554['num'](_0x3b1910(0xec)),_0x505c78=_0x59b554[_0x3b1910(0xe5)]('source-fingerprint')[_0x3b1910(0xf2)]();if(!Number[_0x3b1910(0xe9)](_0x11e7c8)||_0x11e7c8<0x0)throw CliErrors['validation']('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/[_0x3b1910(0xda)](_0x505c78))throw CliErrors[_0x3b1910(0xe4)]('--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.');return{'expectedDiagramRevision':_0x11e7c8,'sourceFingerprint':_0x505c78,'diagram':await readRequiredSkillDiagram(_0x59b554[_0x3b1910(0xe5)](_0x3b1910(0xd5)))};}function a64_0x27a1(){const _0x380919=['\x20is\x20unchanged.','test','personal','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','unchanged','found','appCode','skill','read','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','validation','str','skill-code','Updated','action','isInteger','Skill\x20diagram\x20for\x20','11098BVuubu','expected-diagram-revision','expectedDiagramRevision','1356009oiMwJF','diagram-show','4CPnfdb','3115890FkCywg','trim','company','1635198KVRtEr','version','Skill\x20diagram\x20validation\x20passed\x20for\x20','Created','3000xeANpQ',';\x20first\x20write\x20expects\x20revision\x20','7638165hsgvbe','skillCode','8PyFIFK','7nyVKzA','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','657990fbeisq','77ABsiVv','diagram-file','scope','diagram-validate','43901ZgzgCF'];a64_0x27a1=function(){return _0x380919;};return a64_0x27a1();}export const diagramValidateCommand={'service':a64_0x57ab30(0xe0),'command':a64_0x57ab30(0xd7),'description':a64_0x57ab30(0xe3),'risk':a64_0x57ab30(0xe1),'flags':WRITE_FLAGS,async 'execute'(_0x57759a){const _0x58c337=a64_0x57ab30,_0x4a6d92=readDiagramTarget(_0x57759a),_0x313e87=await validateRuntimeSkillVersionDiagram(_0x57759a[_0x58c337(0xdf)],_0x4a6d92[_0x58c337(0xcf)],_0x4a6d92['version'],_0x4a6d92[_0x58c337(0xd6)],await readDiagramWriteInput(_0x57759a));return{'ok':!![],'data':_0x313e87,'message':_0x58c337(0xf6)+_0x4a6d92[_0x58c337(0xcf)]+'@'+_0x4a6d92[_0x58c337(0xf5)]+'.'};}};export const diagramPushCommand={'service':a64_0x57ab30(0xe0),'command':'diagram-push','description':'为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','risk':'write','confirmationDescription':a64_0x57ab30(0xd2),'flags':WRITE_FLAGS,async 'execute'(_0x46b5fa){const _0x39e257=a64_0x57ab30,_0x23c2f0=readDiagramTarget(_0x46b5fa),_0x48dae1=await putRuntimeSkillVersionDiagram(_0x46b5fa['appCode'],_0x23c2f0[_0x39e257(0xcf)],_0x23c2f0[_0x39e257(0xf5)],_0x23c2f0[_0x39e257(0xd6)],await readDiagramWriteInput(_0x46b5fa));return{'ok':!![],'data':_0x48dae1,'message':_0x48dae1[_0x39e257(0xe8)]===_0x39e257(0xdd)?_0x39e257(0xea)+_0x23c2f0['skillCode']+'@'+_0x23c2f0[_0x39e257(0xf5)]+_0x39e257(0xd9):(_0x48dae1[_0x39e257(0xe8)]==='created'?_0x39e257(0xf7):_0x39e257(0xe7))+'\x20Skill\x20diagram\x20for\x20'+_0x23c2f0[_0x39e257(0xcf)]+'@'+_0x23c2f0['version']+'.'};}};export const diagramShowCommand={'service':'skill','command':a64_0x57ab30(0xef),'description':a64_0x57ab30(0xe2),'risk':a64_0x57ab30(0xe1),'flags':TARGET_FLAGS,async 'execute'(_0x316d27){const _0x46e160=a64_0x57ab30,_0x2a743b=readDiagramTarget(_0x316d27),_0x42d65b=await getRuntimeSkillVersionDiagram(_0x316d27[_0x46e160(0xdf)],_0x2a743b[_0x46e160(0xcf)],_0x2a743b[_0x46e160(0xf5)],_0x2a743b[_0x46e160(0xd6)]);return{'ok':!![],'data':_0x42d65b,'message':_0x42d65b[_0x46e160(0xde)]?'Found\x20Skill\x20diagram\x20for\x20'+_0x2a743b[_0x46e160(0xcf)]+'@'+_0x2a743b[_0x46e160(0xf5)]+';\x20next\x20write\x20expects\x20revision\x20'+_0x42d65b[_0x46e160(0xed)]+'.':'No\x20Skill\x20diagram\x20is\x20stored\x20for\x20'+_0x2a743b[_0x46e160(0xcf)]+'@'+_0x2a743b[_0x46e160(0xf5)]+_0x46e160(0xf9)+_0x42d65b[_0x46e160(0xed)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a65_0x3413(_0x30acb7,_0x30a23b){_0x30acb7=_0x30acb7-0x1f1;const _0x20358e=a65_0x2035();let _0x34139f=_0x20358e[_0x30acb7];return _0x34139f;}const a65_0x5f20f1=a65_0x3413;(function(_0x101380,_0x26b07a){const _0x30e18b=a65_0x3413,_0x7105a8=_0x101380();while(!![]){try{const _0x45d83b=-parseInt(_0x30e18b(0x1fd))/0x1+parseInt(_0x30e18b(0x218))/0x2+-parseInt(_0x30e18b(0x205))/0x3+-parseInt(_0x30e18b(0x20b))/0x4*(parseInt(_0x30e18b(0x200))/0x5)+-parseInt(_0x30e18b(0x1f9))/0x6+-parseInt(_0x30e18b(0x214))/0x7+parseInt(_0x30e18b(0x206))/0x8*(parseInt(_0x30e18b(0x1f8))/0x9);if(_0x45d83b===_0x26b07a)break;else _0x7105a8['push'](_0x7105a8['shift']());}catch(_0x200e49){_0x7105a8['push'](_0x7105a8['shift']());}}}(a65_0x2035,0xeba31));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';function a65_0x2035(){const _0x351968=['envName','global','project','removed','scope','accessKey','filter','bool','Installed\x20','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','../../../skills/runtime-skill-sync.js','4203lVpWfX','7289124YUEGPI','all','read','length','707708euzRRe','company','code','57985NmWcuA','personal','map','created','\x20company\x20Skill(s).','5322216fUlVjn','81064WscxQb','force','install','appCode','push','28kcpTdL','skillRoots','str','action','authRequired','updated','production','flatMap','trim','6603149xCzhkB','version','includes','skipped','1908356bsvWDf','skillCode','../../../core/api-client.js'];a65_0x2035=function(){return _0x351968;};return a65_0x2035();}import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':'skill','command':a65_0x5f20f1(0x208),'description':a65_0x5f20f1(0x1f6),'risk':a65_0x5f20f1(0x1fb),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x3e13ea){return syncRuntimeSkills(_0x3e13ea);}};async function syncRuntimeSkills(_0x230d94){const _0x7fca7d=a65_0x5f20f1,{downloadRuntimeSkillPackage:_0x2a3036,listRuntimeSkills:_0x488ff3}=await import(_0x7fca7d(0x21a)),{linkEffectiveRuntimeSkills:_0x5876b4,materializeRuntimeSkill:_0x1ec3fb,pruneStaleRuntimeSkillCache:_0x5871cf,pruneStaleRuntimeSkillLinks:_0x5a5b0a,resolveRuntimeSkillInstallTarget:_0x21b53d}=await import(_0x7fca7d(0x1f7)),_0x5159d2=_0x230d94[_0x7fca7d(0x20d)](_0x7fca7d(0x1ff)),_0x334351=normalizeSyncScopes(_0x230d94[_0x7fca7d(0x20d)]('scope')),_0x280d8a=_0x230d94[_0x7fca7d(0x21b)]??_0x7fca7d(0x211),_0x2bdc83=_0x230d94[_0x7fca7d(0x1f2)],_0x47d197=_0x230d94[_0x7fca7d(0x1f4)](_0x7fca7d(0x207));if(!_0x2bdc83)throw CliErrors[_0x7fca7d(0x20f)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x52ba04=_0x21b53d(_0x230d94[_0x7fca7d(0x209)],_0x230d94[_0x7fca7d(0x1f4)](_0x7fca7d(0x21d))?_0x7fca7d(0x21d):_0x7fca7d(0x21c)),_0x10d660=_0x21b53d(_0x230d94['appCode'],_0x52ba04[_0x7fca7d(0x1f1)]==='project'?_0x7fca7d(0x21c):_0x7fca7d(0x21d)),_0x2fb96a=await Promise[_0x7fca7d(0x1fa)](_0x334351['map'](_0x137076=>_0x488ff3({'appCode':_0x230d94[_0x7fca7d(0x209)],'scope':_0x137076,'code':_0x5159d2['trim']()||undefined}))),_0x265d56=_0x334351[_0x7fca7d(0x216)](_0x7fca7d(0x201))?_0x2fb96a[_0x7fca7d(0x212)]((_0x342bc6,_0x3f6a0c)=>_0x334351[_0x3f6a0c]===_0x7fca7d(0x201)?_0x342bc6[_0x7fca7d(0x201)]:[]):[],_0x1720c2=_0x334351[_0x7fca7d(0x216)](_0x7fca7d(0x1fe))?_0x2fb96a['flatMap']((_0x1fa9ff,_0xd8d663)=>_0x334351[_0xd8d663]===_0x7fca7d(0x1fe)?_0x1fa9ff['company']:[]):[],_0x3df429=new Set([..._0x265d56[_0x7fca7d(0x202)](_0x1135b5=>_0x1135b5[_0x7fca7d(0x219)]?.['trim']())['filter'](_0x53888b=>Boolean(_0x53888b)),..._0x1720c2[_0x7fca7d(0x202)](_0x2eda72=>_0x2eda72[_0x7fca7d(0x219)]?.['trim']())[_0x7fca7d(0x1f3)](_0x34f1fa=>Boolean(_0x34f1fa))]),_0x56de17=_0x5159d2[_0x7fca7d(0x213)]()?[_0x5159d2[_0x7fca7d(0x213)]()]:undefined,_0xa557a7=_0x334351[_0x7fca7d(0x1fc)]===0x2&&_0x334351['includes'](_0x7fca7d(0x201))&&_0x334351[_0x7fca7d(0x216)](_0x7fca7d(0x1fe)),_0x37b60d=_0xa557a7?_0x5a5b0a(_0x52ba04,_0x3df429,_0x56de17):[],_0x413c76=_0x5871cf({'env':_0x280d8a,'accessKey':_0x2bdc83,'appCode':_0x230d94[_0x7fca7d(0x209)],'activeSkillCodes':_0x3df429,'pruneSkillCodes':_0x56de17,'scopes':_0x334351,'protectedLinkRoots':_0x10d660[_0x7fca7d(0x20c)]}),_0x268004=[];for(const _0x3b2e93 of _0x265d56){_0x268004[_0x7fca7d(0x20a)](_0x1ec3fb(_0x3b2e93,_0x7fca7d(0x201),{'env':_0x280d8a,'accessKey':_0x2bdc83,'appCode':_0x230d94[_0x7fca7d(0x209)],'force':_0x47d197,'packageBytes':await downloadSkillPackage(_0x3b2e93,_0x7fca7d(0x201),_0x230d94[_0x7fca7d(0x209)],_0x2a3036)}));}for(const _0x4511e4 of _0x1720c2){_0x268004[_0x7fca7d(0x20a)](_0x1ec3fb(_0x4511e4,_0x7fca7d(0x1fe),{'env':_0x280d8a,'accessKey':_0x2bdc83,'appCode':_0x230d94[_0x7fca7d(0x209)],'force':_0x47d197,'packageBytes':await downloadSkillPackage(_0x4511e4,'company',_0x230d94[_0x7fca7d(0x209)],_0x2a3036)}));}const _0x3f7468=_0x5876b4(_0x268004,_0x52ba04),_0x21a099=countLinkActions(_0x3f7468);return{'ok':!![],'data':{'appCode':_0x230d94[_0x7fca7d(0x209)],..._0x52ba04[_0x7fca7d(0x1f1)]===_0x7fca7d(0x21d)?{'installTarget':{'scope':_0x52ba04[_0x7fca7d(0x1f1)],'skillRoots':[..._0x52ba04['skillRoots']]}}:{},'personal':_0x265d56[_0x7fca7d(0x1fc)],'company':_0x1720c2['length'],'materialized':_0x268004['length'],'links':{'total':_0x3f7468[_0x7fca7d(0x1fc)],'created':_0x21a099[_0x7fca7d(0x203)]??0x0,'updated':_0x21a099[_0x7fca7d(0x210)]??0x0,'unchanged':_0x21a099['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x37b60d['filter'](_0x3c062e=>_0x3c062e['action']===_0x7fca7d(0x21e))['length'],'cacheDirs':_0x413c76['filter'](_0x39afa0=>_0x39afa0['action']==='removed')['length'],'skipped':[..._0x37b60d,..._0x413c76][_0x7fca7d(0x1f3)](_0x3832fd=>_0x3832fd[_0x7fca7d(0x20e)]===_0x7fca7d(0x217))[_0x7fca7d(0x1fc)]},'skills':{'personal':_0x265d56[_0x7fca7d(0x202)](summarizeRuntimeSkill),'company':_0x1720c2[_0x7fca7d(0x202)](summarizeRuntimeSkill)}},'message':_0x7fca7d(0x1f5)+_0x265d56[_0x7fca7d(0x1fc)]+'\x20personal\x20and\x20'+_0x1720c2[_0x7fca7d(0x1fc)]+_0x7fca7d(0x204)};}async function downloadSkillPackage(_0x56589d,_0x46c4fc,_0x51bbcd,_0x5704b5){const _0x46b587=a65_0x5f20f1,_0x1a8852=_0x56589d[_0x46b587(0x215)]?.[_0x46b587(0x213)]();return _0x1a8852?_0x5704b5(_0x46c4fc,_0x56589d[_0x46b587(0x219)],_0x51bbcd,_0x1a8852):_0x5704b5(_0x46c4fc,_0x56589d[_0x46b587(0x219)],_0x51bbcd);}function countLinkActions(_0x139bd8){return _0x139bd8['reduce']((_0x5dd916,_0x48e94)=>{const _0x5d04f9=a65_0x3413;return _0x5dd916[_0x48e94['action']]=(_0x5dd916[_0x48e94[_0x5d04f9(0x20e)]]??0x0)+0x1,_0x5dd916;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x2c6612=a66_0x5136;(function(_0x12cb64,_0x168b20){const _0x1b7ee8=a66_0x5136,_0x44bedb=_0x12cb64();while(!![]){try{const _0x22a286=parseInt(_0x1b7ee8(0x103))/0x1*(parseInt(_0x1b7ee8(0x11f))/0x2)+parseInt(_0x1b7ee8(0x109))/0x3+-parseInt(_0x1b7ee8(0x110))/0x4*(parseInt(_0x1b7ee8(0x11b))/0x5)+parseInt(_0x1b7ee8(0x107))/0x6+-parseInt(_0x1b7ee8(0x104))/0x7+-parseInt(_0x1b7ee8(0x11e))/0x8*(parseInt(_0x1b7ee8(0x106))/0x9)+-parseInt(_0x1b7ee8(0x120))/0xa*(-parseInt(_0x1b7ee8(0x10a))/0xb);if(_0x22a286===_0x168b20)break;else _0x44bedb['push'](_0x44bedb['shift']());}catch(_0x5cfc0a){_0x44bedb['push'](_0x44bedb['shift']());}}}(a66_0x1ee0,0xb77f1));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';function a66_0x5136(_0x451ead,_0x3b9b81){_0x451ead=_0x451ead-0xff;const _0x1ee0ab=a66_0x1ee0();let _0x513603=_0x1ee0ab[_0x451ead];return _0x513603;}import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a66_0x2c6612(0x115),'command':a66_0x2c6612(0x102),'description':a66_0x2c6612(0x113),'risk':a66_0x2c6612(0x10e),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x680546){const _0x3b0a74=a66_0x2c6612,_0x353787=_0x680546['str'](_0x3b0a74(0x10f)),_0x2ba3a9=normalizeListScope(_0x680546[_0x3b0a74(0x108)](_0x3b0a74(0x116)));if(_0x680546[_0x3b0a74(0x105)](_0x3b0a74(0x117))){const _0x29f511=_0x680546[_0x3b0a74(0x101)];if(!_0x29f511)throw CliErrors[_0x3b0a74(0x118)]();const {listLocalRuntimeSkills:_0x507ba1,resolveRuntimeSkillInstallTarget:_0x4235ab}=await import('../../../skills/runtime-skill-sync.js'),_0x14cec1=_0x4235ab(_0x680546['appCode'],_0x680546['bool'](_0x3b0a74(0x11d))?_0x3b0a74(0x11d):_0x3b0a74(0x10d)),_0x8ecd8c=_0x507ba1({'env':_0x680546[_0x3b0a74(0x112)]??_0x3b0a74(0x123),'accessKey':_0x29f511,'appCode':_0x680546[_0x3b0a74(0x10c)],'scopes':listScopeToRuntimeScopes(_0x2ba3a9),'code':_0x353787[_0x3b0a74(0x119)]()||undefined},_0x14cec1),_0x58aec5=groupLocalRuntimeSkills(_0x8ecd8c);return{'ok':!![],'data':{'appCode':_0x680546['appCode'],'source':_0x3b0a74(0x117),..._0x14cec1[_0x3b0a74(0x116)]===_0x3b0a74(0x11d)?{'installScope':_0x14cec1[_0x3b0a74(0x116)]}:{},'scope':_0x2ba3a9,'total':_0x8ecd8c[_0x3b0a74(0x10b)],'personal':_0x58aec5[_0x3b0a74(0x100)][_0x3b0a74(0x10b)],'company':_0x58aec5['company']['length'],'items':_0x8ecd8c[_0x3b0a74(0x121)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x58aec5[_0x3b0a74(0x100)][_0x3b0a74(0x121)](summarizeLocalRuntimeSkill),'company':_0x58aec5[_0x3b0a74(0x11c)]['map'](summarizeLocalRuntimeSkill)}},'message':_0x3b0a74(0x122)+_0x8ecd8c['length']+'\x20local\x20Skill(s).'};}const {listRuntimeSkills:_0x405d4e}=await import(_0x3b0a74(0x111)),_0x5405ed=await _0x405d4e({'appCode':_0x680546['appCode'],'scope':listScopeToRemoteScope(_0x2ba3a9),'code':_0x353787[_0x3b0a74(0x119)]()||undefined}),_0x3d8374=shouldListScope(_0x2ba3a9,_0x3b0a74(0x100))?_0x5405ed[_0x3b0a74(0x100)]??[]:[],_0x43d552=shouldListScope(_0x2ba3a9,_0x3b0a74(0x11c))?_0x5405ed[_0x3b0a74(0x11c)]??[]:[],_0x4d6c77=[..._0x3d8374,..._0x43d552];return{'ok':!![],'data':{'appCode':_0x680546['appCode'],'source':'remote','scope':_0x2ba3a9,'total':_0x4d6c77['length'],'personal':_0x3d8374[_0x3b0a74(0x10b)],'company':_0x43d552[_0x3b0a74(0x10b)],'items':_0x4d6c77['map'](summarizeRuntimeSkill),'skills':{'personal':_0x3d8374[_0x3b0a74(0x121)](summarizeRuntimeSkill),'company':_0x43d552[_0x3b0a74(0x121)](summarizeRuntimeSkill)}},'message':_0x3b0a74(0x122)+_0x4d6c77['length']+_0x3b0a74(0x11a)};}};function groupLocalRuntimeSkills(_0x410047){const _0x116350=a66_0x2c6612;return{'personal':_0x410047[_0x116350(0x114)](_0x41e6e2=>_0x41e6e2[_0x116350(0x116)]==='personal'),'company':_0x410047[_0x116350(0x114)](_0x20db76=>_0x20db76[_0x116350(0x116)]===_0x116350(0x11c)),'builtin':_0x410047['filter'](_0x34481e=>_0x34481e[_0x116350(0x116)]===_0x116350(0xff))};}function a66_0x1ee0(){const _0x6fb017=['local','authRequired','trim','\x20remote\x20Skill(s).','5IPpcku','company','project','3192YgXtFN','130882kzFHZh','281110nttUdh','map','Listed\x20','production','builtin','personal','accessKey','list','2hJZUwy','1001245JzBziW','bool','12087WyIUcy','3144588uLvjGS','str','2902830TzOQxg','242ADltYF','length','appCode','global','read','code','3242156jtVRHo','../../../core/api-client.js','envName','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','filter','skill','scope'];a66_0x1ee0=function(){return _0x6fb017;};return a66_0x1ee0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a67_0x2220(_0x207b16,_0x30952c){_0x207b16=_0x207b16-0xe1;const _0x193e3d=a67_0x193e();let _0x22205e=_0x193e3d[_0x207b16];return _0x22205e;}const a67_0x5719e3=a67_0x2220;(function(_0x199b7e,_0x1daa5d){const _0x2b525a=a67_0x2220,_0x53aa46=_0x199b7e();while(!![]){try{const _0x4e1ba5=parseInt(_0x2b525a(0xed))/0x1+-parseInt(_0x2b525a(0xee))/0x2*(-parseInt(_0x2b525a(0xe2))/0x3)+parseInt(_0x2b525a(0xe1))/0x4*(-parseInt(_0x2b525a(0xe5))/0x5)+-parseInt(_0x2b525a(0xe8))/0x6*(parseInt(_0x2b525a(0xe4))/0x7)+parseInt(_0x2b525a(0xf0))/0x8*(-parseInt(_0x2b525a(0xea))/0x9)+parseInt(_0x2b525a(0xec))/0xa+parseInt(_0x2b525a(0xef))/0xb*(parseInt(_0x2b525a(0xe9))/0xc);if(_0x4e1ba5===_0x1daa5d)break;else _0x53aa46['push'](_0x53aa46['shift']());}catch(_0x8548a0){_0x53aa46['push'](_0x53aa46['shift']());}}}(a67_0x193e,0x9f895));function a67_0x193e(){const _0x6d40d8=['617007XGLBSQ','2SntLjh','11GGeQDn','176WwADVT','36rcgAVO','1619139jBDsbZ','write','5873xryHCP','291510pPxBmY','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','skill','6564LvTgNn','19898964RetDHl','404388lmJOfP','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','2695820FoTsav'];a67_0x193e=function(){return _0x6d40d8;};return a67_0x193e();}import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';export const pushCommand={'service':a67_0x5719e3(0xe7),'command':'push','description':a67_0x5719e3(0xeb),'risk':a67_0x5719e3(0xe3),'confirmationDescription':a67_0x5719e3(0xe6),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|