@lovrabet/lovrabet-cli 2.3.0-beta.1 → 2.3.0-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/init.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/domain-config.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/region.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/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/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a57_0x345033=a57_0x2a79;(function(_0x331461,_0x5a1593){const _0x468c67=a57_0x2a79,_0x4470fa=_0x331461();while(!![]){try{const _0x4bcd51=parseInt(_0x468c67(0x15d))/0x1*(parseInt(_0x468c67(0x168))/0x2)+parseInt(_0x468c67(0x15b))/0x3+parseInt(_0x468c67(0x154))/0x4*(-parseInt(_0x468c67(0x15e))/0x5)+parseInt(_0x468c67(0x156))/0x6+parseInt(_0x468c67(0x15f))/0x7*(-parseInt(_0x468c67(0x163))/0x8)+parseInt(_0x468c67(0x169))/0x9*(parseInt(_0x468c67(0x165))/0xa)+-parseInt(_0x468c67(0x162))/0xb*(parseInt(_0x468c67(0x157))/0xc);if(_0x4bcd51===_0x5a1593)break;else _0x4470fa['push'](_0x4470fa['shift']());}catch(_0x39fb19){_0x4470fa['push'](_0x4470fa['shift']());}}}(a57_0x11e8,0x5be4f));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';function a57_0x2a79(_0x55259a,_0x2bc568){_0x55259a=_0x55259a-0x154;const _0x11e830=a57_0x11e8();let _0x2a79b8=_0x11e830[_0x55259a];return _0x2a79b8;}import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';function a57_0x11e8(){const _0x13950a=['shouldWrite','Preview:\x20remove\x20runtime\x20role\x20member','11pMChEr','8WQmaZC','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','1094070UlKNMI','body','appCode','5946pgObLl','45cZBKrZ','roleList','/client/permit/user-role/update-user-list','warnings','after','POST','749188UJmrZj','user-remove','3609936TtfjeX','4414908rgWcUF','build','role','Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.','1206474COcEBD','high-risk-write','47ZhCheV','10xsLSkh','4001746xgyuGp'];a57_0x11e8=function(){return _0x13950a;};return a57_0x11e8();}export const roleUserRemove={'service':a57_0x345033(0x159),'command':'user-remove','description':a57_0x345033(0x164),'risk':a57_0x345033(0x15c),'confirmationDescription':a57_0x345033(0x15a),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x1e9c4e){const _0x80e2b1=a57_0x345033,_0x2dcbc3=await prepareRuntimeMemberMutation(_0x1e9c4e,_0x80e2b1(0x155));return dryRun(_0x80e2b1(0x16e),_0x80e2b1(0x16b))[_0x80e2b1(0x166)]({'appCode':_0x1e9c4e[_0x80e2b1(0x167)],'roleList':_0x2dcbc3[_0x80e2b1(0x16a)]})['description'](_0x2dcbc3[_0x80e2b1(0x160)]?_0x80e2b1(0x161):_0x2dcbc3[_0x80e2b1(0x16c)][0x0])[_0x80e2b1(0x158)]();},async 'execute'(_0x224c1a){const _0x26ddf1=a57_0x345033,_0x11eec6=await prepareRuntimeMemberMutation(_0x224c1a,_0x26ddf1(0x155));return _0x11eec6[_0x26ddf1(0x160)]&&await updateRuntimeRoleUsers(_0x224c1a[_0x26ddf1(0x167)],_0x11eec6[_0x26ddf1(0x16a)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x26ddf1(0x155),{'roleId':_0x11eec6[_0x26ddf1(0x159)]['id'],'userId':_0x11eec6['userId']},_0x11eec6['before'],_0x11eec6[_0x26ddf1(0x16d)],{'method':'POST','path':_0x26ddf1(0x16b)},_0x11eec6[_0x26ddf1(0x16c)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a58_0x156875=a58_0x5ea1;(function(_0x58751d,_0x588590){const _0x527898=a58_0x5ea1,_0x435864=_0x58751d();while(!![]){try{const _0x5fe50b=-parseInt(_0x527898(0xdd))/0x1+parseInt(_0x527898(0x105))/0x2*(-parseInt(_0x527898(0xd1))/0x3)+parseInt(_0x527898(0xca))/0x4*(-parseInt(_0x527898(0xcc))/0x5)+-parseInt(_0x527898(0x100))/0x6*(parseInt(_0x527898(0xe5))/0x7)+parseInt(_0x527898(0xed))/0x8*(parseInt(_0x527898(0xf1))/0x9)+-parseInt(_0x527898(0x10b))/0xa+parseInt(_0x527898(0xce))/0xb*(parseInt(_0x527898(0xe6))/0xc);if(_0x5fe50b===_0x588590)break;else _0x435864['push'](_0x435864['shift']());}catch(_0x5e3705){_0x435864['push'](_0x435864['shift']());}}}(a58_0xb2c6,0x51301));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';function a58_0x5ea1(_0x51e2f5,_0x4c5632){_0x51e2f5=_0x51e2f5-0xca;const _0xb2c6ff=a58_0xb2c6();let _0x5ea13f=_0xb2c6ff[_0x51e2f5];return _0x5ea13f;}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':a58_0x156875(0xfb),'type':'string','required':!![],'enum':[a58_0x156875(0x10a),a58_0x156875(0xf6)],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':'cron','type':'string','description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a58_0x156875(0x109),'type':'string','description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':a58_0x156875(0xdb),'type':a58_0x156875(0x10c),'required':!![],'description':a58_0x156875(0xd9)},PROMPT_FLAG={'name':a58_0x156875(0xfe),'type':a58_0x156875(0x10c),'required':!![],'description':a58_0x156875(0xef)},MODEL_FLAG={'name':a58_0x156875(0xcd),'type':a58_0x156875(0x10c),'enum':[a58_0x156875(0xd8),'deepseek-v4-flash-0731','deepseek-v4-pro-0813'],'default':a58_0x156875(0xee),'description':'Task\x20model\x20used\x20when\x20the\x20schedule\x20runs'},SCHEDULE_ID_FLAG={'name':a58_0x156875(0xcf),'type':a58_0x156875(0x10c),'required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a58_0x156875(0xe4),'type':a58_0x156875(0xd5),'default':0x14,'description':'Page\x20size\x20from\x201\x20to\x20100'},CURSOR_FLAG={'name':'cursor','type':a58_0x156875(0x10c),'description':a58_0x156875(0xf5)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x4c12dc){const _0x59fd10=a58_0x156875,_0x330117=_0x4c12dc['str']('kind'),_0x47a8c0=_0x4c12dc[_0x59fd10(0xd0)]('title')[_0x59fd10(0xf0)](),_0x5d221b=_0x4c12dc['str']('prompt')[_0x59fd10(0xf0)](),_0x404f8f=_0x4c12dc[_0x59fd10(0xd0)]('model'),_0xf929a=_0x4c12dc[_0x59fd10(0xd0)](_0x59fd10(0xd2)),_0xe420f6=_0x4c12dc[_0x59fd10(0xd0)]('scheduled-at');if(!_0x47a8c0)throw CliErrors['validation'](_0x59fd10(0xd6));if(!_0x5d221b)throw CliErrors['validation'](_0x59fd10(0xfc));if(_0x330117===_0x59fd10(0x10a)){if(!_0xf929a||_0xe420f6)throw CliErrors[_0x59fd10(0xf9)]('CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.');return{'kind':_0x330117,'timezone':'UTC','cron':_0xf929a,'title':_0x47a8c0,'prompt':_0x5d221b,'model':_0x404f8f};}if(_0x330117===_0x59fd10(0xf6)){if(!_0xe420f6||_0xf929a)throw CliErrors[_0x59fd10(0xf9)](_0x59fd10(0xfa));return{'kind':_0x330117,'timezone':_0x59fd10(0x108),'scheduledAt':_0xe420f6,'title':_0x47a8c0,'prompt':_0x5d221b,'model':_0x404f8f};}throw CliErrors[_0x59fd10(0xf9)](_0x59fd10(0x103));}function scheduleCollectionPath(_0x31ab51){const _0x416a16=a58_0x156875;return _0x416a16(0xe1)+encodeURIComponent(_0x31ab51)+_0x416a16(0xcb);}function scheduleItemPath(_0x653916,_0xb7052b){return scheduleCollectionPath(_0x653916)+'/'+encodeURIComponent(_0xb7052b);}const scheduleValidate={'service':a58_0x156875(0xda),'command':a58_0x156875(0xea),'description':a58_0x156875(0x106),'risk':a58_0x156875(0xeb),'flags':INPUT_FLAGS,async 'validate'(_0x250674){readScheduleInput(_0x250674);},async 'execute'(_0xc8dc63){const _0x330c0a=a58_0x156875,_0x2c5164=readScheduleInput(_0xc8dc63),_0x3b8ebc=await validateRuntimeSchedule(_0xc8dc63[_0x330c0a(0xfd)],_0x2c5164);return{'ok':!![],'data':_0x3b8ebc,'message':_0x330c0a(0x10d)};}},scheduleCreate={'service':a58_0x156875(0xda),'command':'create','description':a58_0x156875(0x10f),'risk':a58_0x156875(0xf7),'confirmationDescription':a58_0x156875(0xf4),'flags':INPUT_FLAGS,async 'validate'(_0x1e98f5){readScheduleInput(_0x1e98f5);},async 'execute'(_0x5ebad6){const _0x215a0f=a58_0x156875,_0x5a5e21=readScheduleInput(_0x5ebad6),_0x3078d8=await validateRuntimeSchedule(_0x5ebad6[_0x215a0f(0xfd)],_0x5a5e21),_0x24759c=await createRuntimeSchedule(_0x5ebad6[_0x215a0f(0xfd)],_0x3078d8);return{'ok':!![],'data':_0x24759c,'message':_0x215a0f(0x10e)+_0x24759c[_0x215a0f(0xfb)]+'\x20schedule\x20'+_0x24759c['scheduleId']};},async 'dryRun'(_0x44fca3){const _0x1ffacd=a58_0x156875,_0x365fd2=readScheduleInput(_0x44fca3);return dryRun('POST',scheduleCollectionPath(_0x44fca3['appCode']))[_0x1ffacd(0xdc)](_0x365fd2)['description'](_0x1ffacd(0x101))[_0x1ffacd(0xe3)]();}},scheduleList={'service':a58_0x156875(0xda),'command':a58_0x156875(0xdf),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a58_0x156875(0xeb),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x5933a9){const _0x4f8736=a58_0x156875,_0x2b584c=_0x5933a9[_0x4f8736(0x107)](_0x4f8736(0xe4));if(!Number[_0x4f8736(0xf3)](_0x2b584c)||_0x2b584c<0x1||_0x2b584c>0x64)throw CliErrors[_0x4f8736(0xf9)](_0x4f8736(0xe9));const _0x369acd=_0x5933a9[_0x4f8736(0xd0)]('cursor');if(_0x369acd&&(_0x369acd[_0x4f8736(0x102)]>0x400||_0x369acd[_0x4f8736(0xf0)]()!==_0x369acd))throw CliErrors[_0x4f8736(0xf9)]('--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.');},async 'execute'(_0x1e6f4d){const _0x2ea725=a58_0x156875,_0x4c2907=_0x1e6f4d[_0x2ea725(0xd0)](_0x2ea725(0xe7)),_0x6338a9=await listRuntimeSchedules(_0x1e6f4d[_0x2ea725(0xfd)],{'kind':_0x1e6f4d[_0x2ea725(0xd0)](_0x2ea725(0xfb)),'limit':_0x1e6f4d['num'](_0x2ea725(0xe4)),..._0x4c2907?{'cursor':_0x4c2907}:{}});return{'ok':!![],'data':_0x6338a9};}},scheduleDetail={'service':a58_0x156875(0xda),'command':a58_0x156875(0xe8),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x37cd8a){const _0x50e3c0=a58_0x156875,_0x3ecefd=await getRuntimeSchedule(_0x37cd8a[_0x50e3c0(0xfd)],_0x37cd8a[_0x50e3c0(0xd0)]('schedule-id'));return{'ok':!![],'data':_0x3ecefd};}},scheduleRun={'service':a58_0x156875(0xda),'command':'run','description':a58_0x156875(0xe2),'risk':a58_0x156875(0xf7),'confirmationDescription':a58_0x156875(0xff),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x9dd6cd){const _0x42f840=a58_0x156875,_0xb37915=_0x9dd6cd[_0x42f840(0xd0)]('schedule-id'),_0x2c132e=await runRuntimeSchedule(_0x9dd6cd[_0x42f840(0xfd)],_0xb37915);return{'ok':!![],'data':_0x2c132e,'message':'Queued\x20Task\x20'+_0x2c132e['taskId']+_0x42f840(0xd4)+_0xb37915};},async 'dryRun'(_0x1da7c2){const _0x136335=a58_0x156875,_0x47b1f6=_0x1da7c2[_0x136335(0xd0)](_0x136335(0xcf));return dryRun('POST',scheduleItemPath(_0x1da7c2[_0x136335(0xfd)],_0x47b1f6)+'/run')['description'](_0x136335(0xf2)+_0x47b1f6+_0x136335(0x104))[_0x136335(0xe3)]();}},scheduleDelete={'service':a58_0x156875(0xda),'command':a58_0x156875(0xd7),'description':a58_0x156875(0xde),'risk':a58_0x156875(0xf7),'confirmationDescription':a58_0x156875(0xd3),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x13d3a1){const _0x5c1558=a58_0x156875,_0x403b30=_0x13d3a1[_0x5c1558(0xd0)](_0x5c1558(0xcf)),_0x2bb553=await deleteRuntimeSchedule(_0x13d3a1[_0x5c1558(0xfd)],_0x403b30);return{'ok':!![],'data':_0x2bb553,'message':_0x5c1558(0xf8)+_0x403b30};},async 'dryRun'(_0x2e5b68){const _0x1b6b54=a58_0x156875,_0x322466=_0x2e5b68[_0x1b6b54(0xd0)](_0x1b6b54(0xcf));return dryRun('DELETE',scheduleItemPath(_0x2e5b68['appCode'],_0x322466))[_0x1b6b54(0xec)](_0x1b6b54(0xe0)+_0x322466)[_0x1b6b54(0xe3)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];function a58_0xb2c6(){const _0x35e7ec=['Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','409196WHiozo','/schedules','10eNWnDj','model','44lMjizm','schedule-id','str','2022BfAFEB','cron','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','\x20from\x20schedule\x20','number','--title\x20must\x20not\x20be\x20blank.','delete','kimi/k3','Schedule\x20title','schedule','title','body','470792dMjeKz','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','list','Preview:\x20delete\x20schedule\x20','/api/harness/apps/','Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','build','limit','128191qiKNrC','3283704xhsJUV','cursor','detail','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','validate','read','description','1140848bLAeFr','deepseek-v4-flash-0731','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','trim','36XKnXdJ','Preview:\x20run\x20schedule\x20','isSafeInteger','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','ONCE','high-risk-write','Deleted\x20schedule\x20','validation','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','kind','--prompt\x20must\x20not\x20be\x20blank.','appCode','prompt','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','102cGxXph','Preview:\x20create\x20an\x20Agent\x20schedule','length','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','\x20immediately','106UVRNtK','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','num','UTC','scheduled-at','CRON','3100140TIaUbf','string','Schedule\x20input\x20is\x20valid','Created\x20'];a58_0xb2c6=function(){return _0x35e7ec;};return a58_0xb2c6();}
|
|
1
|
+
const a58_0x18fba1=a58_0x298d;(function(_0x1835e8,_0x142b0d){const _0x3df057=a58_0x298d,_0x19b4e4=_0x1835e8();while(!![]){try{const _0x5a5805=parseInt(_0x3df057(0x219))/0x1+parseInt(_0x3df057(0x209))/0x2*(-parseInt(_0x3df057(0x1f6))/0x3)+parseInt(_0x3df057(0x21e))/0x4*(parseInt(_0x3df057(0x1ed))/0x5)+parseInt(_0x3df057(0x220))/0x6+-parseInt(_0x3df057(0x212))/0x7+parseInt(_0x3df057(0x1e7))/0x8*(parseInt(_0x3df057(0x1e9))/0x9)+-parseInt(_0x3df057(0x1e6))/0xa;if(_0x5a5805===_0x142b0d)break;else _0x19b4e4['push'](_0x19b4e4['shift']());}catch(_0x583877){_0x19b4e4['push'](_0x19b4e4['shift']());}}}(a58_0x3685,0x359ca));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a58_0x298d(_0x2af45b,_0x1d3169){_0x2af45b=_0x2af45b-0x1dd;const _0x368511=a58_0x3685();let _0x298d59=_0x368511[_0x2af45b];return _0x298d59;}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':a58_0x18fba1(0x1e4),'type':a58_0x18fba1(0x1e8),'required':!![],'enum':[a58_0x18fba1(0x1e2),a58_0x18fba1(0x1f1)],'description':a58_0x18fba1(0x221)},CRON_FLAG={'name':a58_0x18fba1(0x202),'type':'string','description':a58_0x18fba1(0x1f0)},SCHEDULED_AT_FLAG={'name':a58_0x18fba1(0x205),'type':a58_0x18fba1(0x1e8),'description':a58_0x18fba1(0x21b)},TITLE_FLAG={'name':'title','type':a58_0x18fba1(0x1e8),'required':!![],'description':a58_0x18fba1(0x1ee)},PROMPT_FLAG={'name':a58_0x18fba1(0x1dd),'type':a58_0x18fba1(0x1e8),'required':!![],'description':a58_0x18fba1(0x215)},MODEL_FLAG={'name':a58_0x18fba1(0x1f5),'type':a58_0x18fba1(0x1e8),'enum':['kimi/k3',a58_0x18fba1(0x20c),a58_0x18fba1(0x1f8)],'default':a58_0x18fba1(0x20c),'description':a58_0x18fba1(0x223)},SCHEDULE_ID_FLAG={'name':a58_0x18fba1(0x21c),'type':a58_0x18fba1(0x1e8),'required':!![],'description':a58_0x18fba1(0x1f9),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a58_0x18fba1(0x206),'type':a58_0x18fba1(0x201),'default':0x14,'description':a58_0x18fba1(0x225)},CURSOR_FLAG={'name':'cursor','type':a58_0x18fba1(0x1e8),'description':'Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call'},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x934f3){const _0xa88168=a58_0x18fba1,_0x4a227c=_0x934f3[_0xa88168(0x1fa)](_0xa88168(0x1e4)),_0x39f896=_0x934f3['str']('title')[_0xa88168(0x229)](),_0x322223=_0x934f3[_0xa88168(0x1fa)](_0xa88168(0x1dd))['trim'](),_0x5027e4=_0x934f3[_0xa88168(0x1fa)]('model'),_0x2e1c6a=_0x934f3[_0xa88168(0x1fa)](_0xa88168(0x202)),_0x152838=_0x934f3[_0xa88168(0x1fa)](_0xa88168(0x205));if(!_0x39f896)throw CliErrors[_0xa88168(0x1ea)](_0xa88168(0x218));if(!_0x322223)throw CliErrors[_0xa88168(0x1ea)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x4a227c===_0xa88168(0x1e2)){if(!_0x2e1c6a||_0x152838)throw CliErrors[_0xa88168(0x1ea)](_0xa88168(0x210));return{'kind':_0x4a227c,'timezone':_0xa88168(0x1df),'cron':_0x2e1c6a,'title':_0x39f896,'prompt':_0x322223,'model':_0x5027e4};}if(_0x4a227c==='ONCE'){if(!_0x152838||_0x2e1c6a)throw CliErrors[_0xa88168(0x1ea)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x4a227c,'timezone':_0xa88168(0x1df),'scheduledAt':_0x152838,'title':_0x39f896,'prompt':_0x322223,'model':_0x5027e4};}throw CliErrors[_0xa88168(0x1ea)](_0xa88168(0x1fb));}function scheduleCollectionPath(_0x2406f1){const _0xaeba75=a58_0x18fba1;return _0xaeba75(0x203)+encodeURIComponent(_0x2406f1)+_0xaeba75(0x1ef);}function scheduleItemPath(_0x55d41d,_0x536598){return scheduleCollectionPath(_0x55d41d)+'/'+encodeURIComponent(_0x536598);}const scheduleValidate={'service':a58_0x18fba1(0x200),'command':a58_0x18fba1(0x1fe),'description':a58_0x18fba1(0x1f2),'risk':a58_0x18fba1(0x216),'flags':INPUT_FLAGS,async 'validate'(_0x4ab177){readScheduleInput(_0x4ab177);},async 'execute'(_0xf7d994){const _0x1f565a=a58_0x18fba1,_0x178d2c=readScheduleInput(_0xf7d994),_0x14f7cb=await validateRuntimeSchedule(_0xf7d994[_0x1f565a(0x1e3)],_0x178d2c);return{'ok':!![],'data':_0x14f7cb,'message':_0x1f565a(0x213)};}},scheduleCreate={'service':a58_0x18fba1(0x200),'command':'create','description':a58_0x18fba1(0x227),'risk':a58_0x18fba1(0x20f),'confirmationDescription':a58_0x18fba1(0x20b),'flags':INPUT_FLAGS,async 'validate'(_0x59b2e6){readScheduleInput(_0x59b2e6);},async 'execute'(_0x152c93){const _0x346dc5=a58_0x18fba1,_0x472894=readScheduleInput(_0x152c93),_0x4083a4=await validateRuntimeSchedule(_0x152c93[_0x346dc5(0x1e3)],_0x472894),_0x1a1585=await createRuntimeSchedule(_0x152c93[_0x346dc5(0x1e3)],_0x4083a4);return{'ok':!![],'data':_0x1a1585,'message':_0x346dc5(0x1fc)+_0x1a1585[_0x346dc5(0x1e4)]+_0x346dc5(0x20e)+_0x1a1585[_0x346dc5(0x21f)]};},async 'dryRun'(_0x2d2455){const _0x2bd8bf=a58_0x18fba1,_0x26de41=readScheduleInput(_0x2d2455);return dryRun(_0x2bd8bf(0x224),scheduleCollectionPath(_0x2d2455[_0x2bd8bf(0x1e3)]))[_0x2bd8bf(0x204)](_0x26de41)[_0x2bd8bf(0x217)](_0x2bd8bf(0x20d))['build']();}},scheduleList={'service':a58_0x18fba1(0x200),'command':a58_0x18fba1(0x226),'description':a58_0x18fba1(0x228),'risk':a58_0x18fba1(0x216),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x3aa950){const _0x169266=a58_0x18fba1,_0x3edf37=_0x3aa950[_0x169266(0x1e5)](_0x169266(0x206));if(!Number[_0x169266(0x1e1)](_0x3edf37)||_0x3edf37<0x1||_0x3edf37>0x64)throw CliErrors[_0x169266(0x1ea)]('--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');const _0x28f954=_0x3aa950['str'](_0x169266(0x1f3));if(_0x28f954&&(_0x28f954[_0x169266(0x1e0)]>0x400||_0x28f954[_0x169266(0x229)]()!==_0x28f954))throw CliErrors['validation'](_0x169266(0x207));},async 'execute'(_0xd1e069){const _0x1509c1=a58_0x18fba1,_0x498f3b=_0xd1e069['str'](_0x1509c1(0x1f3)),_0x31c9cd=await listRuntimeSchedules(_0xd1e069[_0x1509c1(0x1e3)],{'kind':_0xd1e069[_0x1509c1(0x1fa)](_0x1509c1(0x1e4)),'limit':_0xd1e069[_0x1509c1(0x1e5)](_0x1509c1(0x206)),..._0x498f3b?{'cursor':_0x498f3b}:{}});return{'ok':!![],'data':_0x31c9cd};}},scheduleDetail={'service':a58_0x18fba1(0x200),'command':a58_0x18fba1(0x1ec),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x14d6ea){const _0x4f026e=a58_0x18fba1,_0x28cd1e=await getRuntimeSchedule(_0x14d6ea[_0x4f026e(0x1e3)],_0x14d6ea['str'](_0x4f026e(0x21c)));return{'ok':!![],'data':_0x28cd1e};}},scheduleRun={'service':a58_0x18fba1(0x200),'command':'run','description':a58_0x18fba1(0x214),'risk':'high-risk-write','confirmationDescription':a58_0x18fba1(0x1f7),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x384365){const _0x3aa8a7=a58_0x18fba1,_0x430dd7=_0x384365[_0x3aa8a7(0x1fa)](_0x3aa8a7(0x21c)),_0x5c2fdf=await runRuntimeSchedule(_0x384365[_0x3aa8a7(0x1e3)],_0x430dd7);return{'ok':!![],'data':_0x5c2fdf,'message':_0x3aa8a7(0x21d)+_0x5c2fdf[_0x3aa8a7(0x1de)]+_0x3aa8a7(0x20a)+_0x430dd7};},async 'dryRun'(_0x1423e1){const _0x1d19c9=a58_0x18fba1,_0x190e77=_0x1423e1['str'](_0x1d19c9(0x21c));return dryRun(_0x1d19c9(0x224),scheduleItemPath(_0x1423e1[_0x1d19c9(0x1e3)],_0x190e77)+_0x1d19c9(0x21a))[_0x1d19c9(0x217)](_0x1d19c9(0x1ff)+_0x190e77+'\x20immediately')[_0x1d19c9(0x222)]();}},scheduleDelete={'service':a58_0x18fba1(0x200),'command':a58_0x18fba1(0x1fd),'description':a58_0x18fba1(0x1eb),'risk':a58_0x18fba1(0x20f),'confirmationDescription':a58_0x18fba1(0x1f4),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x31a128){const _0x27790e=a58_0x18fba1,_0x4d8a11=_0x31a128[_0x27790e(0x1fa)](_0x27790e(0x21c)),_0x4f5410=await deleteRuntimeSchedule(_0x31a128['appCode'],_0x4d8a11);return{'ok':!![],'data':_0x4f5410,'message':'Deleted\x20schedule\x20'+_0x4d8a11};},async 'dryRun'(_0x4e2a59){const _0x86f030=a58_0x18fba1,_0x4c0cb0=_0x4e2a59['str'](_0x86f030(0x21c));return dryRun(_0x86f030(0x208),scheduleItemPath(_0x4e2a59[_0x86f030(0x1e3)],_0x4c0cb0))[_0x86f030(0x217)](_0x86f030(0x211)+_0x4c0cb0)[_0x86f030(0x222)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];function a58_0x3685(){const _0x2713cc=['model','3raMbcr','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','deepseek-v4-pro-0813','Schedule\x20UUID','str','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','Created\x20','delete','validate','Preview:\x20run\x20schedule\x20','schedule','number','cron','/api/harness/apps/','body','scheduled-at','limit','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','DELETE','397998gpiWzG','\x20from\x20schedule\x20','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','deepseek-v4-flash-0731','Preview:\x20create\x20an\x20Agent\x20schedule','\x20schedule\x20','high-risk-write','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','Preview:\x20delete\x20schedule\x20','1246903fyNGZa','Schedule\x20input\x20is\x20valid','Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','read','description','--title\x20must\x20not\x20be\x20blank.','322178ngSkSh','/run','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','schedule-id','Queued\x20Task\x20','4376BTWTlw','scheduleId','1675194VETBcq','Schedule\x20kind:\x20CRON\x20or\x20ONCE','build','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','POST','Page\x20size\x20from\x201\x20to\x20100','list','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','trim','prompt','taskId','UTC','length','isSafeInteger','CRON','appCode','kind','num','8003400MQvaWB','24FEVXDR','string','1130049JwWEzQ','validation','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','detail','1915DwXCIJ','Schedule\x20title','/schedules','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','ONCE','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','cursor','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.'];a58_0x3685=function(){return _0x2713cc;};return a58_0x3685();}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x4fe26e=a59_0x12e8;(function(_0x5cd759,_0x10e1e9){const _0xf2fe24=a59_0x12e8,_0x3c2284=_0x5cd759();while(!![]){try{const _0xe65014=parseInt(_0xf2fe24(0x139))/0x1+-parseInt(_0xf2fe24(0x141))/0x2*(-parseInt(_0xf2fe24(0x138))/0x3)+parseInt(_0xf2fe24(0x142))/0x4*(parseInt(_0xf2fe24(0x143))/0x5)+-parseInt(_0xf2fe24(0x13b))/0x6*(-parseInt(_0xf2fe24(0x13d))/0x7)+parseInt(_0xf2fe24(0x13c))/0x8*(parseInt(_0xf2fe24(0x145))/0x9)+parseInt(_0xf2fe24(0x13a))/0xa+parseInt(_0xf2fe24(0x137))/0xb*(-parseInt(_0xf2fe24(0x13f))/0xc);if(_0xe65014===_0x10e1e9)break;else _0x3c2284['push'](_0x3c2284['shift']());}catch(_0x2ce329){_0x3c2284['push'](_0x3c2284['shift']());}}}(a59_0x291a,0x3624d));function a59_0x12e8(_0x11bc6d,_0x31cd83){_0x11bc6d=_0x11bc6d-0x137;const _0x291a4d=a59_0x291a();let _0x12e8b3=_0x291a4d[_0x11bc6d];return _0x12e8b3;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5cf5b8){const _0x39b492=await buildSchemaPayload();return{'ok':!![],'data':_0x39b492};}export const schemaDefinition={'service':a59_0x4fe26e(0x13e),'command':a59_0x4fe26e(0x140),'description':a59_0x4fe26e(0x144),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a59_0x291a(){const _0x23bb11=['525hhHVtF','schema','8143692hlvVaO','export','820852poHtVx','64316psQnLN','100SCvqdI','Export\x20machine-readable\x20command\x20schema\x20(JSON)','9PTmNUD','22gkOXAp','3xQochA','38107IvrVFp','3958310jlVsPM','8460TQIrIz','2458888ZEaEqI'];a59_0x291a=function(){return _0x23bb11;};return a59_0x291a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x140884,_0x548c64){const _0x12429b=a60_0x3218,_0x5ed051=_0x140884();while(!![]){try{const _0x4ee538=parseInt(_0x12429b(0x17f))/0x1+parseInt(_0x12429b(0x11b))/0x2+parseInt(_0x12429b(0x14f))/0x3+-parseInt(_0x12429b(0x181))/0x4*(-parseInt(_0x12429b(0x146))/0x5)+-parseInt(_0x12429b(0x12c))/0x6+parseInt(_0x12429b(0x15c))/0x7*(parseInt(_0x12429b(0x166))/0x8)+-parseInt(_0x12429b(0x11c))/0x9;if(_0x4ee538===_0x548c64)break;else _0x5ed051['push'](_0x5ed051['shift']());}catch(_0x199b50){_0x5ed051['push'](_0x5ed051['shift']());}}}(a60_0x332b,0xb9163));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';function a60_0x3218(_0x558424,_0x429b98){_0x558424=_0x558424-0x118;const _0x332b5b=a60_0x332b();let _0x3218ba=_0x332b5b[_0x558424];return _0x3218ba;}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(_0x31ade1,_0x46fbee){const _0x5dcb22=a60_0x3218,_0xdcdcaf=listLocalServiceTrees();let _0x53424a;for(const _0x3b2710 of _0xdcdcaf){const _0x59dc22=matchServiceTreeCommand(_0x3b2710,_0x31ade1);if(!_0x59dc22)continue;(!_0x53424a||_0x59dc22['command']['fullPath'][_0x5dcb22(0x134)]>_0x53424a[_0x5dcb22(0x17c)]['fullPath'][_0x5dcb22(0x134)])&&(_0x53424a={'tree':_0x3b2710,'command':_0x59dc22[_0x5dcb22(0x17c)],'remainingArgs':_0x59dc22[_0x5dcb22(0x12a)]});}if(!_0x53424a)return undefined;const _0x4a411a={..._0x46fbee};return applyAppBinding(_0x53424a[_0x5dcb22(0x133)],_0x53424a[_0x5dcb22(0x17c)],_0x4a411a),{'definition':buildDynamicCommandDefinition(_0x53424a['tree'],_0x53424a[_0x5dcb22(0x17c)]),'args':_0x53424a[_0x5dcb22(0x12a)],'flags':_0x4a411a,'tree':_0x53424a[_0x5dcb22(0x133)],'command':_0x53424a[_0x5dcb22(0x17c)]};}export function generateDynamicServiceHelp(_0x45e2d5){const _0x4cee64=a60_0x3218,_0x33c37b=listLocalServiceTrees()[_0x4cee64(0x123)](_0x237a18=>_0x237a18[_0x4cee64(0x12b)][_0x4cee64(0x15f)]===_0x45e2d5);if(!_0x33c37b)return undefined;const _0x48b375=[CLI_BIN_NAME+'\x20'+_0x45e2d5+_0x4cee64(0x16e),'',_0x33c37b[_0x4cee64(0x12b)][_0x4cee64(0x15a)]||_0x45e2d5,_0x33c37b[_0x4cee64(0x12b)]['description']?'\x20\x20'+_0x33c37b[_0x4cee64(0x12b)][_0x4cee64(0x137)]:'','',_0x4cee64(0x165),..._0x33c37b['commands']['map'](_0x42df36=>{const _0x161803=_0x4cee64,_0x52ec81=_0x42df36[_0x161803(0x136)][_0x161803(0x141)](0x1)[_0x161803(0x121)]('\x20'),_0x333fa7=_0x42df36[_0x161803(0x156)]===_0x161803(0x122)?'':'\x20['+_0x42df36[_0x161803(0x156)]+']';return'\x20\x20'+_0x52ec81['padEnd'](0x18)+'\x20'+(_0x42df36[_0x161803(0x137)]||'')+_0x333fa7;}),'',_0x4cee64(0x163)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x45e2d5+_0x4cee64(0x149)][_0x4cee64(0x177)](Boolean);return _0x48b375[_0x4cee64(0x121)]('\x0a');}export function listDynamicServiceEntries(){const _0x3eb399=a60_0x3218;return listLocalServices()[_0x3eb399(0x139)](_0x346369=>{const _0x583cbe=_0x3eb399,_0x29a20e=_0x346369[_0x583cbe(0x16b)];return{'service':_0x29a20e[_0x583cbe(0x12b)][_0x583cbe(0x15f)],'label':_0x29a20e[_0x583cbe(0x12b)][_0x583cbe(0x15a)]||_0x29a20e[_0x583cbe(0x12b)]['code'],'commands':_0x29a20e[_0x583cbe(0x171)][_0x583cbe(0x139)](_0xae6aa5=>({'command':dynamicCommandName(_0xae6aa5),'description':_0xae6aa5[_0x583cbe(0x137)]||_0x583cbe(0x124)+_0xae6aa5[_0x583cbe(0x15b)],'tag':riskTag(_0xae6aa5[_0x583cbe(0x156)])}))};});}export function getDynamicServiceEntry(_0x6f2351){const _0x531b15=a60_0x3218;return listDynamicServiceEntries()[_0x531b15(0x123)](_0x1189f6=>_0x1189f6[_0x531b15(0x12b)]===_0x6f2351);}export function listDynamicServiceDefinitions(_0x2a571d){const _0x3e5452=a60_0x3218;return listLocalServiceTrees()['filter'](_0x349f66=>!_0x2a571d||_0x349f66[_0x3e5452(0x12b)][_0x3e5452(0x15f)]===_0x2a571d)['flatMap'](_0x2424fa=>_0x2424fa[_0x3e5452(0x171)]['map'](_0x5a579b=>buildDynamicCommandDefinition(_0x2424fa,_0x5a579b)));}export function getDynamicServiceDefinitions(_0x315f8f){const _0x589113=a60_0x3218,_0x15cabe=listDynamicServiceDefinitions(_0x315f8f);return _0x15cabe[_0x589113(0x134)]>0x0?_0x15cabe:undefined;}export function findDynamicServiceDefinition(_0x4b395a,_0x3d3baa){const _0x43377d=a60_0x3218;return listDynamicServiceDefinitions(_0x4b395a)['find'](_0x43fe81=>_0x43fe81[_0x43377d(0x17c)]===_0x3d3baa);}export function buildDynamicCommandDefinition(_0x1c3919,_0x57d642){const _0x5d34fc=a60_0x3218;return{'service':_0x1c3919[_0x5d34fc(0x12b)][_0x5d34fc(0x15f)],'command':dynamicCommandName(_0x57d642),'description':_0x57d642[_0x5d34fc(0x137)]||_0x5d34fc(0x124)+_0x57d642[_0x5d34fc(0x15b)],'risk':_0x57d642[_0x5d34fc(0x156)],..._0x57d642[_0x5d34fc(0x156)]==='read'?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x57d642)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x57d642[_0x5d34fc(0x173)][_0x5d34fc(0x139)](_0x24209c=>({'name':_0x24209c['name'],'description':_0x24209c['description']||_0x24209c[_0x5d34fc(0x15a)],'required':_0x24209c[_0x5d34fc(0x145)]})),'flags':_0x57d642[_0x5d34fc(0x148)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x57d642),async 'dryRun'(_0x88ff7a){const _0x1bba47=_0x5d34fc,_0x537069=await compilePlan(_0x57d642,_0x88ff7a);return{'method':_0x1bba47(0x16a),'url':_0x57d642[_0x1bba47(0x15b)],'body':{'target':targetPreview(_0x537069),'params':_0x537069[_0x1bba47(0x17e)]},'description':_0x1bba47(0x160)+_0x57d642[_0x1bba47(0x15b)]};},async 'execute'(_0x14a84a){const _0x18111b=_0x5d34fc,_0x5817d5=await compilePlan(_0x57d642,_0x14a84a),_0x550c4e=Date[_0x18111b(0x168)](),_0x44c54b=await executePlan(_0x5817d5,_0x57d642,_0x14a84a),_0x20fb72=Date[_0x18111b(0x168)]()-_0x550c4e;return{'ok':!![],'data':{'service':_0x1c3919[_0x18111b(0x12b)],'command':_0x57d642[_0x18111b(0x15b)],'target':targetPreview(_0x5817d5),'result':_0x44c54b,'elapsed':_0x20fb72},'message':'Service\x20command\x20'+_0x57d642[_0x18111b(0x15b)]+_0x18111b(0x140)+_0x20fb72+'ms'};}};}function buildDynamicConfirmationDescription(_0x5344ba){const _0x1ccc11=a60_0x3218,_0x57f7c7=_0x5344ba[_0x1ccc11(0x137)]||_0x5344ba[_0x1ccc11(0x15b)],_0x5a73ed=_0x5344ba[_0x1ccc11(0x156)]===_0x1ccc11(0x11f)?_0x1ccc11(0x14d):_0x1ccc11(0x11e);return _0x1ccc11(0x12d)+_0x57f7c7+_0x1ccc11(0x14a)+_0x5a73ed;}function dynamicCommandName(_0x9d4992){const _0x2fbb89=a60_0x3218;return _0x9d4992[_0x2fbb89(0x136)]['slice'](0x1)[_0x2fbb89(0x121)]('\x20');}function riskTag(_0x4fcede){const _0x2837e7=a60_0x3218;return _0x4fcede===_0x2837e7(0x122)?'':'\x20\x20['+_0x4fcede+']';}function flagToCommandFlag(_0x279ede){const _0x283be0=a60_0x3218;return{'name':_0x279ede[_0x283be0(0x143)],'type':_0x279ede[_0x283be0(0x154)]==='json'?_0x283be0(0x130):_0x279ede[_0x283be0(0x154)],'description':_0x279ede[_0x283be0(0x137)]||_0x279ede[_0x283be0(0x15a)],'required':_0x279ede[_0x283be0(0x145)],'default':isPrimitiveFlagDefault(_0x279ede['default'])?_0x279ede['default']:undefined,'enum':_0x279ede[_0x283be0(0x118)]};}async function compilePlan(_0x125f0c,_0x114b9a){const _0x58f3d2=a60_0x3218;return compileServiceTreeCommand(_0x125f0c,{'flags':_0x114b9a[_0x58f3d2(0x16f)],'args':_0x114b9a[_0x58f3d2(0x173)],'context':await buildServiceContext(_0x125f0c,_0x114b9a)});}async function buildServiceContext(_0x24da79,_0x44aa32){const _0x2776cd=a60_0x3218,_0x30b193={'appCode':_0x44aa32[_0x2776cd(0x153)],'env':_0x44aa32[_0x2776cd(0x144)],'envName':_0x44aa32[_0x2776cd(0x144)]};if(!usesRuntimeContext(_0x24da79))return _0x30b193;const _0x4049da=await getLoginUserInfo(),_0x38187a=pickFirst(_0x4049da['userId'],_0x4049da['id']);return{..._0x30b193,'user':_0x4049da,'userId':_0x38187a,'id':_0x4049da['id'],'username':pickFirst(_0x4049da[_0x2776cd(0x15e)],_0x4049da[_0x2776cd(0x16d)],_0x4049da[_0x2776cd(0x150)]),'userName':_0x4049da[_0x2776cd(0x16d)],'nickname':pickFirst(_0x4049da[_0x2776cd(0x17d)],_0x4049da[_0x2776cd(0x162)]),'nickName':_0x4049da[_0x2776cd(0x162)],'tenantCode':_0x4049da[_0x2776cd(0x164)],'employeeId':_0x4049da[_0x2776cd(0x120)]};}function usesRuntimeContext(_0x176d41){const _0x1c6dd0=a60_0x3218;return _0x176d41[_0x1c6dd0(0x11d)]['some'](_0x20435a=>typeof _0x20435a['source']===_0x1c6dd0(0x130)&&(_0x20435a[_0x1c6dd0(0x125)][_0x1c6dd0(0x126)](_0x1c6dd0(0x12f))||_0x20435a[_0x1c6dd0(0x125)][_0x1c6dd0(0x126)](_0x1c6dd0(0x161))));}function pickFirst(..._0x3666bb){const _0x2b8090=a60_0x3218;return _0x3666bb[_0x2b8090(0x123)](_0x185111=>_0x185111!==undefined&&_0x185111!==null);}async function executePlan(_0x4d4784,_0x8bdf10,_0x55be3c){const _0x7d0d47=a60_0x3218;if(_0x4d4784[_0x7d0d47(0x159)]===_0x7d0d47(0x176)){const _0x4689ed=await resolveDatasetCode(_0x4d4784,_0x8bdf10,_0x55be3c);return executeData(_0x4689ed,_0x4d4784[_0x7d0d47(0x17c)],_0x4d4784[_0x7d0d47(0x17e)]);}if(_0x4d4784[_0x7d0d47(0x159)]===_0x7d0d47(0x142)){if(!_0x4d4784[_0x7d0d47(0x11a)])throw CliErrors['validation'](_0x7d0d47(0x175)+_0x8bdf10[_0x7d0d47(0x15b)]+_0x7d0d47(0x14e));return executeSdkSql(_0x4d4784['sqlCode'],normalizeScalarParams(_0x4d4784[_0x7d0d47(0x17e)]));}if(_0x4d4784[_0x7d0d47(0x159)]===_0x7d0d47(0x13b)){const _0x573b6f=_0x4d4784[_0x7d0d47(0x17b)]||_0x4d4784[_0x7d0d47(0x147)]||(_0x4d4784[_0x7d0d47(0x152)]==null?'':String(_0x4d4784['bffId']));if(!_0x573b6f)throw CliErrors[_0x7d0d47(0x172)](_0x7d0d47(0x175)+_0x8bdf10[_0x7d0d47(0x15b)]+_0x7d0d47(0x127));return executeSdkBff(_0x573b6f,_0x4d4784[_0x7d0d47(0x17e)]);}throw CliErrors[_0x7d0d47(0x172)](_0x7d0d47(0x13d)+_0x4d4784['kind']);}async function resolveDatasetCode(_0x4fdece,_0x3055d1,_0x226e97){const _0x217971=a60_0x3218;if(_0x4fdece[_0x217971(0x13a)])return _0x4fdece[_0x217971(0x13a)];if(!_0x4fdece['datatable'])throw CliErrors[_0x217971(0x172)](_0x217971(0x175)+_0x3055d1[_0x217971(0x15b)]+_0x217971(0x17a));const _0x20dbd0=await listDatasets(_0x226e97['appCode']),_0x13c01f=_0x20dbd0[_0x217971(0x123)](_0x2583d9=>_0x2583d9[_0x217971(0x170)]?.[_0x217971(0x167)]===_0x4fdece[_0x217971(0x129)]);if(!_0x13c01f?.[_0x217971(0x15f)])throw CliErrors[_0x217971(0x172)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x4fdece[_0x217971(0x129)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x226e97[_0x217971(0x153)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x13c01f[_0x217971(0x15f)];}function applyAppBinding(_0x167622,_0x5b4309,_0x237012){const _0x2948bb=a60_0x3218,_0xc4d1ac=_0x5b4309['target'][_0x2948bb(0x128)];if(!_0xc4d1ac)return;const _0x3bf0ba=_0x167622[_0x2948bb(0x16c)][_0xc4d1ac];if(!_0x3bf0ba)throw CliErrors[_0x2948bb(0x172)](_0x2948bb(0x174)+_0xc4d1ac+_0x2948bb(0x151)+_0x5b4309[_0x2948bb(0x15b)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x58cd8d=_0x3bf0ba['appcode']||_0x3bf0ba[_0x2948bb(0x153)];_0x58cd8d&&!hasText(_0x237012[_0x2948bb(0x14c)])&&(_0x237012[_0x2948bb(0x14c)]=_0x58cd8d),_0x3bf0ba[_0x2948bb(0x169)]&&!hasText(_0x237012[_0x2948bb(0x169)])&&!hasText(_0x237012[_0x2948bb(0x14c)])&&(_0x237012[_0x2948bb(0x169)]=_0x3bf0ba[_0x2948bb(0x169)]),_0x3bf0ba[_0x2948bb(0x13f)]&&!hasText(_0x237012[_0x2948bb(0x13f)])&&(_0x237012[_0x2948bb(0x13f)]=_0x3bf0ba['env']);}function renderDynamicCommandHelp(_0x43bb80){const _0x3a02c6=a60_0x3218,_0x37e8cc=[_0x3a02c6(0x119),_0x3a02c6(0x132)+_0x43bb80[_0x3a02c6(0x180)][_0x3a02c6(0x159)],'\x20\x20\x20\x20command:\x20'+_0x43bb80[_0x3a02c6(0x180)][_0x3a02c6(0x17c)]];if(_0x43bb80[_0x3a02c6(0x180)][_0x3a02c6(0x13a)])_0x37e8cc[_0x3a02c6(0x135)]('\x20\x20\x20\x20datasetCode:\x20'+_0x43bb80[_0x3a02c6(0x180)]['datasetCode']);if(_0x43bb80[_0x3a02c6(0x180)][_0x3a02c6(0x129)])_0x37e8cc['push']('\x20\x20\x20\x20datatable:\x20'+_0x43bb80[_0x3a02c6(0x180)][_0x3a02c6(0x129)]);if(_0x43bb80[_0x3a02c6(0x180)][_0x3a02c6(0x11a)])_0x37e8cc['push'](_0x3a02c6(0x13e)+_0x43bb80[_0x3a02c6(0x180)]['sqlCode']);if(_0x43bb80['target'][_0x3a02c6(0x17b)])_0x37e8cc[_0x3a02c6(0x135)](_0x3a02c6(0x155)+_0x43bb80['target']['scriptName']);if(_0x43bb80[_0x3a02c6(0x11d)][_0x3a02c6(0x134)]>0x0){_0x37e8cc[_0x3a02c6(0x135)]('',_0x3a02c6(0x178));for(const _0x741729 of _0x43bb80[_0x3a02c6(0x11d)]){_0x37e8cc[_0x3a02c6(0x135)](_0x3a02c6(0x12e)+(_0x741729[_0x3a02c6(0x125)]||_0x3a02c6(0x13c))+_0x3a02c6(0x131)+_0x741729['target']+(_0x741729[_0x3a02c6(0x15d)]?'.'+_0x741729[_0x3a02c6(0x15d)]:''));}}return _0x37e8cc['join']('\x0a');}function targetPreview(_0x383c9c){const _0x19de18=a60_0x3218;return{'kind':_0x383c9c['kind'],'command':_0x383c9c[_0x19de18(0x17c)],'appRef':_0x383c9c[_0x19de18(0x128)],'datasetCode':_0x383c9c['datasetCode'],'datatable':_0x383c9c[_0x19de18(0x129)],'sqlCode':_0x383c9c[_0x19de18(0x11a)],'bffCode':_0x383c9c[_0x19de18(0x147)],'bffId':_0x383c9c[_0x19de18(0x152)],'functionName':_0x383c9c['scriptName']};}function normalizeScalarParams(_0x1a14de){const _0x2387d8=a60_0x3218;return Object[_0x2387d8(0x179)](Object[_0x2387d8(0x14b)](_0x1a14de)['filter'](([,_0x201559])=>typeof _0x201559==='string'||typeof _0x201559===_0x2387d8(0x138)));}function hasText(_0x33ae4d){const _0xea442b=a60_0x3218;return typeof _0x33ae4d===_0xea442b(0x130)&&_0x33ae4d[_0xea442b(0x158)]()[_0xea442b(0x134)]>0x0;}function a60_0x332b(){const _0x1b2a9b=['target','15788muboLR','enum','\x20\x20SERVICE\x20TREE\x20TARGET','sqlCode','356958ZssCLL','5924898MltbMI','mapTo','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','high-risk-write','employeeId','join','read','find','Run\x20service\x20command\x20','source','startsWith','\x20requires\x20target.functionName.','appRef','datatable','remainingArgs','service','5011692CfZkmR','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','\x20\x20\x20\x20','context.','string','\x20->\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','tree','length','push','fullPath','description','number','map','datasetCode','bff','const','Unsupported\x20service\x20target\x20kind:\x20','\x20\x20\x20\x20sqlCode:\x20','env','\x20completed\x20in\x20','slice','sql','cliName','envName','required','55EYNnxI','bffCode','flags','`\x20to\x20inspect\x20the\x20manifest.','\x22.\x20','entries','appcode','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.','\x20requires\x20target.sqlCode.','277641IUzlzw','loginName','\x22\x20in\x20service\x20command\x20','bffId','appCode','type','\x20\x20\x20\x20functionName:\x20','risk','boolean','trim','kind','name','cliPath','7qhzqwv','operator','username','code','Preview\x20dynamic\x20service\x20command:\x20','ctx.','nickName','Use\x20`','tenantCode','Commands:','6241016EgxOhk','tableName','now','app','SERVICE_TREE','normalizedManifest','appBindings','userName','\x20<command>\x20[flags]','rawFlags','dbtableConfig','commands','validation','args','Unknown\x20appRef\x20\x22','Service\x20command\x20','data','filter','\x20\x20MAP\x20TO','fromEntries','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','scriptName','command','nickname','params','1157149pIjIMG'];a60_0x332b=function(){return _0x1b2a9b;};return a60_0x332b();}function isPrimitiveFlagDefault(_0x13395c){const _0x58664c=a60_0x3218;return _0x13395c===undefined||typeof _0x13395c===_0x58664c(0x130)||typeof _0x13395c==='number'||typeof _0x13395c===_0x58664c(0x157);}
|
|
1
|
+
(function(_0xc49172,_0x14bc56){const _0x178841=a60_0x1845,_0x6c7387=_0xc49172();while(!![]){try{const _0x205da4=parseInt(_0x178841(0x1e1))/0x1+parseInt(_0x178841(0x18a))/0x2*(parseInt(_0x178841(0x194))/0x3)+-parseInt(_0x178841(0x184))/0x4+parseInt(_0x178841(0x1dd))/0x5*(parseInt(_0x178841(0x183))/0x6)+parseInt(_0x178841(0x1d8))/0x7*(parseInt(_0x178841(0x1b3))/0x8)+parseInt(_0x178841(0x197))/0x9+-parseInt(_0x178841(0x182))/0xa;if(_0x205da4===_0x14bc56)break;else _0x6c7387['push'](_0x6c7387['shift']());}catch(_0x3c2154){_0x6c7387['push'](_0x6c7387['shift']());}}}(a60_0x1d82,0xae04d));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(_0x27a3f0,_0x4b341d){const _0x5562fe=a60_0x1845,_0x351280=listLocalServiceTrees();let _0x572a23;for(const _0x42db3c of _0x351280){const _0x5d41a0=matchServiceTreeCommand(_0x42db3c,_0x27a3f0);if(!_0x5d41a0)continue;(!_0x572a23||_0x5d41a0[_0x5562fe(0x1ca)][_0x5562fe(0x1c9)]['length']>_0x572a23[_0x5562fe(0x1ca)]['fullPath']['length'])&&(_0x572a23={'tree':_0x42db3c,'command':_0x5d41a0[_0x5562fe(0x1ca)],'remainingArgs':_0x5d41a0[_0x5562fe(0x1bf)]});}if(!_0x572a23)return undefined;const _0xe1ee09={..._0x4b341d};return applyAppBinding(_0x572a23[_0x5562fe(0x1b2)],_0x572a23['command'],_0xe1ee09),{'definition':buildDynamicCommandDefinition(_0x572a23[_0x5562fe(0x1b2)],_0x572a23[_0x5562fe(0x1ca)]),'args':_0x572a23[_0x5562fe(0x1bf)],'flags':_0xe1ee09,'tree':_0x572a23['tree'],'command':_0x572a23['command']};}export function generateDynamicServiceHelp(_0x5125e2){const _0x3d2c0c=a60_0x1845,_0x20bd53=listLocalServiceTrees()[_0x3d2c0c(0x199)](_0x30b5bc=>_0x30b5bc[_0x3d2c0c(0x1ac)][_0x3d2c0c(0x19e)]===_0x5125e2);if(!_0x20bd53)return undefined;const _0x804b77=[CLI_BIN_NAME+'\x20'+_0x5125e2+'\x20<command>\x20[flags]','',_0x20bd53[_0x3d2c0c(0x1ac)][_0x3d2c0c(0x1c2)]||_0x5125e2,_0x20bd53['service'][_0x3d2c0c(0x18f)]?'\x20\x20'+_0x20bd53[_0x3d2c0c(0x1ac)]['description']:'','',_0x3d2c0c(0x195),..._0x20bd53[_0x3d2c0c(0x1b5)][_0x3d2c0c(0x1d3)](_0x472822=>{const _0x5602bb=_0x3d2c0c,_0x4751bf=_0x472822['fullPath'][_0x5602bb(0x19f)](0x1)[_0x5602bb(0x1bc)]('\x20'),_0x355cfb=_0x472822[_0x5602bb(0x1be)]==='read'?'':'\x20['+_0x472822['risk']+']';return'\x20\x20'+_0x4751bf[_0x5602bb(0x1e8)](0x18)+'\x20'+(_0x472822[_0x5602bb(0x18f)]||'')+_0x355cfb;}),'',_0x3d2c0c(0x19d)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x5125e2+'`\x20to\x20inspect\x20the\x20manifest.']['filter'](Boolean);return _0x804b77[_0x3d2c0c(0x1bc)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x429836=>{const _0x5df52f=a60_0x1845,_0x3a16dc=_0x429836[_0x5df52f(0x1c6)];return{'service':_0x3a16dc['service'][_0x5df52f(0x19e)],'label':_0x3a16dc[_0x5df52f(0x1ac)][_0x5df52f(0x1c2)]||_0x3a16dc[_0x5df52f(0x1ac)][_0x5df52f(0x19e)],'commands':_0x3a16dc[_0x5df52f(0x1b5)]['map'](_0x7875b9=>({'command':dynamicCommandName(_0x7875b9),'description':_0x7875b9[_0x5df52f(0x18f)]||_0x5df52f(0x1c7)+_0x7875b9['cliPath'],'tag':riskTag(_0x7875b9[_0x5df52f(0x1be)])}))};});}export function getDynamicServiceEntry(_0x2fc5c0){const _0x2911b9=a60_0x1845;return listDynamicServiceEntries()[_0x2911b9(0x199)](_0x5cc62d=>_0x5cc62d[_0x2911b9(0x1ac)]===_0x2fc5c0);}export function listDynamicServiceDefinitions(_0x3be15c){const _0x5b47eb=a60_0x1845;return listLocalServiceTrees()[_0x5b47eb(0x1b4)](_0x16e1d7=>!_0x3be15c||_0x16e1d7['service'][_0x5b47eb(0x19e)]===_0x3be15c)[_0x5b47eb(0x1e9)](_0x18fa74=>_0x18fa74[_0x5b47eb(0x1b5)]['map'](_0x2527b3=>buildDynamicCommandDefinition(_0x18fa74,_0x2527b3)));}export function getDynamicServiceDefinitions(_0x239f9b){const _0x4567c5=listDynamicServiceDefinitions(_0x239f9b);return _0x4567c5['length']>0x0?_0x4567c5:undefined;}export function findDynamicServiceDefinition(_0x46b217,_0x5dfbc9){const _0x3ef4d6=a60_0x1845;return listDynamicServiceDefinitions(_0x46b217)[_0x3ef4d6(0x199)](_0x720f02=>_0x720f02[_0x3ef4d6(0x1ca)]===_0x5dfbc9);}export function buildDynamicCommandDefinition(_0x4568d2,_0x5c08a9){const _0x11dbf2=a60_0x1845;return{'service':_0x4568d2[_0x11dbf2(0x1ac)]['code'],'command':dynamicCommandName(_0x5c08a9),'description':_0x5c08a9[_0x11dbf2(0x18f)]||_0x11dbf2(0x1c7)+_0x5c08a9[_0x11dbf2(0x1a3)],'risk':_0x5c08a9[_0x11dbf2(0x1be)],..._0x5c08a9[_0x11dbf2(0x1be)]==='read'?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x5c08a9)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x5c08a9[_0x11dbf2(0x193)]['map'](_0x4be545=>({'name':_0x4be545[_0x11dbf2(0x1c2)],'description':_0x4be545[_0x11dbf2(0x18f)]||_0x4be545['name'],'required':_0x4be545['required']})),'flags':_0x5c08a9[_0x11dbf2(0x1c4)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x5c08a9),async 'dryRun'(_0x157615){const _0x5f0194=_0x11dbf2,_0x4d4071=await compilePlan(_0x5c08a9,_0x157615);return{'method':_0x5f0194(0x1e7),'url':_0x5c08a9[_0x5f0194(0x1a3)],'body':{'target':targetPreview(_0x4d4071),'params':_0x4d4071['params']},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x5c08a9['cliPath']};},async 'execute'(_0x4cb0ff){const _0x508391=_0x11dbf2,_0x4eafa1=await compilePlan(_0x5c08a9,_0x4cb0ff),_0x2b4c91=Date[_0x508391(0x1ab)](),_0x53057b=await executePlan(_0x4eafa1,_0x5c08a9,_0x4cb0ff),_0x455a1f=Date[_0x508391(0x1ab)]()-_0x2b4c91;return{'ok':!![],'data':{'service':_0x4568d2[_0x508391(0x1ac)],'command':_0x5c08a9[_0x508391(0x1a3)],'target':targetPreview(_0x4eafa1),'result':_0x53057b,'elapsed':_0x455a1f},'message':'Service\x20command\x20'+_0x5c08a9[_0x508391(0x1a3)]+_0x508391(0x185)+_0x455a1f+'ms'};}};}function buildDynamicConfirmationDescription(_0x46f7a9){const _0x1d8640=a60_0x1845,_0x4db1f4=_0x46f7a9[_0x1d8640(0x18f)]||_0x46f7a9[_0x1d8640(0x1a3)],_0x22cfda=_0x46f7a9[_0x1d8640(0x1be)]===_0x1d8640(0x1e6)?_0x1d8640(0x1b0):_0x1d8640(0x19b);return _0x1d8640(0x1cd)+_0x4db1f4+_0x1d8640(0x196)+_0x22cfda;}function a60_0x1845(_0x24b052,_0x578016){_0x24b052=_0x24b052-0x17f;const _0x1d82e2=a60_0x1d82();let _0x184588=_0x1d82e2[_0x24b052];return _0x184588;}function dynamicCommandName(_0x3ae482){const _0x9c9123=a60_0x1845;return _0x3ae482['fullPath'][_0x9c9123(0x19f)](0x1)[_0x9c9123(0x1bc)]('\x20');}function riskTag(_0x59a47b){const _0x15bdf2=a60_0x1845;return _0x59a47b===_0x15bdf2(0x1cf)?'':_0x15bdf2(0x1d0)+_0x59a47b+']';}function flagToCommandFlag(_0x44febb){const _0x16a29f=a60_0x1845;return{'name':_0x44febb['cliName'],'type':_0x44febb[_0x16a29f(0x1e4)]===_0x16a29f(0x1b1)?'string':_0x44febb[_0x16a29f(0x1e4)],'description':_0x44febb[_0x16a29f(0x18f)]||_0x44febb[_0x16a29f(0x1c2)],'required':_0x44febb[_0x16a29f(0x1e3)],'default':isPrimitiveFlagDefault(_0x44febb['default'])?_0x44febb[_0x16a29f(0x1c3)]:undefined,'enum':_0x44febb['enum']};}async function compilePlan(_0xdd2595,_0x58f0a7){const _0xefaf59=a60_0x1845;return compileServiceTreeCommand(_0xdd2595,{'flags':_0x58f0a7[_0xefaf59(0x17f)],'args':_0x58f0a7[_0xefaf59(0x193)],'context':await buildServiceContext(_0xdd2595,_0x58f0a7)});}async function buildServiceContext(_0x1c19c1,_0x137590){const _0x608701=a60_0x1845,_0x5282b6={'appCode':_0x137590[_0x608701(0x1ea)],'env':_0x137590[_0x608701(0x1ba)],'envName':_0x137590[_0x608701(0x1ba)]};if(!usesRuntimeContext(_0x1c19c1))return _0x5282b6;const _0x39dd63=await getLoginUserInfo(),_0x1490fb=pickFirst(_0x39dd63[_0x608701(0x1c8)],_0x39dd63['id']);return{..._0x5282b6,'user':_0x39dd63,'userId':_0x1490fb,'id':_0x39dd63['id'],'username':pickFirst(_0x39dd63[_0x608701(0x1cb)],_0x39dd63['userName'],_0x39dd63[_0x608701(0x1dc)]),'userName':_0x39dd63[_0x608701(0x186)],'nickname':pickFirst(_0x39dd63[_0x608701(0x191)],_0x39dd63[_0x608701(0x1df)]),'nickName':_0x39dd63[_0x608701(0x1df)],'tenantCode':_0x39dd63[_0x608701(0x1ad)],'employeeId':_0x39dd63[_0x608701(0x1a4)]};}function usesRuntimeContext(_0x723b48){const _0x5a84e4=a60_0x1845;return _0x723b48[_0x5a84e4(0x1a7)]['some'](_0x596cda=>typeof _0x596cda[_0x5a84e4(0x181)]===_0x5a84e4(0x1e5)&&(_0x596cda[_0x5a84e4(0x181)][_0x5a84e4(0x192)]('context.')||_0x596cda[_0x5a84e4(0x181)]['startsWith'](_0x5a84e4(0x1a1))));}function pickFirst(..._0x3f11ed){const _0x491cc9=a60_0x1845;return _0x3f11ed[_0x491cc9(0x199)](_0x3801c=>_0x3801c!==undefined&&_0x3801c!==null);}async function executePlan(_0x57bf92,_0x34c33b,_0xf3a174){const _0x296f76=a60_0x1845;if(_0x57bf92[_0x296f76(0x1ae)]==='data'){const _0x3cc696=await resolveDatasetCode(_0x57bf92,_0x34c33b,_0xf3a174);return executeData(_0x3cc696,_0x57bf92[_0x296f76(0x1ca)],_0x57bf92[_0x296f76(0x188)]);}if(_0x57bf92[_0x296f76(0x1ae)]===_0x296f76(0x190)){if(!_0x57bf92[_0x296f76(0x1d5)])throw CliErrors[_0x296f76(0x1de)]('Service\x20command\x20'+_0x34c33b[_0x296f76(0x1a3)]+_0x296f76(0x1a6));return executeSdkSql(_0x57bf92[_0x296f76(0x1d5)],normalizeScalarParams(_0x57bf92[_0x296f76(0x188)]));}if(_0x57bf92[_0x296f76(0x1ae)]===_0x296f76(0x1bb)){const _0x5e31ee=_0x57bf92['scriptName']||_0x57bf92[_0x296f76(0x198)]||(_0x57bf92['bffId']==null?'':String(_0x57bf92[_0x296f76(0x1aa)]));if(!_0x5e31ee)throw CliErrors['validation'](_0x296f76(0x1a2)+_0x34c33b['cliPath']+_0x296f76(0x1b8));return executeSdkBff(_0x5e31ee,_0x57bf92[_0x296f76(0x188)]);}throw CliErrors['validation'](_0x296f76(0x1a9)+_0x57bf92['kind']);}async function resolveDatasetCode(_0x3a7eca,_0x344ce2,_0x14df3c){const _0xc4def8=a60_0x1845;if(_0x3a7eca[_0xc4def8(0x1af)])return _0x3a7eca['datasetCode'];if(!_0x3a7eca[_0xc4def8(0x1a5)])throw CliErrors[_0xc4def8(0x1de)](_0xc4def8(0x1a2)+_0x344ce2[_0xc4def8(0x1a3)]+_0xc4def8(0x1e0));const _0x29a745=await listDatasets(_0x14df3c[_0xc4def8(0x1ea)]),_0x5be76f=_0x29a745[_0xc4def8(0x199)](_0x684d97=>_0x684d97[_0xc4def8(0x1b6)]?.['tableName']===_0x3a7eca[_0xc4def8(0x1a5)]);if(!_0x5be76f?.[_0xc4def8(0x19e)])throw CliErrors[_0xc4def8(0x1de)](_0xc4def8(0x1da)+_0x3a7eca[_0xc4def8(0x1a5)]+_0xc4def8(0x180)+_0x14df3c[_0xc4def8(0x1ea)]+'.',_0xc4def8(0x1c0));return _0x5be76f[_0xc4def8(0x19e)];}function applyAppBinding(_0x1e02d7,_0x34d7c0,_0x20215d){const _0x24a086=a60_0x1845,_0xa7ecea=_0x34d7c0[_0x24a086(0x1c5)]['appRef'];if(!_0xa7ecea)return;const _0x1944dc=_0x1e02d7['appBindings'][_0xa7ecea];if(!_0x1944dc)throw CliErrors['validation'](_0x24a086(0x18b)+_0xa7ecea+_0x24a086(0x1d2)+_0x34d7c0['cliPath']+'.',_0x24a086(0x1bd));const _0xa85a1b=_0x1944dc[_0x24a086(0x18e)]||_0x1944dc[_0x24a086(0x1ea)];_0xa85a1b&&!hasText(_0x20215d['appcode'])&&(_0x20215d[_0x24a086(0x18e)]=_0xa85a1b),_0x1944dc[_0x24a086(0x1cc)]&&!hasText(_0x20215d[_0x24a086(0x1cc)])&&!hasText(_0x20215d['appcode'])&&(_0x20215d[_0x24a086(0x1cc)]=_0x1944dc['app']),_0x1944dc[_0x24a086(0x1ce)]&&!hasText(_0x20215d[_0x24a086(0x1ce)])&&(_0x20215d[_0x24a086(0x1ce)]=_0x1944dc[_0x24a086(0x1ce)]);}function renderDynamicCommandHelp(_0x503151){const _0x31ade8=a60_0x1845,_0x4a7167=[_0x31ade8(0x1b7),_0x31ade8(0x1db)+_0x503151[_0x31ade8(0x1c5)]['kind'],_0x31ade8(0x1e2)+_0x503151['target'][_0x31ade8(0x1ca)]];if(_0x503151[_0x31ade8(0x1c5)][_0x31ade8(0x1af)])_0x4a7167[_0x31ade8(0x1d7)]('\x20\x20\x20\x20datasetCode:\x20'+_0x503151['target']['datasetCode']);if(_0x503151[_0x31ade8(0x1c5)][_0x31ade8(0x1a5)])_0x4a7167[_0x31ade8(0x1d7)](_0x31ade8(0x19a)+_0x503151[_0x31ade8(0x1c5)][_0x31ade8(0x1a5)]);if(_0x503151[_0x31ade8(0x1c5)]['sqlCode'])_0x4a7167[_0x31ade8(0x1d7)](_0x31ade8(0x1c1)+_0x503151[_0x31ade8(0x1c5)][_0x31ade8(0x1d5)]);if(_0x503151[_0x31ade8(0x1c5)][_0x31ade8(0x187)])_0x4a7167[_0x31ade8(0x1d7)](_0x31ade8(0x189)+_0x503151[_0x31ade8(0x1c5)]['scriptName']);if(_0x503151[_0x31ade8(0x1a7)]['length']>0x0){_0x4a7167[_0x31ade8(0x1d7)]('',_0x31ade8(0x19c));for(const _0x2f8c34 of _0x503151['mapTo']){_0x4a7167[_0x31ade8(0x1d7)](_0x31ade8(0x1d4)+(_0x2f8c34[_0x31ade8(0x181)]||_0x31ade8(0x1d9))+_0x31ade8(0x18d)+_0x2f8c34[_0x31ade8(0x1c5)]+(_0x2f8c34['operator']?'.'+_0x2f8c34[_0x31ade8(0x1d6)]:''));}}return _0x4a7167['join']('\x0a');}function targetPreview(_0x370bac){const _0x334681=a60_0x1845;return{'kind':_0x370bac[_0x334681(0x1ae)],'command':_0x370bac[_0x334681(0x1ca)],'appRef':_0x370bac[_0x334681(0x1b9)],'datasetCode':_0x370bac[_0x334681(0x1af)],'datatable':_0x370bac[_0x334681(0x1a5)],'sqlCode':_0x370bac[_0x334681(0x1d5)],'bffCode':_0x370bac[_0x334681(0x198)],'bffId':_0x370bac[_0x334681(0x1aa)],'functionName':_0x370bac['scriptName']};}function a60_0x1d82(){const _0x50dd05=['env','read','\x20\x20[','trim','\x22\x20in\x20service\x20command\x20','map','\x20\x20\x20\x20','sqlCode','operator','push','2149rjlDIK','const','Cannot\x20resolve\x20datatable\x20\x22','\x20\x20\x20\x20kind:\x20\x20\x20\x20','loginName','5MRIJPH','validation','nickName','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','294606PzEbPb','\x20\x20\x20\x20command:\x20','required','type','string','high-risk-write','SERVICE_TREE','padEnd','flatMap','appCode','rawFlags','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','source','18849740GYlYMY','164154NsUGhk','5066396RrvcfC','\x20completed\x20in\x20','userName','scriptName','params','\x20\x20\x20\x20functionName:\x20','748mBhjCR','Unknown\x20appRef\x20\x22','length','\x20->\x20','appcode','description','sql','nickname','startsWith','args','10128KGpGzI','Commands:','\x22.\x20','12762144JrlPhz','bffCode','find','\x20\x20\x20\x20datatable:\x20','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','\x20\x20MAP\x20TO','Use\x20`','code','slice','number','ctx.','Service\x20command\x20','cliPath','employeeId','datatable','\x20requires\x20target.sqlCode.','mapTo','entries','Unsupported\x20service\x20target\x20kind:\x20','bffId','now','service','tenantCode','kind','datasetCode','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.','json','tree','22456VUUNaw','filter','commands','dbtableConfig','\x20\x20SERVICE\x20TREE\x20TARGET','\x20requires\x20target.functionName.','appRef','envName','bff','join','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','risk','remainingArgs','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x20\x20\x20\x20sqlCode:\x20','name','default','flags','target','normalizedManifest','Run\x20service\x20command\x20','userId','fullPath','command','username','app','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22'];a60_0x1d82=function(){return _0x50dd05;};return a60_0x1d82();}function normalizeScalarParams(_0x1e8149){const _0x49d78a=a60_0x1845;return Object['fromEntries'](Object[_0x49d78a(0x1a8)](_0x1e8149)[_0x49d78a(0x1b4)](([,_0x4e5a16])=>typeof _0x4e5a16===_0x49d78a(0x1e5)||typeof _0x4e5a16===_0x49d78a(0x1a0)));}function hasText(_0x2e54df){const _0x23f34e=a60_0x1845;return typeof _0x2e54df==='string'&&_0x2e54df[_0x23f34e(0x1d1)]()[_0x23f34e(0x18c)]>0x0;}function isPrimitiveFlagDefault(_0x32fb5f){const _0xd6a5b5=a60_0x1845;return _0x32fb5f===undefined||typeof _0x32fb5f===_0xd6a5b5(0x1e5)||typeof _0x32fb5f==='number'||typeof _0x32fb5f==='boolean';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4f8ca3,_0x107236){const _0x76dc=a61_0x50eb,_0x327207=_0x4f8ca3();while(!![]){try{const _0x3f07cf=parseInt(_0x76dc(0x92))/0x1*(parseInt(_0x76dc(0xac))/0x2)+parseInt(_0x76dc(0x8d))/0x3*(parseInt(_0x76dc(0x90))/0x4)+-parseInt(_0x76dc(0x8e))/0x5*(-parseInt(_0x76dc(0x9d))/0x6)+-parseInt(_0x76dc(0x9a))/0x7+-parseInt(_0x76dc(0x9b))/0x8*(-parseInt(_0x76dc(0xab))/0x9)+-parseInt(_0x76dc(0xa0))/0xa+-parseInt(_0x76dc(0x9f))/0xb*(parseInt(_0x76dc(0xa2))/0xc);if(_0x3f07cf===_0x107236)break;else _0x327207['push'](_0x327207['shift']());}catch(_0x3e3c88){_0x327207['push'](_0x327207['shift']());}}}(a61_0x40f2,0x7a487));export function adaptServiceTreeManifestForLegacyFramework(_0x28bf97){const _0x5ac66f=a61_0x50eb,_0x3e45eb=cloneJsonValue(_0x28bf97),_0xb355fd=[];if(!isObjectRecord(_0x3e45eb))return{'manifest':_0x3e45eb,'errors':_0xb355fd};return Array[_0x5ac66f(0x94)](_0x3e45eb['commands'])&&_0x3e45eb[_0x5ac66f(0x85)][_0x5ac66f(0x97)]((_0x3f8d90,_0x555111)=>{const _0xb8a9cf=_0x5ac66f;if(!isObjectRecord(_0x3f8d90))return;adaptBffTarget(_0x3f8d90[_0xb8a9cf(0x8a)],_0xb8a9cf(0xa1)+_0x555111+_0xb8a9cf(0x8f),_0xb355fd);}),adaptResources(_0x3e45eb[_0x5ac66f(0x8c)],_0x5ac66f(0x89),_0xb355fd),{'manifest':_0x3e45eb,'errors':_0xb355fd};}export function toPublicServiceTreeTarget(_0x232e91){const _0x4fcc17=a61_0x50eb,{scriptName:_0x1b7a73,..._0x2ac394}=_0x232e91;return typeof _0x1b7a73===_0x4fcc17(0xa5)&&_0x1b7a73[_0x4fcc17(0x93)]()&&(_0x2ac394[_0x4fcc17(0xa3)]=_0x1b7a73),_0x2ac394;}export function toPublicNormalizedServiceTree(_0x4c2752){const _0x1a618b=a61_0x50eb;return{..._0x4c2752,'commands':_0x4c2752[_0x1a618b(0x85)][_0x1a618b(0x98)](_0x1677c6=>({..._0x1677c6,'target':toPublicServiceTreeTarget(_0x1677c6[_0x1a618b(0x8a)])}))};}function adaptResources(_0x2026c5,_0x429ac3,_0x14d85b){const _0xf549f8=a61_0x50eb;if(!isObjectRecord(_0x2026c5))return;for(const [_0x3a5335,_0x59bf00]of Object[_0xf549f8(0x84)](_0x2026c5)){if(!isObjectRecord(_0x59bf00))continue;const _0x528066=_0x429ac3+'.'+_0x3a5335;if(isObjectRecord(_0x59bf00[_0xf549f8(0xa8)]))for(const [_0x2f139a,_0x49977d]of Object[_0xf549f8(0x84)](_0x59bf00[_0xf549f8(0xa8)])){if(!isObjectRecord(_0x49977d))continue;const _0x191b3c=_0x528066+'.actions.'+_0x2f139a,_0x2c9fde=isObjectRecord(_0x49977d[_0xf549f8(0x8a)])&&_0x49977d[_0xf549f8(0x8a)]['kind']===_0xf549f8(0x96);adaptBffTarget(_0x49977d[_0xf549f8(0x8a)],_0x191b3c+_0xf549f8(0xaa),_0x14d85b),(_0x2c9fde||isBffAction(_0x49977d))&&adaptFunctionNameField(_0x49977d,_0x191b3c,_0x14d85b);}adaptResources(_0x59bf00[_0xf549f8(0x8c)],_0x528066+'.resources',_0x14d85b);}}function adaptBffTarget(_0x16883d,_0x1fd56b,_0x38ac20){const _0x343c9b=a61_0x50eb;if(!isObjectRecord(_0x16883d)||_0x16883d[_0x343c9b(0x95)]!==_0x343c9b(0x96))return;adaptFunctionNameField(_0x16883d,_0x1fd56b,_0x38ac20);}function a61_0x50eb(_0x548130,_0x2c43b8){_0x548130=_0x548130-0x83;const _0x40f2b6=a61_0x40f2();let _0x50ebe3=_0x40f2b6[_0x548130];return _0x50ebe3;}function a61_0x40f2(){const _0x1caff4=['hasOwnProperty','functionName\x20must\x20be\x20a\x20non-empty\x20string.','error','$.resources','target','fromEntries','resources','10929HsTXUj','530zZrUMZ','].target','856kcFlOo','bff.exec','3NVGlyK','trim','isArray','kind','bff','forEach','map','object','770000lCGraJ','536lGNuVs','push','13602GKIrsa','call','149699ZdvAMh','6044950FttabQ','$.commands[','372ykMhlL','functionName','prototype','string','scriptName','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','actions','.scriptName','.target','78687thFvre','21040jwECij','action','entries','commands'];a61_0x40f2=function(){return _0x1caff4;};return a61_0x40f2();}function adaptFunctionNameField(_0x1f25cd,_0x34332c,_0x12fd25){const _0x5776ae=a61_0x50eb;Object[_0x5776ae(0xa4)][_0x5776ae(0x86)][_0x5776ae(0x9e)](_0x1f25cd,_0x5776ae(0xa6))&&_0x12fd25[_0x5776ae(0x9c)]({'level':_0x5776ae(0x88),'path':_0x34332c+_0x5776ae(0xa9),'message':_0x5776ae(0xa7)});if(Object[_0x5776ae(0xa4)]['hasOwnProperty'][_0x5776ae(0x9e)](_0x1f25cd,_0x5776ae(0xa3))){if(typeof _0x1f25cd['functionName']!==_0x5776ae(0xa5)||!_0x1f25cd[_0x5776ae(0xa3)][_0x5776ae(0x93)]()){_0x12fd25[_0x5776ae(0x9c)]({'level':'error','path':_0x34332c+'.functionName','message':_0x5776ae(0x87)}),delete _0x1f25cd['functionName'];return;}_0x1f25cd[_0x5776ae(0xa6)]=_0x1f25cd['functionName'],delete _0x1f25cd[_0x5776ae(0xa3)];}}function isBffAction(_0x39f032){const _0x47b623=a61_0x50eb;return _0x39f032['kind']===_0x47b623(0x96)||_0x39f032[_0x47b623(0x83)]===_0x47b623(0x91)||_0x39f032[_0x47b623(0x8a)]===_0x47b623(0x91);}function cloneJsonValue(_0xf62584){const _0x2e7de2=a61_0x50eb;if(Array[_0x2e7de2(0x94)](_0xf62584))return _0xf62584['map'](_0x3681aa=>cloneJsonValue(_0x3681aa));if(isObjectRecord(_0xf62584))return Object[_0x2e7de2(0x8b)](Object[_0x2e7de2(0x84)](_0xf62584)[_0x2e7de2(0x98)](([_0x11483e,_0x4ed9a2])=>[_0x11483e,cloneJsonValue(_0x4ed9a2)]));return _0xf62584;}function isObjectRecord(_0x16434e){const _0x528d0a=a61_0x50eb;return Boolean(_0x16434e)&&typeof _0x16434e===_0x528d0a(0x99)&&!Array[_0x528d0a(0x94)](_0x16434e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a62_0x41cbda=a62_0x2b04;(function(_0x1d829c,_0x58ad21){const _0x171547=a62_0x2b04,_0x38de33=_0x1d829c();while(!![]){try{const _0x20bc1a=-parseInt(_0x171547(0x13e))/0x1+parseInt(_0x171547(0x174))/0x2*(-parseInt(_0x171547(0x15a))/0x3)+-parseInt(_0x171547(0x146))/0x4+parseInt(_0x171547(0x15e))/0x5+-parseInt(_0x171547(0x14d))/0x6+parseInt(_0x171547(0x15d))/0x7*(-parseInt(_0x171547(0x12b))/0x8)+-parseInt(_0x171547(0x158))/0x9*(-parseInt(_0x171547(0x15b))/0xa);if(_0x20bc1a===_0x58ad21)break;else _0x38de33['push'](_0x38de33['shift']());}catch(_0x33e60a){_0x38de33['push'](_0x38de33['shift']());}}}(a62_0x52e3,0x51018));function a62_0x2b04(_0xa37a8,_0x38edad){_0xa37a8=_0xa37a8-0x12a;const _0x52e329=a62_0x52e3();let _0x2b04f8=_0x52e329[_0xa37a8];return _0x2b04f8;}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a62_0x52e3(){const _0x473f4d=['44262yULjNZ','Removed\x20service\x20','210153vcTUnC','1790chHTtw','source','518eWxgJb','2238350YlMVOe','serviceCount','remove','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','WRITE','replaced','registryServiceCode','\x20service(s),\x20updated\x20','Service\x20manifest\x20validation\x20passed.','entry','version','Service\x20Tree\x20manifest\x20file\x20path','report','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','filePath','map','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Local\x20service\x20not\x20found:\x20','lower\x20kebab-case\x20service\x20code','Imported\x20','hash','updated','6qBrdxn','cliPath','1176ofyQoK','flags','Updated','manifest','Imported','entries','risk','registry','description','warnings','normalizedManifest','target','export','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','\x20service(s).','\x20service\x20','cliName','errors','99211cXzFLy','Local\x20service\x20code,\x20for\x20example\x20crm','file','importedAt','read','write','service','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','2342908xaRnya','commands','Writes\x20the\x20local\x20Service\x20Tree\x20manifest\x20for\x20the\x20given\x20service\x20to\x20a\x20JSON\x20file.\x20An\x20existing\x20file\x20at\x20the\x20target\x20may\x20be\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','length','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','serviceCode','manifests','541338tSEHIp','registryPath','reduce','kind','string','imported','registryIndex','Reads\x20the\x20given\x20manifest\x20into\x20the\x20local\x20Service\x20Tree\x20registry.\x20An\x20existing\x20manifest\x20with\x20the\x20same\x20service\x20code\x20is\x20updated.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','str','required'];a62_0x52e3=function(){return _0x473f4d;};return a62_0x52e3();}const FILE_FLAG={'name':'file','type':'string','required':!![],'description':a62_0x41cbda(0x169)},SERVICE_FLAG={'name':a62_0x41cbda(0x144),'type':a62_0x41cbda(0x151),'required':!![],'description':a62_0x41cbda(0x13f),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a62_0x41cbda(0x170)}};function summarizeService(_0x4bc435){const _0x3784c5=a62_0x41cbda;return{'serviceCode':_0x4bc435[_0x3784c5(0x14b)],'name':_0x4bc435[_0x3784c5(0x135)][_0x3784c5(0x144)]['name'],'version':_0x4bc435[_0x3784c5(0x168)],'importedAt':_0x4bc435[_0x3784c5(0x141)],'source':_0x4bc435['source'],'commandCount':_0x4bc435[_0x3784c5(0x135)][_0x3784c5(0x147)][_0x3784c5(0x149)],'commands':_0x4bc435[_0x3784c5(0x135)][_0x3784c5(0x147)][_0x3784c5(0x16d)](_0x24328c=>({'path':_0x24328c[_0x3784c5(0x12a)],'description':_0x24328c[_0x3784c5(0x133)],'risk':_0x24328c[_0x3784c5(0x131)],'target':toPublicServiceTreeTarget(_0x24328c[_0x3784c5(0x136)]),'flags':_0x24328c[_0x3784c5(0x12c)][_0x3784c5(0x16d)](_0x1aa54=>({'name':_0x1aa54['name'],'cliName':_0x1aa54[_0x3784c5(0x13c)],'type':_0x1aa54['type'],'required':_0x1aa54[_0x3784c5(0x157)]===!![]}))}))};}function summarizeLoadedManifest(_0x3dad57){const _0x4fea9f=a62_0x41cbda;return{'service':_0x3dad57['normalizedManifest']?.[_0x4fea9f(0x144)],'version':_0x3dad57[_0x4fea9f(0x135)]?.[_0x4fea9f(0x168)],'commandCount':_0x3dad57['normalizedManifest']?.[_0x4fea9f(0x147)][_0x4fea9f(0x149)]??0x0,'commands':_0x3dad57[_0x4fea9f(0x135)]?.['commands'][_0x4fea9f(0x16d)](_0x5c02fc=>({'path':_0x5c02fc[_0x4fea9f(0x12a)],'risk':_0x5c02fc[_0x4fea9f(0x131)],'target':toPublicServiceTreeTarget(_0x5c02fc['target'])}))??[],'registryIndex':_0x3dad57[_0x4fea9f(0x153)],'registryServiceCode':_0x3dad57[_0x4fea9f(0x164)],'errors':_0x3dad57[_0x4fea9f(0x16a)][_0x4fea9f(0x13d)],'warnings':_0x3dad57[_0x4fea9f(0x16a)]['warnings']};}export const serviceDefinitions=[{'service':'service','command':'validate','description':a62_0x41cbda(0x16e),'risk':a62_0x41cbda(0x142),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x3dfe88){const _0x50d1c4=a62_0x41cbda,_0x502166=loadServiceManifestFromFile(_0x3dfe88[_0x50d1c4(0x156)](_0x50d1c4(0x140)));if(!_0x502166[_0x50d1c4(0x16a)]['ok'])return{'ok':![],'data':{'file':_0x502166['filePath'],'hash':_0x502166[_0x50d1c4(0x172)],'kind':_0x502166[_0x50d1c4(0x150)],'serviceCount':_0x502166[_0x50d1c4(0x14c)]['length'],'services':_0x502166[_0x50d1c4(0x14c)][_0x50d1c4(0x16d)](summarizeLoadedManifest),'errors':_0x502166[_0x50d1c4(0x16a)]['errors'],'warnings':_0x502166[_0x50d1c4(0x16a)]['warnings']},'message':formatValidationFailure(_0x502166[_0x50d1c4(0x16a)])};if(_0x502166[_0x50d1c4(0x150)]===_0x50d1c4(0x132)||_0x502166['manifests'][_0x50d1c4(0x149)]!==0x1)return{'ok':!![],'data':{'file':_0x502166[_0x50d1c4(0x16c)],'hash':_0x502166['hash'],'kind':_0x502166['kind'],'serviceCount':_0x502166[_0x50d1c4(0x14c)]['length'],'commandCount':_0x502166[_0x50d1c4(0x14c)][_0x50d1c4(0x14f)]((_0x18cd4a,_0xc97a01)=>_0x18cd4a+(_0xc97a01[_0x50d1c4(0x135)]?.[_0x50d1c4(0x147)][_0x50d1c4(0x149)]??0x0),0x0),'services':_0x502166[_0x50d1c4(0x14c)][_0x50d1c4(0x16d)](summarizeLoadedManifest),'warnings':_0x502166[_0x50d1c4(0x16a)][_0x50d1c4(0x134)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x502166[_0x50d1c4(0x16c)],'hash':_0x502166[_0x50d1c4(0x172)],'kind':_0x502166['kind'],'service':_0x502166[_0x50d1c4(0x135)]?.[_0x50d1c4(0x144)],'version':_0x502166[_0x50d1c4(0x135)]?.[_0x50d1c4(0x168)],'commandCount':_0x502166[_0x50d1c4(0x135)]?.[_0x50d1c4(0x147)][_0x50d1c4(0x149)]??0x0,'commands':_0x502166[_0x50d1c4(0x135)]?.[_0x50d1c4(0x147)][_0x50d1c4(0x16d)](_0x4a86ee=>({'path':_0x4a86ee[_0x50d1c4(0x12a)],'risk':_0x4a86ee[_0x50d1c4(0x131)],'target':toPublicServiceTreeTarget(_0x4a86ee[_0x50d1c4(0x136)])})),'warnings':_0x502166[_0x50d1c4(0x16a)]['warnings']},'message':_0x50d1c4(0x166)};}},{'service':a62_0x41cbda(0x144),'command':'import','description':a62_0x41cbda(0x145),'risk':a62_0x41cbda(0x143),'confirmationDescription':a62_0x41cbda(0x154),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x36ae08){const _0x172770=a62_0x41cbda,_0x2377da=loadServiceManifestFromFile(_0x36ae08['str'](_0x172770(0x140)));return{'method':_0x172770(0x162),'url':getServiceRegistryPath(),'body':{'file':_0x2377da[_0x172770(0x16c)],'hash':_0x2377da[_0x172770(0x172)],'kind':_0x2377da[_0x172770(0x150)],'ok':_0x2377da['report']['ok'],'service':_0x2377da[_0x172770(0x135)]?.['service'],'version':_0x2377da[_0x172770(0x135)]?.['version'],'serviceCount':_0x2377da[_0x172770(0x14c)][_0x172770(0x149)],'services':_0x2377da['manifests'][_0x172770(0x16d)](_0x217020=>({'service':_0x217020[_0x172770(0x135)]?.[_0x172770(0x144)],'version':_0x217020[_0x172770(0x135)]?.[_0x172770(0x168)],'commandCount':_0x217020[_0x172770(0x135)]?.[_0x172770(0x147)][_0x172770(0x149)]??0x0,'errors':_0x217020['report'][_0x172770(0x13d)]})),'errors':_0x2377da[_0x172770(0x16a)]['errors'],'commandCount':_0x2377da[_0x172770(0x135)]?.[_0x172770(0x147)][_0x172770(0x149)]??0x0},'description':_0x172770(0x138)};},async 'execute'(_0x285e8b){const _0x325ebd=a62_0x41cbda,_0x5c41df=importServiceManifest(_0x285e8b[_0x325ebd(0x156)](_0x325ebd(0x140)));if(_0x5c41df[_0x325ebd(0x130)][_0x325ebd(0x149)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x5c41df[_0x325ebd(0x14e)],'imported':_0x5c41df['imported'],'updated':_0x5c41df[_0x325ebd(0x173)],'serviceCount':_0x5c41df[_0x325ebd(0x15f)],'services':_0x5c41df[_0x325ebd(0x130)][_0x325ebd(0x16d)](summarizeService)},'message':_0x325ebd(0x171)+_0x5c41df[_0x325ebd(0x152)]+_0x325ebd(0x165)+_0x5c41df[_0x325ebd(0x173)]+_0x325ebd(0x13a)};return{'ok':!![],'data':{'registryPath':_0x5c41df[_0x325ebd(0x14e)],'replaced':_0x5c41df[_0x325ebd(0x163)],'imported':_0x5c41df[_0x325ebd(0x152)],'updated':_0x5c41df[_0x325ebd(0x173)],'serviceCount':_0x5c41df['serviceCount'],'service':summarizeService(_0x5c41df[_0x325ebd(0x167)])},'message':(_0x5c41df[_0x325ebd(0x163)]?_0x325ebd(0x12d):_0x325ebd(0x12f))+_0x325ebd(0x13b)+_0x5c41df['entry'][_0x325ebd(0x14b)]+'.'};}},{'service':a62_0x41cbda(0x144),'command':a62_0x41cbda(0x137),'description':a62_0x41cbda(0x139),'risk':a62_0x41cbda(0x143),'confirmationDescription':a62_0x41cbda(0x148),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x1e7ad1){const _0x15c73d=a62_0x41cbda,_0x114832=getLocalServiceEntry(_0x1e7ad1[_0x15c73d(0x156)](_0x15c73d(0x144)));return{'method':_0x15c73d(0x162),'url':_0x1e7ad1[_0x15c73d(0x156)](_0x15c73d(0x140)),'body':{'service':_0x1e7ad1[_0x15c73d(0x156)](_0x15c73d(0x144)),'found':Boolean(_0x114832),'version':_0x114832?.[_0x15c73d(0x168)],'source':_0x114832?.[_0x15c73d(0x15c)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x1a4a3b){const _0x194dc0=a62_0x41cbda,_0x3eec81=exportServiceManifest(_0x1a4a3b[_0x194dc0(0x156)](_0x194dc0(0x144)),_0x1a4a3b['str'](_0x194dc0(0x140)));return{'ok':!![],'data':{'registryPath':_0x3eec81['registryPath'],'file':_0x3eec81[_0x194dc0(0x16c)],'service':summarizeService(_0x3eec81['entry'])},'message':'Exported\x20service\x20'+_0x3eec81[_0x194dc0(0x167)][_0x194dc0(0x14b)]+'.'};}},{'service':a62_0x41cbda(0x144),'command':'list','description':a62_0x41cbda(0x155),'risk':a62_0x41cbda(0x142),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5b3b11=a62_0x41cbda,_0x3ec428=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x3ec428[_0x5b3b11(0x149)],'services':_0x3ec428[_0x5b3b11(0x16d)](summarizeService)}};}},{'service':'service','command':a62_0x41cbda(0x160),'description':'Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','risk':'write','confirmationDescription':a62_0x41cbda(0x14a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x3e8a04){const _0x512eb1=a62_0x41cbda,_0x178524=getLocalServiceEntry(_0x3e8a04[_0x512eb1(0x156)](_0x512eb1(0x144)));return{'method':_0x512eb1(0x162),'url':getServiceRegistryPath(),'body':{'service':_0x3e8a04[_0x512eb1(0x156)]('service'),'found':Boolean(_0x178524),'version':_0x178524?.[_0x512eb1(0x168)],'source':_0x178524?.[_0x512eb1(0x15c)]},'description':_0x512eb1(0x16b)};},async 'execute'(_0xf24cb2){const _0x57c556=a62_0x41cbda,_0x36d464=removeServiceManifest(_0xf24cb2['str'](_0x57c556(0x144)));return{'ok':!![],'data':{'registryPath':_0x36d464[_0x57c556(0x14e)],'serviceCount':_0x36d464['serviceCount'],'service':summarizeService(_0x36d464[_0x57c556(0x167)])},'message':_0x57c556(0x159)+_0x36d464[_0x57c556(0x167)]['serviceCode']+'.'};}},{'service':a62_0x41cbda(0x144),'command':'detail','description':a62_0x41cbda(0x161),'risk':a62_0x41cbda(0x142),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x34e4e3){const _0x3e1991=a62_0x41cbda,_0x1f5a9d=getLocalServiceEntry(_0x34e4e3[_0x3e1991(0x156)](_0x3e1991(0x144)));if(!_0x1f5a9d)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x34e4e3[_0x3e1991(0x156)](_0x3e1991(0x144))},'message':_0x3e1991(0x16f)+_0x34e4e3[_0x3e1991(0x156)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x1f5a9d),'manifest':_0x1f5a9d[_0x3e1991(0x12e)],'normalizedManifest':toPublicNormalizedServiceTree(_0x1f5a9d[_0x3e1991(0x135)])}};}}];
|
|
1
|
+
const a62_0x389f55=a62_0x19e7;(function(_0x38f269,_0x35b05d){const _0x34b4ba=a62_0x19e7,_0x557ec6=_0x38f269();while(!![]){try{const _0x50fa5b=-parseInt(_0x34b4ba(0x1d6))/0x1*(parseInt(_0x34b4ba(0x1d2))/0x2)+parseInt(_0x34b4ba(0x1cf))/0x3+-parseInt(_0x34b4ba(0x1e4))/0x4+parseInt(_0x34b4ba(0x218))/0x5+-parseInt(_0x34b4ba(0x1eb))/0x6*(-parseInt(_0x34b4ba(0x1d5))/0x7)+parseInt(_0x34b4ba(0x1dd))/0x8*(parseInt(_0x34b4ba(0x1fb))/0x9)+-parseInt(_0x34b4ba(0x204))/0xa*(parseInt(_0x34b4ba(0x1e2))/0xb);if(_0x50fa5b===_0x35b05d)break;else _0x557ec6['push'](_0x557ec6['shift']());}catch(_0x4bbb51){_0x557ec6['push'](_0x557ec6['shift']());}}}(a62_0x1e6b,0xd3e73));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a62_0x19e7(_0x16379c,_0xc295e0){_0x16379c=_0x16379c-0x1cb;const _0x1e6bf5=a62_0x1e6b();let _0x19e7cc=_0x1e6bf5[_0x16379c];return _0x19e7cc;}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a62_0x389f55(0x208),'type':'string','required':!![],'description':a62_0x389f55(0x1f8)},SERVICE_FLAG={'name':a62_0x389f55(0x1fa),'type':a62_0x389f55(0x206),'required':!![],'description':a62_0x389f55(0x1e0),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a62_0x389f55(0x217)}};function summarizeService(_0x11c762){const _0x9a9030=a62_0x389f55;return{'serviceCode':_0x11c762[_0x9a9030(0x1da)],'name':_0x11c762[_0x9a9030(0x1ce)][_0x9a9030(0x1fa)][_0x9a9030(0x1ef)],'version':_0x11c762[_0x9a9030(0x1f9)],'importedAt':_0x11c762['importedAt'],'source':_0x11c762[_0x9a9030(0x1f0)],'commandCount':_0x11c762['normalizedManifest'][_0x9a9030(0x213)][_0x9a9030(0x1d4)],'commands':_0x11c762[_0x9a9030(0x1ce)][_0x9a9030(0x213)][_0x9a9030(0x1f5)](_0x459f8e=>({'path':_0x459f8e[_0x9a9030(0x215)],'description':_0x459f8e[_0x9a9030(0x1df)],'risk':_0x459f8e[_0x9a9030(0x20d)],'target':toPublicServiceTreeTarget(_0x459f8e[_0x9a9030(0x1cd)]),'flags':_0x459f8e[_0x9a9030(0x1ea)][_0x9a9030(0x1f5)](_0x5d9a43=>({'name':_0x5d9a43['name'],'cliName':_0x5d9a43[_0x9a9030(0x20f)],'type':_0x5d9a43[_0x9a9030(0x1cc)],'required':_0x5d9a43[_0x9a9030(0x212)]===!![]}))}))};}function summarizeLoadedManifest(_0x48ad11){const _0x4eca82=a62_0x389f55;return{'service':_0x48ad11[_0x4eca82(0x1ce)]?.['service'],'version':_0x48ad11[_0x4eca82(0x1ce)]?.[_0x4eca82(0x1f9)],'commandCount':_0x48ad11[_0x4eca82(0x1ce)]?.[_0x4eca82(0x213)][_0x4eca82(0x1d4)]??0x0,'commands':_0x48ad11[_0x4eca82(0x1ce)]?.['commands'][_0x4eca82(0x1f5)](_0x1bddcc=>({'path':_0x1bddcc[_0x4eca82(0x215)],'risk':_0x1bddcc[_0x4eca82(0x20d)],'target':toPublicServiceTreeTarget(_0x1bddcc[_0x4eca82(0x1cd)])}))??[],'registryIndex':_0x48ad11[_0x4eca82(0x1db)],'registryServiceCode':_0x48ad11['registryServiceCode'],'errors':_0x48ad11[_0x4eca82(0x1fe)]['errors'],'warnings':_0x48ad11['report'][_0x4eca82(0x1d8)]};}function a62_0x1e6b(){const _0x4b495e=['kind','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk','list','cliName','import','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','required','commands','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','cliPath','updated','lower\x20kebab-case\x20service\x20code','5781385NgEnEq','Updated','type','target','normalizedManifest','3281202BpYGNV','entry','serviceCount','6FUytAy','manifests','length','209111MNqoRD','408246kxNdJc','registry','warnings','str','serviceCode','registryIndex','\x20service(s).','8TDLHfV','validate','description','Local\x20service\x20code,\x20for\x20example\x20crm','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','3316841himAeC','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','2620692VdueOu','Imported\x20','Removed\x20service\x20','registryPath','Service\x20manifest\x20validation\x20passed.','WRITE','flags','318qQWIPw','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','hash','name','source','filePath','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','remove','entries','map','Exported\x20service\x20','read','Service\x20Tree\x20manifest\x20file\x20path','version','service','14655285uzpxlk','Local\x20service\x20not\x20found:\x20','Writes\x20the\x20local\x20Service\x20Tree\x20manifest\x20for\x20the\x20given\x20service\x20to\x20a\x20JSON\x20file.\x20An\x20existing\x20file\x20at\x20the\x20target\x20may\x20be\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','report','write','reduce','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','Service\x20registry\x20validation\x20passed.','Reads\x20the\x20given\x20manifest\x20into\x20the\x20local\x20Service\x20Tree\x20registry.\x20An\x20existing\x20manifest\x20with\x20the\x20same\x20service\x20code\x20is\x20updated.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','90SVxGha','errors','string','\x20service(s),\x20updated\x20','file','detail','imported'];a62_0x1e6b=function(){return _0x4b495e;};return a62_0x1e6b();}export const serviceDefinitions=[{'service':a62_0x389f55(0x1fa),'command':a62_0x389f55(0x1de),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a62_0x389f55(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x5e894e){const _0x300588=a62_0x389f55,_0x1a82e1=loadServiceManifestFromFile(_0x5e894e[_0x300588(0x1d9)](_0x300588(0x208)));if(!_0x1a82e1[_0x300588(0x1fe)]['ok'])return{'ok':![],'data':{'file':_0x1a82e1['filePath'],'hash':_0x1a82e1['hash'],'kind':_0x1a82e1['kind'],'serviceCount':_0x1a82e1[_0x300588(0x1d3)]['length'],'services':_0x1a82e1['manifests'][_0x300588(0x1f5)](summarizeLoadedManifest),'errors':_0x1a82e1[_0x300588(0x1fe)]['errors'],'warnings':_0x1a82e1[_0x300588(0x1fe)][_0x300588(0x1d8)]},'message':formatValidationFailure(_0x1a82e1[_0x300588(0x1fe)])};if(_0x1a82e1['kind']===_0x300588(0x1d7)||_0x1a82e1['manifests'][_0x300588(0x1d4)]!==0x1)return{'ok':!![],'data':{'file':_0x1a82e1[_0x300588(0x1f1)],'hash':_0x1a82e1[_0x300588(0x1ee)],'kind':_0x1a82e1[_0x300588(0x20b)],'serviceCount':_0x1a82e1['manifests']['length'],'commandCount':_0x1a82e1[_0x300588(0x1d3)][_0x300588(0x200)]((_0x7b10c9,_0x1e5ff9)=>_0x7b10c9+(_0x1e5ff9[_0x300588(0x1ce)]?.[_0x300588(0x213)][_0x300588(0x1d4)]??0x0),0x0),'services':_0x1a82e1[_0x300588(0x1d3)][_0x300588(0x1f5)](summarizeLoadedManifest),'warnings':_0x1a82e1[_0x300588(0x1fe)][_0x300588(0x1d8)]},'message':_0x300588(0x202)};return{'ok':!![],'data':{'file':_0x1a82e1[_0x300588(0x1f1)],'hash':_0x1a82e1[_0x300588(0x1ee)],'kind':_0x1a82e1[_0x300588(0x20b)],'service':_0x1a82e1[_0x300588(0x1ce)]?.[_0x300588(0x1fa)],'version':_0x1a82e1[_0x300588(0x1ce)]?.[_0x300588(0x1f9)],'commandCount':_0x1a82e1[_0x300588(0x1ce)]?.[_0x300588(0x213)]['length']??0x0,'commands':_0x1a82e1[_0x300588(0x1ce)]?.[_0x300588(0x213)][_0x300588(0x1f5)](_0x203d60=>({'path':_0x203d60[_0x300588(0x215)],'risk':_0x203d60[_0x300588(0x20d)],'target':toPublicServiceTreeTarget(_0x203d60[_0x300588(0x1cd)])})),'warnings':_0x1a82e1[_0x300588(0x1fe)][_0x300588(0x1d8)]},'message':_0x300588(0x1e8)};}},{'service':'service','command':a62_0x389f55(0x210),'description':a62_0x389f55(0x20c),'risk':a62_0x389f55(0x1ff),'confirmationDescription':a62_0x389f55(0x203),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x224123){const _0x4b2d28=a62_0x389f55,_0x1e3a91=loadServiceManifestFromFile(_0x224123[_0x4b2d28(0x1d9)](_0x4b2d28(0x208)));return{'method':_0x4b2d28(0x1e9),'url':getServiceRegistryPath(),'body':{'file':_0x1e3a91['filePath'],'hash':_0x1e3a91[_0x4b2d28(0x1ee)],'kind':_0x1e3a91[_0x4b2d28(0x20b)],'ok':_0x1e3a91[_0x4b2d28(0x1fe)]['ok'],'service':_0x1e3a91[_0x4b2d28(0x1ce)]?.[_0x4b2d28(0x1fa)],'version':_0x1e3a91[_0x4b2d28(0x1ce)]?.[_0x4b2d28(0x1f9)],'serviceCount':_0x1e3a91[_0x4b2d28(0x1d3)][_0x4b2d28(0x1d4)],'services':_0x1e3a91['manifests'][_0x4b2d28(0x1f5)](_0x33d9d3=>({'service':_0x33d9d3[_0x4b2d28(0x1ce)]?.[_0x4b2d28(0x1fa)],'version':_0x33d9d3[_0x4b2d28(0x1ce)]?.[_0x4b2d28(0x1f9)],'commandCount':_0x33d9d3[_0x4b2d28(0x1ce)]?.[_0x4b2d28(0x213)][_0x4b2d28(0x1d4)]??0x0,'errors':_0x33d9d3[_0x4b2d28(0x1fe)][_0x4b2d28(0x205)]})),'errors':_0x1e3a91[_0x4b2d28(0x1fe)]['errors'],'commandCount':_0x1e3a91[_0x4b2d28(0x1ce)]?.[_0x4b2d28(0x213)]['length']??0x0},'description':_0x4b2d28(0x1e3)};},async 'execute'(_0x396904){const _0x186c3a=a62_0x389f55,_0x592e0b=importServiceManifest(_0x396904['str']('file'));if(_0x592e0b[_0x186c3a(0x1f4)][_0x186c3a(0x1d4)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x592e0b['registryPath'],'imported':_0x592e0b[_0x186c3a(0x20a)],'updated':_0x592e0b[_0x186c3a(0x216)],'serviceCount':_0x592e0b[_0x186c3a(0x1d1)],'services':_0x592e0b['entries'][_0x186c3a(0x1f5)](summarizeService)},'message':_0x186c3a(0x1e5)+_0x592e0b[_0x186c3a(0x20a)]+_0x186c3a(0x207)+_0x592e0b[_0x186c3a(0x216)]+_0x186c3a(0x1dc)};return{'ok':!![],'data':{'registryPath':_0x592e0b[_0x186c3a(0x1e7)],'replaced':_0x592e0b['replaced'],'imported':_0x592e0b[_0x186c3a(0x20a)],'updated':_0x592e0b[_0x186c3a(0x216)],'serviceCount':_0x592e0b['serviceCount'],'service':summarizeService(_0x592e0b[_0x186c3a(0x1d0)])},'message':(_0x592e0b['replaced']?_0x186c3a(0x1cb):'Imported')+'\x20service\x20'+_0x592e0b[_0x186c3a(0x1d0)][_0x186c3a(0x1da)]+'.'};}},{'service':a62_0x389f55(0x1fa),'command':'export','description':a62_0x389f55(0x1e1),'risk':a62_0x389f55(0x1ff),'confirmationDescription':a62_0x389f55(0x1fd),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x41ea5f){const _0x405697=a62_0x389f55,_0x2a71b7=getLocalServiceEntry(_0x41ea5f[_0x405697(0x1d9)](_0x405697(0x1fa)));return{'method':_0x405697(0x1e9),'url':_0x41ea5f[_0x405697(0x1d9)]('file'),'body':{'service':_0x41ea5f[_0x405697(0x1d9)]('service'),'found':Boolean(_0x2a71b7),'version':_0x2a71b7?.[_0x405697(0x1f9)],'source':_0x2a71b7?.['source']},'description':_0x405697(0x1ed)};},async 'execute'(_0x10e12c){const _0x1e18a7=a62_0x389f55,_0x1c72d1=exportServiceManifest(_0x10e12c[_0x1e18a7(0x1d9)](_0x1e18a7(0x1fa)),_0x10e12c[_0x1e18a7(0x1d9)](_0x1e18a7(0x208)));return{'ok':!![],'data':{'registryPath':_0x1c72d1[_0x1e18a7(0x1e7)],'file':_0x1c72d1['filePath'],'service':summarizeService(_0x1c72d1['entry'])},'message':_0x1e18a7(0x1f6)+_0x1c72d1[_0x1e18a7(0x1d0)][_0x1e18a7(0x1da)]+'.'};}},{'service':a62_0x389f55(0x1fa),'command':a62_0x389f55(0x20e),'description':a62_0x389f55(0x1ec),'risk':a62_0x389f55(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0xc1eb19=a62_0x389f55,_0x225436=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x225436[_0xc1eb19(0x1d4)],'services':_0x225436['map'](summarizeService)}};}},{'service':a62_0x389f55(0x1fa),'command':a62_0x389f55(0x1f3),'description':a62_0x389f55(0x201),'risk':a62_0x389f55(0x1ff),'confirmationDescription':a62_0x389f55(0x214),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x5cd1bd){const _0x1bca05=a62_0x389f55,_0x3b5331=getLocalServiceEntry(_0x5cd1bd['str']('service'));return{'method':_0x1bca05(0x1e9),'url':getServiceRegistryPath(),'body':{'service':_0x5cd1bd[_0x1bca05(0x1d9)]('service'),'found':Boolean(_0x3b5331),'version':_0x3b5331?.[_0x1bca05(0x1f9)],'source':_0x3b5331?.[_0x1bca05(0x1f0)]},'description':_0x1bca05(0x211)};},async 'execute'(_0x280b60){const _0x58f409=a62_0x389f55,_0x2fd19f=removeServiceManifest(_0x280b60[_0x58f409(0x1d9)]('service'));return{'ok':!![],'data':{'registryPath':_0x2fd19f[_0x58f409(0x1e7)],'serviceCount':_0x2fd19f[_0x58f409(0x1d1)],'service':summarizeService(_0x2fd19f[_0x58f409(0x1d0)])},'message':_0x58f409(0x1e6)+_0x2fd19f['entry'][_0x58f409(0x1da)]+'.'};}},{'service':a62_0x389f55(0x1fa),'command':a62_0x389f55(0x209),'description':a62_0x389f55(0x1f2),'risk':a62_0x389f55(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x23ebac){const _0x47c3f7=a62_0x389f55,_0x32e7ee=getLocalServiceEntry(_0x23ebac[_0x47c3f7(0x1d9)](_0x47c3f7(0x1fa)));if(!_0x32e7ee)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x23ebac[_0x47c3f7(0x1d9)]('service')},'message':_0x47c3f7(0x1fc)+_0x23ebac['str'](_0x47c3f7(0x1fa))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x32e7ee),'manifest':_0x32e7ee['manifest'],'normalizedManifest':toPublicNormalizedServiceTree(_0x32e7ee['normalizedManifest'])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a63_0xb19b1f=a63_0x511b;(function(_0x59ff48,_0xed8fec){const _0x3a2800=a63_0x511b,_0x4144ee=_0x59ff48();while(!![]){try{const _0x171222=parseInt(_0x3a2800(0x110))/0x1*(parseInt(_0x3a2800(0x109))/0x2)+parseInt(_0x3a2800(0xe3))/0x3+parseInt(_0x3a2800(0xea))/0x4+-parseInt(_0x3a2800(0x107))/0x5*(parseInt(_0x3a2800(0x101))/0x6)+parseInt(_0x3a2800(0x100))/0x7+parseInt(_0x3a2800(0xeb))/0x8+-parseInt(_0x3a2800(0xf6))/0x9;if(_0x171222===_0xed8fec)break;else _0x4144ee['push'](_0x4144ee['shift']());}catch(_0x20a74d){_0x4144ee['push'](_0x4144ee['shift']());}}}(a63_0xb60a,0xc407d));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';function a63_0x511b(_0x34b6d0,_0xcf3843){_0x34b6d0=_0x34b6d0-0xe1;const _0xb60aba=a63_0xb60a();let _0x511bbd=_0xb60aba[_0x34b6d0];return _0x511bbd;}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=a63_0xb19b1f(0xf9);function a63_0xb60a(){const _0x501a87=['updatedAt','commands','manifest','homeDir','file','hex','version','schemaVersion','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','digest','cliPath','Service\x20manifest\x20validation\x20failed:\x0a','bff\x20target\x20requires\x20functionName.','serviceCode','trim','manifests','map','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','stringify','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','utf8','isArray','target','command','report','importedAt','Service\x20manifest\x20file\x20not\x20found:\x20','path','update','Unsupported\x20service\x20registry\x20schemaVersion:\x20','string','sha256','warnings','code','157158ItBPbs','message','$.services[','commandCount','flatMap','slice','normalizedManifest','3542652YzSgty','7404560wqtZEc','name','].manifest','registryIndex','parse','object','find','].manifest.','length','kind','Local\x20service\x20not\x20found:\x20','17419104wPHDKQ','toISOString','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','service.json','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','push','registry','service','services','errors','4225837zoRvhd','11208nKuZfx','description','startsWith','empty','now','services\x20must\x20be\x20an\x20array','155AKsuna','validation','219330sXHRpC','reduce','Invalid\x20service\x20registry\x20JSON:\x20','sort','Cannot\x20write\x20service\x20registry:\x20','invalid','risk','3rRhCEW'];a63_0xb60a=function(){return _0x501a87;};return a63_0xb60a();}export function getServiceRegistryPath(_0x328734={}){const _0x4c100c=a63_0xb19b1f;return resolve(_0x328734[_0x4c100c(0x114)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x54e307={}){const _0x3cbc29=a63_0xb19b1f,_0x4449ea=getServiceRegistryPath(_0x54e307);if(!existsSync(_0x4449ea))return emptyServiceRegistry();try{const _0x47c601=readFileSync(_0x4449ea,_0x3cbc29(0x125));if(!_0x47c601[_0x3cbc29(0x11f)]())return emptyServiceRegistry();const _0x5120d3=JSON['parse'](_0x47c601);if(_0x5120d3[_0x3cbc29(0x118)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x3cbc29(0x108)](_0x3cbc29(0x12e)+String(_0x5120d3[_0x3cbc29(0x118)]),'Remove\x20or\x20migrate\x20'+_0x4449ea+'.');if(!Array[_0x3cbc29(0x126)](_0x5120d3[_0x3cbc29(0xfe)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5120d3['updatedAt'],'services':_0x5120d3[_0x3cbc29(0xfe)]};}catch(_0x456f10){if(_0x456f10 instanceof Error&&_0x456f10['name']==='CliError')throw _0x456f10;throw CliErrors[_0x3cbc29(0x108)](_0x3cbc29(0x10b)+_0x4449ea,_0x3cbc29(0x119));}}export function writeServiceRegistry(_0x52b5a7,_0x5927b2={}){const _0x2bf497=a63_0xb19b1f,_0x2d9b12=getServiceRegistryPath(_0x5927b2),_0x5aaece=dirname(_0x2d9b12);!existsSync(_0x5aaece)&&mkdirSync(_0x5aaece,{'recursive':!![]});const _0xd58679=_0x2d9b12+'.tmp';try{writeFileSync(_0xd58679,JSON['stringify'](_0x52b5a7,null,0x2)+'\x0a',{'encoding':_0x2bf497(0x125),'mode':0x180}),renameSync(_0xd58679,_0x2d9b12);}catch(_0x49e538){try{unlinkSync(_0xd58679);}catch{}if(_0x49e538?.[_0x2bf497(0xe2)]==='ENOENT')throw CliErrors[_0x2bf497(0x108)](_0x2bf497(0x10d)+_0x2d9b12);throw _0x49e538;}return _0x2d9b12;}export function loadServiceManifestFromFile(_0x133b17){const _0x3b003f=a63_0xb19b1f,_0x254d2a=resolve(_0x133b17);if(!existsSync(_0x254d2a))throw CliErrors[_0x3b003f(0x108)](_0x3b003f(0x12b)+_0x133b17);let _0x1896bd;const _0x3887a9=readFileSync(_0x254d2a,_0x3b003f(0x125));try{_0x1896bd=JSON[_0x3b003f(0xef)](_0x3887a9);}catch{throw CliErrors[_0x3b003f(0x108)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x133b17,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x5698d2=sha256(_0x3887a9),_0xf0dc4f=extractLoadedServiceManifests(_0x1896bd,_0x5698d2),_0x13360a=aggregateValidationReports(_0xf0dc4f),_0x40442b=_0xf0dc4f[0x0];return{'filePath':_0x254d2a,'hash':_0x5698d2,'kind':isServiceRegistryLike(_0x1896bd)?_0x3b003f(0xfc):_0x3b003f(0x113),'manifest':_0x40442b?.['manifest']??_0x1896bd,'report':_0x13360a,'normalizedManifest':_0xf0dc4f[_0x3b003f(0xf3)]===0x1?_0x40442b?.[_0x3b003f(0xe9)]:undefined,'manifests':_0xf0dc4f};}export function importServiceManifest(_0x33088a,_0x17a631={}){const _0x2b545b=a63_0xb19b1f,_0x5180b8=loadServiceManifestFromFile(_0x33088a);if(!_0x5180b8[_0x2b545b(0x129)]['ok'])throw CliErrors[_0x2b545b(0x108)](formatValidationFailure(_0x5180b8[_0x2b545b(0x129)]),_0x2b545b(0x122));if(_0x5180b8['manifests']['length']===0x0)throw CliErrors[_0x2b545b(0x108)](_0x2b545b(0x124),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x373fae=readServiceRegistry(_0x17a631),_0x1f93d2=(_0x17a631[_0x2b545b(0x105)]??(()=>new Date()))()[_0x2b545b(0xf7)](),_0x2e0647=[];let _0x50b059=0x0,_0x1c71c7=0x0;for(const _0x441de2 of _0x5180b8[_0x2b545b(0x120)]){if(!_0x441de2[_0x2b545b(0xe9)])continue;const _0x3ced7e=_0x441de2[_0x2b545b(0xe9)][_0x2b545b(0xfd)]['code'],_0x246ece={'serviceCode':_0x3ced7e,'version':_0x441de2['normalizedManifest'][_0x2b545b(0x117)],'importedAt':_0x1f93d2,'source':{'type':_0x2b545b(0x115),'path':_0x5180b8['filePath'],'hash':_0x441de2['sourceHash']},'manifest':_0x441de2[_0x2b545b(0x113)],'normalizedManifest':_0x441de2[_0x2b545b(0xe9)]},_0x4c4978=_0x373fae[_0x2b545b(0xfe)]['findIndex'](_0x34ea98=>_0x34ea98[_0x2b545b(0x11e)]===_0x3ced7e);_0x4c4978>=0x0?(_0x373fae[_0x2b545b(0xfe)][_0x4c4978]=_0x246ece,_0x1c71c7++):(_0x373fae['services'][_0x2b545b(0xfb)](_0x246ece),_0x50b059++),_0x2e0647[_0x2b545b(0xfb)](_0x246ece);}_0x373fae[_0x2b545b(0xfe)][_0x2b545b(0x10c)]((_0x4b938d,_0x50fd05)=>_0x4b938d[_0x2b545b(0x11e)]['localeCompare'](_0x50fd05[_0x2b545b(0x11e)])),_0x373fae[_0x2b545b(0x111)]=_0x1f93d2;const _0x242a78=writeServiceRegistry(_0x373fae,_0x17a631);return{'registryPath':_0x242a78,'entry':_0x2e0647[0x0],'replaced':_0x2e0647[_0x2b545b(0xf3)]===0x1?_0x1c71c7===0x1:_0x1c71c7>0x0,'entries':_0x2e0647,'imported':_0x50b059,'updated':_0x1c71c7,'serviceCount':_0x373fae[_0x2b545b(0xfe)][_0x2b545b(0xf3)]};}export function exportServiceManifest(_0x29a25e,_0x563f45,_0x35bcfb={}){const _0x1138fd=a63_0xb19b1f,_0xd0a34=getServiceRegistryPath(_0x35bcfb),_0x2fa4ba=getLocalServiceEntry(_0x29a25e,_0x35bcfb);if(!_0x2fa4ba)throw CliErrors['validation'](_0x1138fd(0xf5)+_0x29a25e,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x45bb12=resolve(_0x563f45),_0x83923f=dirname(_0x45bb12);return!existsSync(_0x83923f)&&mkdirSync(_0x83923f,{'recursive':!![]}),writeFileSync(_0x45bb12,JSON[_0x1138fd(0x123)](_0x2fa4ba['manifest'],null,0x2)+'\x0a',{'encoding':_0x1138fd(0x125),'mode':0x180}),{'registryPath':_0xd0a34,'filePath':_0x45bb12,'entry':_0x2fa4ba};}export function removeServiceManifest(_0x165854,_0x4591f8={}){const _0x1f70be=a63_0xb19b1f,_0x4f7744=readServiceRegistry(_0x4591f8),_0x12c4da=_0x165854[_0x1f70be(0x11f)](),_0x527e9b=_0x4f7744[_0x1f70be(0xfe)]['findIndex'](_0x133500=>_0x133500['serviceCode']===_0x12c4da);if(_0x527e9b<0x0)throw CliErrors[_0x1f70be(0x108)](_0x1f70be(0xf5)+_0x12c4da,_0x1f70be(0xf8));const [_0x17d8c1]=_0x4f7744[_0x1f70be(0xfe)]['splice'](_0x527e9b,0x1),_0x4f5a8f=(_0x4591f8[_0x1f70be(0x105)]??(()=>new Date()))()['toISOString']();_0x4f7744[_0x1f70be(0x111)]=_0x4f5a8f;const _0x4c4015=writeServiceRegistry(_0x4f7744,_0x4591f8);return{'registryPath':_0x4c4015,'entry':_0x17d8c1,'serviceCount':_0x4f7744[_0x1f70be(0xfe)]['length']};}export function listLocalServices(_0x4c10d7={}){const _0x3c91d1=a63_0xb19b1f;return readServiceRegistry(_0x4c10d7)[_0x3c91d1(0xfe)];}export function getLocalServiceEntry(_0xac7442,_0x583969={}){const _0xaa5bfc=a63_0xb19b1f;return readServiceRegistry(_0x583969)[_0xaa5bfc(0xfe)][_0xaa5bfc(0xf1)](_0x4ad2bb=>_0x4ad2bb[_0xaa5bfc(0x11e)]===_0xac7442[_0xaa5bfc(0x11f)]());}export function listLocalServiceTrees(_0x515b86={}){const _0x979b34=a63_0xb19b1f;return readServiceRegistry(_0x515b86)[_0x979b34(0xfe)]['map'](_0x3bbe54=>_0x3bbe54[_0x979b34(0xe9)]);}export function inspectServiceRegistry(_0x33cad2={}){const _0x164d58=a63_0xb19b1f,_0x1e611f=getServiceRegistryPath(_0x33cad2);if(!existsSync(_0x1e611f))return emptyServiceRegistryInspection(_0x1e611f,'missing',![]);try{const _0x407c5f=readFileSync(_0x1e611f,'utf8');if(!_0x407c5f['trim']())return emptyServiceRegistryInspection(_0x1e611f,_0x164d58(0x104),!![]);const _0xf59a2d=JSON[_0x164d58(0xef)](_0x407c5f);if(_0xf59a2d[_0x164d58(0x118)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1e611f,_0x164d58(0x10e),!![]),'schemaVersion':_0xf59a2d[_0x164d58(0x118)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0xf59a2d[_0x164d58(0x118)])};if(!Array[_0x164d58(0x126)](_0xf59a2d[_0x164d58(0xfe)]))return{...emptyServiceRegistryInspection(_0x1e611f,_0x164d58(0x10e),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0xf59a2d[_0x164d58(0x111)],'message':_0x164d58(0x106)};const _0x3cec06=_0xf59a2d[_0x164d58(0xfe)][_0x164d58(0x121)](summarizeLocalServiceEntry);return{'registryPath':_0x1e611f,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0xf59a2d[_0x164d58(0x111)],'serviceCount':_0x3cec06[_0x164d58(0xf3)],'commandCount':_0x3cec06[_0x164d58(0x10a)]((_0x148071,_0xc2b1ff)=>_0x148071+_0xc2b1ff[_0x164d58(0xe6)],0x0),'services':_0x3cec06};}catch(_0x4544f8){return{...emptyServiceRegistryInspection(_0x1e611f,_0x164d58(0x10e),!![]),'message':_0x4544f8 instanceof Error?_0x4544f8[_0x164d58(0xe4)]:String(_0x4544f8)};}}export function formatValidationFailure(_0x120b1a){const _0x41ef08=a63_0xb19b1f,_0x41865b=_0x120b1a['errors'][_0x41ef08(0x121)](_0x5e7c3c=>_0x5e7c3c[_0x41ef08(0x12c)]+':\x20'+_0x5e7c3c[_0x41ef08(0xe4)]);return _0x41ef08(0x11c)+_0x41865b['join']('\x0a');}function extractLoadedServiceManifests(_0x1a19d8,_0x92b1c7){const _0x334dd0=a63_0xb19b1f;if(!isServiceRegistryLike(_0x1a19d8)){const _0x3fac32=_0x1a19d8,{manifest:_0x49bae3,errors:_0x7ef477}=adaptServiceTreeManifestForLegacyFramework(_0x3fac32),_0x3592c2=validateServiceTreeManifest(_0x49bae3),_0x447ae0=mergeValidationErrors(_0x3592c2,_0x7ef477);return[{'manifest':_0x3fac32,'report':_0x447ae0,'normalizedManifest':_0x447ae0['ok']?normalizeServiceTreeManifest(_0x49bae3):undefined,'sourceHash':_0x92b1c7}];}return _0x1a19d8[_0x334dd0(0xfe)][_0x334dd0(0x121)]((_0x2ebedb,_0xbf77fc)=>{const _0x442312=_0x334dd0,_0x40e9bc=isObjectRecord(_0x2ebedb)?_0x2ebedb[_0x442312(0x113)]:undefined,{manifest:_0x388dd5,errors:_0x2a906d}=adaptServiceTreeManifestForLegacyFramework(_0x40e9bc),_0x5ab9e1=validateServiceTreeManifest(_0x388dd5),_0x4fc3a3=mergeValidationErrors(_0x5ab9e1,_0x2a906d),_0x1fed92=isObjectRecord(_0x2ebedb)&&typeof _0x2ebedb[_0x442312(0x11e)]===_0x442312(0x12f)?_0x2ebedb[_0x442312(0x11e)]:undefined;return{'manifest':_0x40e9bc,'report':_0x4fc3a3,'normalizedManifest':_0x4fc3a3['ok']?normalizeServiceTreeManifest(_0x388dd5):undefined,'sourceHash':sha256(JSON[_0x442312(0x123)](_0x40e9bc,null,0x2)+'\x0a'),'registryIndex':_0xbf77fc,'registryServiceCode':_0x1fed92};});}function mergeValidationErrors(_0x4d1964,_0x11bd04){const _0x8f057b=a63_0xb19b1f,_0x2918ca=_0x4d1964[_0x8f057b(0xff)][_0x8f057b(0x121)](_0x404633=>_0x404633[_0x8f057b(0xe4)]===_0x8f057b(0xfa)?{..._0x404633,'message':_0x8f057b(0x11d)}:_0x404633),_0x30688b=[..._0x11bd04,..._0x2918ca];return{'ok':_0x30688b[_0x8f057b(0xf3)]===0x0,'errors':_0x30688b,'warnings':_0x4d1964[_0x8f057b(0xe1)]};}function aggregateValidationReports(_0x512702){const _0x4e9b3f=a63_0xb19b1f,_0x266959=_0x512702[_0x4e9b3f(0xe7)](_0x4b49a7=>_0x4b49a7[_0x4e9b3f(0xee)]===undefined?_0x4b49a7[_0x4e9b3f(0x129)][_0x4e9b3f(0xff)]:_0x4b49a7[_0x4e9b3f(0x129)][_0x4e9b3f(0xff)][_0x4e9b3f(0x121)](_0x552b0f=>({..._0x552b0f,'path':prefixRegistryIssuePath(_0x4b49a7[_0x4e9b3f(0xee)],_0x552b0f[_0x4e9b3f(0x12c)])}))),_0x279313=_0x512702['flatMap'](_0x2bdc96=>_0x2bdc96[_0x4e9b3f(0xee)]===undefined?_0x2bdc96[_0x4e9b3f(0x129)][_0x4e9b3f(0xe1)]:_0x2bdc96['report'][_0x4e9b3f(0xe1)][_0x4e9b3f(0x121)](_0x24c4cb=>({..._0x24c4cb,'path':prefixRegistryIssuePath(_0x2bdc96[_0x4e9b3f(0xee)],_0x24c4cb['path'])})));return{'ok':_0x266959[_0x4e9b3f(0xf3)]===0x0,'errors':_0x266959,'warnings':_0x279313};}function prefixRegistryIssuePath(_0x594791,_0x453872){const _0x560d67=a63_0xb19b1f;if(_0x453872==='$')return _0x560d67(0xe5)+_0x594791+_0x560d67(0xed);if(_0x453872[_0x560d67(0x103)]('$.'))return _0x560d67(0xe5)+_0x594791+'].manifest'+_0x453872[_0x560d67(0xe8)](0x1);if(_0x453872['startsWith']('$['))return _0x560d67(0xe5)+_0x594791+_0x560d67(0xed)+_0x453872[_0x560d67(0xe8)](0x1);return _0x560d67(0xe5)+_0x594791+_0x560d67(0xf2)+_0x453872;}function isServiceRegistryLike(_0x3cb4d9){const _0x3d141a=a63_0xb19b1f;return isObjectRecord(_0x3cb4d9)&&_0x3cb4d9['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x3d141a(0x126)](_0x3cb4d9['services']);}function isObjectRecord(_0x267f67){const _0x7ba7a7=a63_0xb19b1f;return Boolean(_0x267f67)&&typeof _0x267f67===_0x7ba7a7(0xf0)&&!Array['isArray'](_0x267f67);}function emptyServiceRegistryInspection(_0x4fd620,_0x522fc2,_0x3f57fb){return{'registryPath':_0x4fd620,'exists':_0x3f57fb,'status':_0x522fc2,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x16e2ea){const _0x383ea5=a63_0xb19b1f,_0x274cf4=_0x16e2ea[_0x383ea5(0xe9)],_0x392d07=_0x274cf4[_0x383ea5(0x112)][_0x383ea5(0x121)](_0xdab20c=>({'path':_0xdab20c[_0x383ea5(0x11b)],'description':_0xdab20c[_0x383ea5(0x102)],'risk':_0xdab20c[_0x383ea5(0x10f)],'targetKind':_0xdab20c[_0x383ea5(0x127)][_0x383ea5(0xf4)],'targetCommand':_0xdab20c['target'][_0x383ea5(0x128)]}));return{'serviceCode':_0x16e2ea[_0x383ea5(0x11e)],'name':_0x274cf4[_0x383ea5(0xfd)][_0x383ea5(0xec)],'description':_0x274cf4[_0x383ea5(0xfd)][_0x383ea5(0x102)],'version':_0x16e2ea[_0x383ea5(0x117)],'importedAt':_0x16e2ea[_0x383ea5(0x12a)],'source':_0x16e2ea['source'],'commandCount':_0x392d07[_0x383ea5(0xf3)],'commands':_0x392d07};}function sha256(_0x152be4){const _0x50cd58=a63_0xb19b1f;return createHash(_0x50cd58(0x130))[_0x50cd58(0x12d)](_0x152be4)[_0x50cd58(0x11a)](_0x50cd58(0x116));}
|
|
1
|
+
const a63_0x1ca981=a63_0x5325;(function(_0xe5e079,_0x11adc4){const _0x44b6df=a63_0x5325,_0x271d3a=_0xe5e079();while(!![]){try{const _0x3f4098=parseInt(_0x44b6df(0x113))/0x1+parseInt(_0x44b6df(0xf4))/0x2*(parseInt(_0x44b6df(0x12f))/0x3)+-parseInt(_0x44b6df(0xf2))/0x4+parseInt(_0x44b6df(0x10e))/0x5*(-parseInt(_0x44b6df(0x106))/0x6)+parseInt(_0x44b6df(0x12a))/0x7+-parseInt(_0x44b6df(0x11d))/0x8+-parseInt(_0x44b6df(0xfb))/0x9;if(_0x3f4098===_0x11adc4)break;else _0x271d3a['push'](_0x271d3a['shift']());}catch(_0x113156){_0x271d3a['push'](_0x271d3a['shift']());}}}(a63_0x751d,0x9d7de));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';function a63_0x5325(_0x1434e2,_0x520d48){_0x1434e2=_0x1434e2-0xe3;const _0x751d19=a63_0x751d();let _0x532583=_0x751d19[_0x1434e2];return _0x532583;}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=a63_0x1ca981(0x105);export function getServiceRegistryPath(_0x1b8280={}){const _0x2837d5=a63_0x1ca981;return resolve(_0x1b8280['homeDir']??homedir(),PRODUCT_CONFIG[_0x2837d5(0xe6)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x2cc6e3={}){const _0x49ea27=a63_0x1ca981,_0xb355f=getServiceRegistryPath(_0x2cc6e3);if(!existsSync(_0xb355f))return emptyServiceRegistry();try{const _0x4838f2=readFileSync(_0xb355f,_0x49ea27(0x11f));if(!_0x4838f2['trim']())return emptyServiceRegistry();const _0x3fb753=JSON[_0x49ea27(0x116)](_0x4838f2);if(_0x3fb753['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x49ea27(0xee)](_0x49ea27(0xf1)+String(_0x3fb753[_0x49ea27(0xe4)]),_0x49ea27(0x104)+_0xb355f+'.');if(!Array[_0x49ea27(0x139)](_0x3fb753['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3fb753[_0x49ea27(0x128)],'services':_0x3fb753[_0x49ea27(0x107)]};}catch(_0x4d45ba){if(_0x4d45ba instanceof Error&&_0x4d45ba[_0x49ea27(0x11c)]===_0x49ea27(0x126))throw _0x4d45ba;throw CliErrors[_0x49ea27(0xee)](_0x49ea27(0xf8)+_0xb355f,_0x49ea27(0xf0));}}export function writeServiceRegistry(_0x55958e,_0x17af37={}){const _0x4e55ab=a63_0x1ca981,_0x26f4a1=getServiceRegistryPath(_0x17af37),_0x3b645a=dirname(_0x26f4a1);!existsSync(_0x3b645a)&&mkdirSync(_0x3b645a,{'recursive':!![]});const _0x513636=_0x26f4a1+_0x4e55ab(0xf7);try{writeFileSync(_0x513636,JSON['stringify'](_0x55958e,null,0x2)+'\x0a',{'encoding':_0x4e55ab(0x11f),'mode':0x180}),renameSync(_0x513636,_0x26f4a1);}catch(_0x2e5b64){try{unlinkSync(_0x513636);}catch{}if(_0x2e5b64?.[_0x4e55ab(0x112)]===_0x4e55ab(0x132))throw CliErrors[_0x4e55ab(0xee)]('Cannot\x20write\x20service\x20registry:\x20'+_0x26f4a1);throw _0x2e5b64;}return _0x26f4a1;}export function loadServiceManifestFromFile(_0x4d5889){const _0x147ea2=a63_0x1ca981,_0x4fd4ac=resolve(_0x4d5889);if(!existsSync(_0x4fd4ac))throw CliErrors[_0x147ea2(0xee)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x4d5889);let _0x7a78d4;const _0x4c1dcf=readFileSync(_0x4fd4ac,_0x147ea2(0x11f));try{_0x7a78d4=JSON[_0x147ea2(0x116)](_0x4c1dcf);}catch{throw CliErrors[_0x147ea2(0xee)](_0x147ea2(0x122)+_0x4d5889,_0x147ea2(0x12e));}const _0x31b290=sha256(_0x4c1dcf),_0x1e733c=extractLoadedServiceManifests(_0x7a78d4,_0x31b290),_0x5f6c1f=aggregateValidationReports(_0x1e733c),_0x353a6d=_0x1e733c[0x0];return{'filePath':_0x4fd4ac,'hash':_0x31b290,'kind':isServiceRegistryLike(_0x7a78d4)?_0x147ea2(0xe9):_0x147ea2(0x102),'manifest':_0x353a6d?.[_0x147ea2(0x102)]??_0x7a78d4,'report':_0x5f6c1f,'normalizedManifest':_0x1e733c[_0x147ea2(0xe8)]===0x1?_0x353a6d?.[_0x147ea2(0x131)]:undefined,'manifests':_0x1e733c};}export function importServiceManifest(_0x1b8a12,_0x4563b5={}){const _0x1d1f6f=a63_0x1ca981,_0x4728da=loadServiceManifestFromFile(_0x1b8a12);if(!_0x4728da['report']['ok'])throw CliErrors[_0x1d1f6f(0xee)](formatValidationFailure(_0x4728da['report']),_0x1d1f6f(0x103));if(_0x4728da[_0x1d1f6f(0x10b)][_0x1d1f6f(0xe8)]===0x0)throw CliErrors[_0x1d1f6f(0xee)](_0x1d1f6f(0x121),_0x1d1f6f(0x12c));const _0x46d8ad=readServiceRegistry(_0x4563b5),_0x55beab=(_0x4563b5[_0x1d1f6f(0x133)]??(()=>new Date()))()['toISOString'](),_0x57b452=[];let _0x318999=0x0,_0x3d9923=0x0;for(const _0x5bb6e4 of _0x4728da[_0x1d1f6f(0x10b)]){if(!_0x5bb6e4[_0x1d1f6f(0x131)])continue;const _0x184d20=_0x5bb6e4[_0x1d1f6f(0x131)]['service']['code'],_0x2a36f0={'serviceCode':_0x184d20,'version':_0x5bb6e4[_0x1d1f6f(0x131)]['version'],'importedAt':_0x55beab,'source':{'type':_0x1d1f6f(0xe3),'path':_0x4728da[_0x1d1f6f(0xfd)],'hash':_0x5bb6e4[_0x1d1f6f(0xe7)]},'manifest':_0x5bb6e4['manifest'],'normalizedManifest':_0x5bb6e4[_0x1d1f6f(0x131)]},_0x23873b=_0x46d8ad[_0x1d1f6f(0x107)]['findIndex'](_0x9ec6aa=>_0x9ec6aa[_0x1d1f6f(0x11b)]===_0x184d20);_0x23873b>=0x0?(_0x46d8ad['services'][_0x23873b]=_0x2a36f0,_0x3d9923++):(_0x46d8ad['services'][_0x1d1f6f(0x12d)](_0x2a36f0),_0x318999++),_0x57b452[_0x1d1f6f(0x12d)](_0x2a36f0);}_0x46d8ad[_0x1d1f6f(0x107)][_0x1d1f6f(0x10c)]((_0x5695f9,_0x194281)=>_0x5695f9['serviceCode'][_0x1d1f6f(0x134)](_0x194281['serviceCode'])),_0x46d8ad[_0x1d1f6f(0x128)]=_0x55beab;const _0x5afdc7=writeServiceRegistry(_0x46d8ad,_0x4563b5);return{'registryPath':_0x5afdc7,'entry':_0x57b452[0x0],'replaced':_0x57b452['length']===0x1?_0x3d9923===0x1:_0x3d9923>0x0,'entries':_0x57b452,'imported':_0x318999,'updated':_0x3d9923,'serviceCount':_0x46d8ad[_0x1d1f6f(0x107)][_0x1d1f6f(0xe8)]};}export function exportServiceManifest(_0x526ca3,_0x343fe1,_0x2be160={}){const _0x5b67c1=a63_0x1ca981,_0x2fe87f=getServiceRegistryPath(_0x2be160),_0x45efae=getLocalServiceEntry(_0x526ca3,_0x2be160);if(!_0x45efae)throw CliErrors[_0x5b67c1(0xee)](_0x5b67c1(0xeb)+_0x526ca3,_0x5b67c1(0xf3));const _0x4feb35=resolve(_0x343fe1),_0x18021f=dirname(_0x4feb35);return!existsSync(_0x18021f)&&mkdirSync(_0x18021f,{'recursive':!![]}),writeFileSync(_0x4feb35,JSON['stringify'](_0x45efae[_0x5b67c1(0x102)],null,0x2)+'\x0a',{'encoding':_0x5b67c1(0x11f),'mode':0x180}),{'registryPath':_0x2fe87f,'filePath':_0x4feb35,'entry':_0x45efae};}export function removeServiceManifest(_0x46d7c4,_0x4599d6={}){const _0x20b364=a63_0x1ca981,_0x177227=readServiceRegistry(_0x4599d6),_0x452117=_0x46d7c4[_0x20b364(0x115)](),_0x5be6e8=_0x177227['services'][_0x20b364(0x110)](_0x74cf2e=>_0x74cf2e[_0x20b364(0x11b)]===_0x452117);if(_0x5be6e8<0x0)throw CliErrors[_0x20b364(0xee)](_0x20b364(0xeb)+_0x452117,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x31126e]=_0x177227[_0x20b364(0x107)][_0x20b364(0xed)](_0x5be6e8,0x1),_0x5bd0f6=(_0x4599d6['now']??(()=>new Date()))()[_0x20b364(0xff)]();_0x177227[_0x20b364(0x128)]=_0x5bd0f6;const _0x4dd03e=writeServiceRegistry(_0x177227,_0x4599d6);return{'registryPath':_0x4dd03e,'entry':_0x31126e,'serviceCount':_0x177227[_0x20b364(0x107)][_0x20b364(0xe8)]};}export function listLocalServices(_0x108a74={}){const _0x362713=a63_0x1ca981;return readServiceRegistry(_0x108a74)[_0x362713(0x107)];}export function getLocalServiceEntry(_0x5de976,_0x12f649={}){const _0x102c92=a63_0x1ca981;return readServiceRegistry(_0x12f649)[_0x102c92(0x107)][_0x102c92(0x13b)](_0x3ec7bd=>_0x3ec7bd[_0x102c92(0x11b)]===_0x5de976[_0x102c92(0x115)]());}export function listLocalServiceTrees(_0x37444c={}){const _0x11fd6a=a63_0x1ca981;return readServiceRegistry(_0x37444c)[_0x11fd6a(0x107)][_0x11fd6a(0xe5)](_0x1f2556=>_0x1f2556['normalizedManifest']);}export function inspectServiceRegistry(_0x57d338={}){const _0x59e52a=a63_0x1ca981,_0xa74418=getServiceRegistryPath(_0x57d338);if(!existsSync(_0xa74418))return emptyServiceRegistryInspection(_0xa74418,_0x59e52a(0xf6),![]);try{const _0x3ac222=readFileSync(_0xa74418,_0x59e52a(0x11f));if(!_0x3ac222[_0x59e52a(0x115)]())return emptyServiceRegistryInspection(_0xa74418,_0x59e52a(0x11e),!![]);const _0x5bccb2=JSON[_0x59e52a(0x116)](_0x3ac222);if(_0x5bccb2[_0x59e52a(0xe4)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0xa74418,_0x59e52a(0xfe),!![]),'schemaVersion':_0x5bccb2[_0x59e52a(0xe4)],'message':_0x59e52a(0x13c)+String(_0x5bccb2[_0x59e52a(0xe4)])};if(!Array[_0x59e52a(0x139)](_0x5bccb2['services']))return{...emptyServiceRegistryInspection(_0xa74418,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5bccb2[_0x59e52a(0x128)],'message':_0x59e52a(0x109)};const _0x136f57=_0x5bccb2['services'][_0x59e52a(0xe5)](summarizeLocalServiceEntry);return{'registryPath':_0xa74418,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5bccb2[_0x59e52a(0x128)],'serviceCount':_0x136f57[_0x59e52a(0xe8)],'commandCount':_0x136f57[_0x59e52a(0x118)]((_0x422dd5,_0x150ad1)=>_0x422dd5+_0x150ad1[_0x59e52a(0x100)],0x0),'services':_0x136f57};}catch(_0x5b3de0){return{...emptyServiceRegistryInspection(_0xa74418,_0x59e52a(0xfe),!![]),'message':_0x5b3de0 instanceof Error?_0x5b3de0[_0x59e52a(0x120)]:String(_0x5b3de0)};}}export function formatValidationFailure(_0xe32686){const _0x3a96a4=a63_0x1ca981,_0x2f920d=_0xe32686[_0x3a96a4(0x10f)]['map'](_0x541d26=>_0x541d26['path']+':\x20'+_0x541d26[_0x3a96a4(0x120)]);return _0x3a96a4(0x11a)+_0x2f920d[_0x3a96a4(0x129)]('\x0a');}function extractLoadedServiceManifests(_0x257efd,_0x1fd8a3){const _0x1d3cb4=a63_0x1ca981;if(!isServiceRegistryLike(_0x257efd)){const _0x425477=_0x257efd,{manifest:_0x4c69f3,errors:_0x462e9f}=adaptServiceTreeManifestForLegacyFramework(_0x425477),_0x5462f7=validateServiceTreeManifest(_0x4c69f3),_0x58019b=mergeValidationErrors(_0x5462f7,_0x462e9f);return[{'manifest':_0x425477,'report':_0x58019b,'normalizedManifest':_0x58019b['ok']?normalizeServiceTreeManifest(_0x4c69f3):undefined,'sourceHash':_0x1fd8a3}];}return _0x257efd[_0x1d3cb4(0x107)][_0x1d3cb4(0xe5)]((_0x54b050,_0x4f04ff)=>{const _0x5a5231=_0x1d3cb4,_0x3ef5f0=isObjectRecord(_0x54b050)?_0x54b050['manifest']:undefined,{manifest:_0x5e6b82,errors:_0x2a929c}=adaptServiceTreeManifestForLegacyFramework(_0x3ef5f0),_0x2d2f4c=validateServiceTreeManifest(_0x5e6b82),_0x3c7cc2=mergeValidationErrors(_0x2d2f4c,_0x2a929c),_0x51c966=isObjectRecord(_0x54b050)&&typeof _0x54b050[_0x5a5231(0x11b)]==='string'?_0x54b050[_0x5a5231(0x11b)]:undefined;return{'manifest':_0x3ef5f0,'report':_0x3c7cc2,'normalizedManifest':_0x3c7cc2['ok']?normalizeServiceTreeManifest(_0x5e6b82):undefined,'sourceHash':sha256(JSON[_0x5a5231(0x130)](_0x3ef5f0,null,0x2)+'\x0a'),'registryIndex':_0x4f04ff,'registryServiceCode':_0x51c966};});}function mergeValidationErrors(_0x40a104,_0x41e961){const _0x118233=a63_0x1ca981,_0x5a5529=_0x40a104[_0x118233(0x10f)][_0x118233(0xe5)](_0x5c47f4=>_0x5c47f4[_0x118233(0x120)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x5c47f4,'message':_0x118233(0x137)}:_0x5c47f4),_0x5778fb=[..._0x41e961,..._0x5a5529];return{'ok':_0x5778fb[_0x118233(0xe8)]===0x0,'errors':_0x5778fb,'warnings':_0x40a104[_0x118233(0xf9)]};}function aggregateValidationReports(_0x4420b0){const _0x1a1760=a63_0x1ca981,_0x56c4bc=_0x4420b0[_0x1a1760(0xfa)](_0x57d0cc=>_0x57d0cc['registryIndex']===undefined?_0x57d0cc[_0x1a1760(0x13a)][_0x1a1760(0x10f)]:_0x57d0cc[_0x1a1760(0x13a)][_0x1a1760(0x10f)][_0x1a1760(0xe5)](_0x53343a=>({..._0x53343a,'path':prefixRegistryIssuePath(_0x57d0cc['registryIndex'],_0x53343a[_0x1a1760(0x123)])}))),_0x421625=_0x4420b0[_0x1a1760(0xfa)](_0x2f423b=>_0x2f423b['registryIndex']===undefined?_0x2f423b['report']['warnings']:_0x2f423b[_0x1a1760(0x13a)]['warnings']['map'](_0xd9b2f9=>({..._0xd9b2f9,'path':prefixRegistryIssuePath(_0x2f423b[_0x1a1760(0xea)],_0xd9b2f9[_0x1a1760(0x123)])})));return{'ok':_0x56c4bc[_0x1a1760(0xe8)]===0x0,'errors':_0x56c4bc,'warnings':_0x421625};}function prefixRegistryIssuePath(_0x4009b2,_0x38d98f){const _0x18b7f8=a63_0x1ca981;if(_0x38d98f==='$')return _0x18b7f8(0x127)+_0x4009b2+_0x18b7f8(0x108);if(_0x38d98f['startsWith']('$.'))return _0x18b7f8(0x127)+_0x4009b2+_0x18b7f8(0x108)+_0x38d98f[_0x18b7f8(0xf5)](0x1);if(_0x38d98f[_0x18b7f8(0x101)]('$['))return _0x18b7f8(0x127)+_0x4009b2+_0x18b7f8(0x108)+_0x38d98f['slice'](0x1);return _0x18b7f8(0x127)+_0x4009b2+_0x18b7f8(0xec)+_0x38d98f;}function isServiceRegistryLike(_0x3fd1dd){return isObjectRecord(_0x3fd1dd)&&_0x3fd1dd['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x3fd1dd['services']);}function isObjectRecord(_0x3c9108){const _0x4f38f3=a63_0x1ca981;return Boolean(_0x3c9108)&&typeof _0x3c9108==='object'&&!Array[_0x4f38f3(0x139)](_0x3c9108);}function emptyServiceRegistryInspection(_0x337237,_0x5748d8,_0x2abdca){return{'registryPath':_0x337237,'exists':_0x2abdca,'status':_0x5748d8,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x1d01dc){const _0x351866=a63_0x1ca981,_0x26daab=_0x1d01dc['normalizedManifest'],_0x1122a8=_0x26daab[_0x351866(0x12b)]['map'](_0x50bd82=>({'path':_0x50bd82[_0x351866(0xef)],'description':_0x50bd82[_0x351866(0x124)],'risk':_0x50bd82[_0x351866(0x119)],'targetKind':_0x50bd82['target'][_0x351866(0x117)],'targetCommand':_0x50bd82[_0x351866(0x10a)][_0x351866(0x136)]}));return{'serviceCode':_0x1d01dc['serviceCode'],'name':_0x26daab['service']['name'],'description':_0x26daab[_0x351866(0x135)][_0x351866(0x124)],'version':_0x1d01dc[_0x351866(0x114)],'importedAt':_0x1d01dc[_0x351866(0x138)],'source':_0x1d01dc[_0x351866(0x111)],'commandCount':_0x1122a8[_0x351866(0xe8)],'commands':_0x1122a8};}function a63_0x751d(){const _0x39227f=['.tmp','Invalid\x20service\x20registry\x20JSON:\x20','warnings','flatMap','3890808FCtyFu','sha256','filePath','invalid','toISOString','commandCount','startsWith','manifest','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','Remove\x20or\x20migrate\x20','service.json','48fkQABT','services','].manifest','services\x20must\x20be\x20an\x20array','target','manifests','sort','hex','198355Saatkt','errors','findIndex','source','code','1161598HhSldn','version','trim','parse','kind','reduce','risk','Service\x20manifest\x20validation\x20failed:\x0a','serviceCode','name','8106328BwHRoW','empty','utf8','message','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Invalid\x20service\x20manifest\x20JSON:\x20','path','description','digest','CliError','$.services[','updatedAt','join','1140440WfcRZC','commands','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','push','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','6117vzrTFC','stringify','normalizedManifest','ENOENT','now','localeCompare','service','command','bff\x20target\x20requires\x20functionName.','importedAt','isArray','report','find','Unsupported\x20schemaVersion:\x20','file','schemaVersion','map','homeDirName','sourceHash','length','registry','registryIndex','Local\x20service\x20not\x20found:\x20','].manifest.','splice','validation','cliPath','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','Unsupported\x20service\x20registry\x20schemaVersion:\x20','257672UpcUuO','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','1126pngMJV','slice','missing'];a63_0x751d=function(){return _0x39227f;};return a63_0x751d();}function sha256(_0x39c728){const _0x1c3df3=a63_0x1ca981;return createHash(_0x1c3df3(0xfc))['update'](_0x39c728)[_0x1c3df3(0x125)](_0x1c3df3(0x10d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a64_0x283a04=a64_0x256f;function a64_0x256f(_0x270dc4,_0x5519d6){_0x270dc4=_0x270dc4-0x1cb;const _0x29c72f=a64_0x29c7();let _0x256fe2=_0x29c72f[_0x270dc4];return _0x256fe2;}(function(_0x58421c,_0x55dc00){const _0x58dc3d=a64_0x256f,_0x5d2504=_0x58421c();while(!![]){try{const _0x3b756b=-parseInt(_0x58dc3d(0x1d2))/0x1+-parseInt(_0x58dc3d(0x1e3))/0x2*(-parseInt(_0x58dc3d(0x1cc))/0x3)+parseInt(_0x58dc3d(0x1cb))/0x4*(-parseInt(_0x58dc3d(0x1db))/0x5)+parseInt(_0x58dc3d(0x1ed))/0x6*(parseInt(_0x58dc3d(0x1d4))/0x7)+parseInt(_0x58dc3d(0x1e5))/0x8*(-parseInt(_0x58dc3d(0x1dc))/0x9)+-parseInt(_0x58dc3d(0x1e2))/0xa+parseInt(_0x58dc3d(0x1de))/0xb;if(_0x3b756b===_0x55dc00)break;else _0x5d2504['push'](_0x5d2504['shift']());}catch(_0x570181){_0x5d2504['push'](_0x5d2504['shift']());}}}(a64_0x29c7,0x8921b));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a64_0x283a04(0x1d0),'command':a64_0x283a04(0x1ea),'description':'Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','risk':a64_0x283a04(0x1ec),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x5d7d9c){const _0x3a72f7=a64_0x283a04,_0x21536e=buildSkillCreatePlan(_0x5d7d9c[_0x3a72f7(0x1d9)](_0x3a72f7(0x1e1)),_0x5d7d9c['str'](_0x3a72f7(0x1d8)),_0x5d7d9c['str']('target'));return{'method':'WRITE','url':_0x21536e[_0x3a72f7(0x1df)],'body':{'skillName':_0x21536e[_0x3a72f7(0x1d3)][_0x3a72f7(0x1dd)],'type':_0x21536e[_0x3a72f7(0x1d3)][_0x3a72f7(0x1d8)],'selfContained':!![],'files':_0x21536e['rendered'][_0x3a72f7(0x1e9)][_0x3a72f7(0x1ee)](_0x178f01=>_0x178f01['path'])},'description':_0x3a72f7(0x1d6)};},async 'execute'(_0x3b7dd4){const _0x17bb33=a64_0x283a04,_0x527817=buildSkillCreatePlan(_0x3b7dd4[_0x17bb33(0x1d9)](_0x17bb33(0x1e1)),_0x3b7dd4[_0x17bb33(0x1d9)]('type'),_0x3b7dd4[_0x17bb33(0x1d9)](_0x17bb33(0x1cf)));return writeSkillDraft(_0x527817,_0x3b7dd4['bool'](_0x17bb33(0x1e4))),{'ok':!![],'data':{'skillName':_0x527817[_0x17bb33(0x1d3)]['skillName'],'type':_0x527817[_0x17bb33(0x1d3)]['type'],'dir':_0x527817[_0x17bb33(0x1df)],'files':_0x527817[_0x17bb33(0x1d3)][_0x17bb33(0x1e9)][_0x17bb33(0x1ee)](_0x49d6fe=>_0x49d6fe[_0x17bb33(0x1cd)])},'message':_0x17bb33(0x1e8)+_0x527817[_0x17bb33(0x1d3)][_0x17bb33(0x1dd)]};}};function buildSkillCreatePlan(_0x1b89f9,_0x2db5d1,_0x3bcba2){const _0x2294a7=a64_0x283a04,_0xcccd4a=_0x2db5d1[_0x2294a7(0x1ce)](),_0x4b20a5=renderSkillTemplate({'skillName':_0x1b89f9,'type':_0xcccd4a});!_0xcccd4a&&writeCliSideChannelLine(_0x2294a7(0x1eb));const _0x317a3b=resolve(normalizeSkillTarget(_0x3bcba2));return{'rendered':_0x4b20a5,'targetRoot':_0x317a3b,'skillDir':resolve(_0x317a3b,_0x4b20a5[_0x2294a7(0x1dd)])};}function normalizeSkillTarget(_0x3e5043){const _0x2c5619=a64_0x283a04;return(_0x3e5043||DEFAULT_SKILL_TARGET)[_0x2c5619(0x1ce)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x3b14ad,_0x2b396e){const _0x1a2833=a64_0x283a04;if(existsSync(_0x3b14ad[_0x1a2833(0x1df)])){const _0x1b24c6=lstatSync(_0x3b14ad['skillDir']);if(!_0x1b24c6[_0x1a2833(0x1e0)]()||_0x1b24c6[_0x1a2833(0x1da)]())throw CliErrors[_0x1a2833(0x1e7)](_0x1a2833(0x1e6)+_0x3b14ad[_0x1a2833(0x1df)]);if(!_0x2b396e)throw CliErrors[_0x1a2833(0x1e7)]('Skill\x20directory\x20already\x20exists:\x20'+_0x3b14ad[_0x1a2833(0x1df)],'Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.');}for(const _0x18659c of _0x3b14ad['rendered'][_0x1a2833(0x1e9)]){const _0xd88d87=resolve(_0x3b14ad[_0x1a2833(0x1df)],_0x18659c['path']),_0x2feda9=dirname(_0xd88d87);mkdirSync(_0x2feda9,{'recursive':!![]});if(existsSync(_0xd88d87)&&lstatSync(_0xd88d87)[_0x1a2833(0x1da)]())throw CliErrors[_0x1a2833(0x1e7)](_0x1a2833(0x1d5)+_0xd88d87);writeFileSync(_0xd88d87,_0x18659c[_0x1a2833(0x1d1)],_0x1a2833(0x1d7));}}function a64_0x29c7(){const _0x1e8605=['Created\x20local\x20Skill\x20draft\x20','files','create','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','read','12WPWjpY','map','8500igAfWi','993NZcUVe','path','trim','target','skill','content','786034WgjTse','rendered','1970213iQBCAB','Refusing\x20to\x20overwrite\x20symlink:\x20','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','utf8','type','str','isSymbolicLink','1685rzIyKF','1538442lTNDGg','skillName','27452425tgeXli','skillDir','isDirectory','name','7712700YjasJr','3814xjrepK','force','40WuVjpk','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','validation'];a64_0x29c7=function(){return _0x1e8605;};return a64_0x29c7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a65_0x2bd4(){const _0x3edaa0=['validation','4297675zaRTyd','write','diagram-show','Found\x20Skill\x20diagram\x20for\x20','20146940cBbFWm',';\x20first\x20write\x20expects\x20revision\x20','appCode','read','\x20is\x20unchanged.','6274380ndxqNQ','81mRFPYA','Created','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','skill','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','\x20Skill\x20diagram\x20for\x20','1941JkPLuO','scope','512816Jwkded','unchanged','Creates\x20or\x20replaces\x20a\x20Mermaid\x20diagram\x20for\x20an\x20exact\x20Skill\x20version.\x20The\x20write\x20is\x20rejected\x20if\x20the\x20server\x20version\x20has\x20changed.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20diagram\x20body.','trim','test','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','78dfKKMs','version','created','538uHTpdx','skill-code','expectedDiagramRevision','diagram-push',';\x20next\x20write\x20expects\x20revision\x20','20nMTmdl','str','diagram-validate','num','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','source-fingerprint','isInteger','776629YgvJGX','1484576sNeObo','skillCode','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','Create\x20or\x20replace\x20a\x20Mermaid\x20diagram\x20for\x20a\x20specific\x20Skill\x20version','action'];a65_0x2bd4=function(){return _0x3edaa0;};return a65_0x2bd4();}const a65_0x22e8e2=a65_0x3023;(function(_0x5ebbae,_0x44d412){const _0x476933=a65_0x3023,_0x5d5e19=_0x5ebbae();while(!![]){try{const _0x454a8f=-parseInt(_0x476933(0x1ec))/0x1+-parseInt(_0x476933(0x1df))/0x2*(-parseInt(_0x476933(0x1d4))/0x3)+-parseInt(_0x476933(0x1cd))/0x4+-parseInt(_0x476933(0x1f2))/0x5+-parseInt(_0x476933(0x1dc))/0x6*(-parseInt(_0x476933(0x1eb))/0x7)+-parseInt(_0x476933(0x1d6))/0x8*(parseInt(_0x476933(0x1ce))/0x9)+parseInt(_0x476933(0x1e4))/0xa*(parseInt(_0x476933(0x1c8))/0xb);if(_0x454a8f===_0x44d412)break;else _0x5d5e19['push'](_0x5d5e19['shift']());}catch(_0x45049e){_0x5d5e19['push'](_0x5d5e19['shift']());}}}(a65_0x2bd4,0xc0d32));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x369271){const _0x1ae6fd=a65_0x3023,_0x4ceeeb=_0x369271['str'](_0x1ae6fd(0x1e0))['trim'](),_0x6b09e7=_0x369271[_0x1ae6fd(0x1e5)](_0x1ae6fd(0x1dd))[_0x1ae6fd(0x1d9)](),_0x15bb36=_0x369271['str'](_0x1ae6fd(0x1d5));if(!_0x4ceeeb||!_0x6b09e7||_0x15bb36!=='personal'&&_0x15bb36!=='company')throw CliErrors[_0x1ae6fd(0x1f1)](_0x1ae6fd(0x1e8));return{'skillCode':_0x4ceeeb,'version':_0x6b09e7,'scope':_0x15bb36};}async function readDiagramWriteInput(_0x3f4854){const _0x1cff2c=a65_0x3023,_0x4a0ad8=_0x3f4854[_0x1cff2c(0x1e7)]('expected-diagram-revision'),_0x5ca7c8=_0x3f4854[_0x1cff2c(0x1e5)](_0x1cff2c(0x1e9))[_0x1cff2c(0x1d9)]();if(!Number[_0x1cff2c(0x1ea)](_0x4a0ad8)||_0x4a0ad8<0x0)throw CliErrors[_0x1cff2c(0x1f1)](_0x1cff2c(0x1ee));if(!/^sha256:[0-9a-f]{64}$/[_0x1cff2c(0x1da)](_0x5ca7c8))throw CliErrors[_0x1cff2c(0x1f1)](_0x1cff2c(0x1db));return{'expectedDiagramRevision':_0x4a0ad8,'sourceFingerprint':_0x5ca7c8,'diagram':await readRequiredSkillDiagram(_0x3f4854[_0x1cff2c(0x1e5)]('diagram-file'))};}function a65_0x3023(_0x2acfd2,_0x5364a0){_0x2acfd2=_0x2acfd2-0x1c5;const _0x2bd4c0=a65_0x2bd4();let _0x302319=_0x2bd4c0[_0x2acfd2];return _0x302319;}export const diagramValidateCommand={'service':a65_0x22e8e2(0x1d1),'command':a65_0x22e8e2(0x1e6),'description':'Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','risk':a65_0x22e8e2(0x1cb),'flags':WRITE_FLAGS,async 'execute'(_0x1dc24f){const _0x2a1394=a65_0x22e8e2,_0x4cbfc5=readDiagramTarget(_0x1dc24f),_0x30f9ca=await validateRuntimeSkillVersionDiagram(_0x1dc24f['appCode'],_0x4cbfc5[_0x2a1394(0x1ed)],_0x4cbfc5[_0x2a1394(0x1dd)],_0x4cbfc5[_0x2a1394(0x1d5)],await readDiagramWriteInput(_0x1dc24f));return{'ok':!![],'data':_0x30f9ca,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0x4cbfc5['skillCode']+'@'+_0x4cbfc5['version']+'.'};}};export const diagramPushCommand={'service':a65_0x22e8e2(0x1d1),'command':a65_0x22e8e2(0x1e2),'description':a65_0x22e8e2(0x1ef),'risk':a65_0x22e8e2(0x1c5),'confirmationDescription':a65_0x22e8e2(0x1d8),'flags':WRITE_FLAGS,async 'execute'(_0x27bfdc){const _0x5beeb0=a65_0x22e8e2,_0x2a9514=readDiagramTarget(_0x27bfdc),_0x6c3818=await putRuntimeSkillVersionDiagram(_0x27bfdc[_0x5beeb0(0x1ca)],_0x2a9514['skillCode'],_0x2a9514[_0x5beeb0(0x1dd)],_0x2a9514[_0x5beeb0(0x1d5)],await readDiagramWriteInput(_0x27bfdc));return{'ok':!![],'data':_0x6c3818,'message':_0x6c3818[_0x5beeb0(0x1f0)]===_0x5beeb0(0x1d7)?'Skill\x20diagram\x20for\x20'+_0x2a9514[_0x5beeb0(0x1ed)]+'@'+_0x2a9514['version']+_0x5beeb0(0x1cc):(_0x6c3818[_0x5beeb0(0x1f0)]===_0x5beeb0(0x1de)?_0x5beeb0(0x1cf):'Updated')+_0x5beeb0(0x1d3)+_0x2a9514[_0x5beeb0(0x1ed)]+'@'+_0x2a9514[_0x5beeb0(0x1dd)]+'.'};}};export const diagramShowCommand={'service':a65_0x22e8e2(0x1d1),'command':a65_0x22e8e2(0x1c6),'description':a65_0x22e8e2(0x1d2),'risk':a65_0x22e8e2(0x1cb),'flags':TARGET_FLAGS,async 'execute'(_0x5319be){const _0x4601c8=a65_0x22e8e2,_0x3fa7fc=readDiagramTarget(_0x5319be),_0x57ff94=await getRuntimeSkillVersionDiagram(_0x5319be['appCode'],_0x3fa7fc[_0x4601c8(0x1ed)],_0x3fa7fc[_0x4601c8(0x1dd)],_0x3fa7fc[_0x4601c8(0x1d5)]);return{'ok':!![],'data':_0x57ff94,'message':_0x57ff94['found']?_0x4601c8(0x1c7)+_0x3fa7fc[_0x4601c8(0x1ed)]+'@'+_0x3fa7fc['version']+_0x4601c8(0x1e3)+_0x57ff94[_0x4601c8(0x1e1)]+'.':_0x4601c8(0x1d0)+_0x3fa7fc[_0x4601c8(0x1ed)]+'@'+_0x3fa7fc[_0x4601c8(0x1dd)]+_0x4601c8(0x1c9)+_0x57ff94[_0x4601c8(0x1e1)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x131eb9=a66_0x2c96;(function(_0xa80c09,_0x708cb6){const _0x1b8142=a66_0x2c96,_0x3dc0fa=_0xa80c09();while(!![]){try{const _0x1c2ea3=parseInt(_0x1b8142(0x162))/0x1*(-parseInt(_0x1b8142(0x149))/0x2)+parseInt(_0x1b8142(0x152))/0x3*(parseInt(_0x1b8142(0x147))/0x4)+parseInt(_0x1b8142(0x142))/0x5*(-parseInt(_0x1b8142(0x166))/0x6)+parseInt(_0x1b8142(0x14c))/0x7+-parseInt(_0x1b8142(0x155))/0x8*(-parseInt(_0x1b8142(0x144))/0x9)+parseInt(_0x1b8142(0x14e))/0xa*(parseInt(_0x1b8142(0x154))/0xb)+-parseInt(_0x1b8142(0x146))/0xc;if(_0x1c2ea3===_0x708cb6)break;else _0x3dc0fa['push'](_0x3dc0fa['shift']());}catch(_0x3df440){_0x3dc0fa['push'](_0x3dc0fa['shift']());}}}(a66_0x34c2,0x1884c));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';const PACKAGE_DOWNLOAD_CONCURRENCY=0x4;export const installCommand={'service':a66_0x131eb9(0x143),'command':a66_0x131eb9(0x164),'description':'Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','risk':a66_0x131eb9(0x16c),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x194a04){return syncRuntimeSkills(_0x194a04);}};async function syncRuntimeSkills(_0x45363a){const _0x19a555=a66_0x131eb9,{downloadRuntimeSkillPackage:_0x31a49b,listRuntimeSkills:_0xc61c66}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x4102c5,materializeRuntimeSkill:_0x1f48ff,pruneStaleRuntimeSkillCache:_0x3a9ae1,pruneStaleRuntimeSkillLinks:_0x138d48,resolveRuntimeSkillInstallTarget:_0x44aad5,reuseMaterializedRuntimeSkill:_0x39dee3}=await import(_0x19a555(0x13f)),_0x4f5ce5=_0x45363a['str'](_0x19a555(0x148)),_0x56057d=normalizeSyncScopes(_0x45363a['str'](_0x19a555(0x16b))),_0x243622=_0x45363a[_0x19a555(0x141)]??'production',_0xe20a78=_0x45363a[_0x19a555(0x16a)],_0x3ece3f=_0x45363a[_0x19a555(0x167)](_0x19a555(0x14d));if(!_0xe20a78)throw CliErrors['authRequired'](_0x19a555(0x14b));const _0x54302e=_0x44aad5(_0x45363a[_0x19a555(0x153)],_0x45363a[_0x19a555(0x167)]('project')?_0x19a555(0x15e):_0x19a555(0x157)),_0x3aec48=_0x44aad5(_0x45363a['appCode'],_0x54302e[_0x19a555(0x16b)]===_0x19a555(0x15e)?_0x19a555(0x157):_0x19a555(0x15e)),_0x1a6aa3=await _0xc61c66({'appCode':_0x45363a[_0x19a555(0x153)],'scope':_0x56057d['length']===0x1?_0x56057d[0x0]:_0x19a555(0x168),'code':_0x4f5ce5[_0x19a555(0x151)]()||undefined}),_0x5c8eaa=_0x56057d[_0x19a555(0x165)]('personal')?_0x1a6aa3[_0x19a555(0x15a)]:[],_0x10e9cc=_0x56057d[_0x19a555(0x165)](_0x19a555(0x158))?_0x1a6aa3[_0x19a555(0x158)]:[],_0x5ed4fb=new Set([..._0x5c8eaa[_0x19a555(0x150)](_0x73930b=>_0x73930b[_0x19a555(0x140)]?.['trim']())[_0x19a555(0x14f)](_0x501b47=>Boolean(_0x501b47)),..._0x10e9cc[_0x19a555(0x150)](_0x239b2a=>_0x239b2a[_0x19a555(0x140)]?.['trim']())[_0x19a555(0x14f)](_0x1a8dd8=>Boolean(_0x1a8dd8))]),_0x4e90eb=_0x4f5ce5['trim']()?[_0x4f5ce5[_0x19a555(0x151)]()]:undefined,_0x348c68=_0x56057d['length']===0x2&&_0x56057d[_0x19a555(0x165)](_0x19a555(0x15a))&&_0x56057d[_0x19a555(0x165)](_0x19a555(0x158)),_0x5666d8=_0x348c68?_0x138d48(_0x54302e,_0x5ed4fb,_0x4e90eb):[],_0x3191c1=_0x3a9ae1({'env':_0x243622,'accessKey':_0xe20a78,'appCode':_0x45363a['appCode'],'activeSkillCodes':_0x5ed4fb,'pruneSkillCodes':_0x4e90eb,'scopes':_0x56057d,'protectedLinkRoots':_0x3aec48[_0x19a555(0x169)]}),_0x14d314=[..._0x5c8eaa[_0x19a555(0x150)](_0x5a0d47=>({'skill':_0x5a0d47,'scope':'personal'})),..._0x10e9cc[_0x19a555(0x150)](_0x3a4121=>({'skill':_0x3a4121,'scope':_0x19a555(0x158)}))],_0x260e3a=await mapConcurrent(_0x14d314,PACKAGE_DOWNLOAD_CONCURRENCY,async({skill:_0xbb1393,scope:_0xd1e7e8})=>{const _0x32c743=_0x19a555,_0x34a28f=_0x39dee3(_0xbb1393,_0xd1e7e8,{'env':_0x243622,'accessKey':_0xe20a78,'appCode':_0x45363a[_0x32c743(0x153)]});if(_0x34a28f)return _0x34a28f;return _0x1f48ff(_0xbb1393,_0xd1e7e8,{'env':_0x243622,'accessKey':_0xe20a78,'appCode':_0x45363a[_0x32c743(0x153)],'force':_0x3ece3f,'packageBytes':await downloadSkillPackage(_0xbb1393,_0xd1e7e8,_0x45363a[_0x32c743(0x153)],_0x31a49b)});}),_0x522671=_0x4102c5(_0x260e3a,_0x54302e),_0xd14fbf=countLinkActions(_0x522671);return{'ok':!![],'data':{'appCode':_0x45363a[_0x19a555(0x153)],..._0x54302e[_0x19a555(0x16b)]===_0x19a555(0x15e)?{'installTarget':{'scope':_0x54302e[_0x19a555(0x16b)],'skillRoots':[..._0x54302e[_0x19a555(0x169)]]}}:{},'personal':_0x5c8eaa[_0x19a555(0x161)],'company':_0x10e9cc['length'],'materialized':_0x260e3a[_0x19a555(0x161)],'links':{'total':_0x522671[_0x19a555(0x161)],'created':_0xd14fbf[_0x19a555(0x15d)]??0x0,'updated':_0xd14fbf[_0x19a555(0x15c)]??0x0,'unchanged':_0xd14fbf[_0x19a555(0x15b)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x5666d8[_0x19a555(0x14f)](_0x311c00=>_0x311c00['action']==='removed')[_0x19a555(0x161)],'cacheDirs':_0x3191c1[_0x19a555(0x14f)](_0x3a1bde=>_0x3a1bde[_0x19a555(0x163)]===_0x19a555(0x13e))['length'],'skipped':[..._0x5666d8,..._0x3191c1][_0x19a555(0x14f)](_0x3b795d=>_0x3b795d['action']==='skipped')[_0x19a555(0x161)]},'skills':{'personal':_0x5c8eaa['map'](summarizeRuntimeSkill),'company':_0x10e9cc[_0x19a555(0x150)](summarizeRuntimeSkill)}},'message':_0x19a555(0x14a)+_0x5c8eaa['length']+'\x20personal\x20and\x20'+_0x10e9cc[_0x19a555(0x161)]+_0x19a555(0x156)};}async function mapConcurrent(_0x58160d,_0x2772b6,_0x5031ea){const _0x36e929=a66_0x131eb9,_0x2972d5=new Array(_0x58160d[_0x36e929(0x161)]);let _0x7ea7a5=0x0;const _0x388598=Array[_0x36e929(0x159)]({'length':Math[_0x36e929(0x15f)](_0x2772b6,_0x58160d['length'])},async()=>{while(_0x7ea7a5<_0x58160d['length']){const _0x37edbb=_0x7ea7a5;_0x7ea7a5+=0x1,_0x2972d5[_0x37edbb]=await _0x5031ea(_0x58160d[_0x37edbb]);}});return await Promise[_0x36e929(0x168)](_0x388598),_0x2972d5;}function a66_0x34c2(){const _0x485ac6=['project','min','version','length','15cWuwmt','action','install','includes','83796GesTuJ','bool','all','skillRoots','accessKey','scope','read','removed','../../../skills/runtime-skill-sync.js','skillCode','envName','5HGUIss','skill','108kqWRKu','reduce','1674540KxjHYG','24VWWkgS','code','19134mYdmOp','Installed\x20','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','624519vqEvzU','force','14450iaOeJk','filter','map','trim','83955ZyybwZ','appCode','451ZRlLUd','54048MjpEnK','\x20company\x20Skill(s).','global','company','from','personal','unchanged','updated','created'];a66_0x34c2=function(){return _0x485ac6;};return a66_0x34c2();}async function downloadSkillPackage(_0x4eb2e2,_0x910790,_0x380f95,_0x3ae218){const _0x3b2292=a66_0x131eb9,_0x39bfba=_0x4eb2e2[_0x3b2292(0x160)]?.[_0x3b2292(0x151)]();return _0x39bfba?_0x3ae218(_0x910790,_0x4eb2e2[_0x3b2292(0x140)],_0x380f95,_0x39bfba):_0x3ae218(_0x910790,_0x4eb2e2[_0x3b2292(0x140)],_0x380f95);}function a66_0x2c96(_0x58dafd,_0x1f1ce8){_0x58dafd=_0x58dafd-0x13e;const _0x34c267=a66_0x34c2();let _0x2c96a5=_0x34c267[_0x58dafd];return _0x2c96a5;}function countLinkActions(_0x336772){const _0x4201e8=a66_0x131eb9;return _0x336772[_0x4201e8(0x145)]((_0x4ad47c,_0x5f0e68)=>{const _0x49b33e=_0x4201e8;return _0x4ad47c[_0x5f0e68[_0x49b33e(0x163)]]=(_0x4ad47c[_0x5f0e68[_0x49b33e(0x163)]]??0x0)+0x1,_0x4ad47c;},{});}
|