@lovrabet/lovrabet-cli 2.1.9-beta.2 → 2.1.9-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +5 -0
- package/README.md +156 -0
- 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/app-config/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.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/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/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/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.js +1 -1
- package/lib/help.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/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/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 +18 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a51_0x243d(){const _0x1cbc78=['416384nwFMAK','appCode','721zQUDgJ','version','warning','tags','618025EuqrSX','37476xAOTBH','4mhrupb','\x20was\x20retargeted\x20to\x20explicit\x20appCode\x20','1961728ArcTnk','15306rtqHhs','10wRlDAN','54951lkNvRV','preferInputSkillName','sourceSessionId','isArray','483471Ljizsl','lovrabet.skill.json','\x20after\x20successful\x20push.','skillName'];a51_0x243d=function(){return _0x1cbc78;};return a51_0x243d();}(function(_0x13a42b,_0x40e784){const _0x38ed66=a51_0x1297,_0x198ac4=_0x13a42b();while(!![]){try{const _0x42c546=-parseInt(_0x38ed66(0x192))/0x1+-parseInt(_0x38ed66(0x193))/0x2*(parseInt(_0x38ed66(0x198))/0x3)+parseInt(_0x38ed66(0x1a0))/0x4+parseInt(_0x38ed66(0x1a6))/0x5+-parseInt(_0x38ed66(0x196))/0x6*(-parseInt(_0x38ed66(0x1a2))/0x7)+-parseInt(_0x38ed66(0x195))/0x8+-parseInt(_0x38ed66(0x19c))/0x9*(-parseInt(_0x38ed66(0x197))/0xa);if(_0x42c546===_0x40e784)break;else _0x198ac4['push'](_0x198ac4['shift']());}catch(_0xb67700){_0x198ac4['push'](_0x198ac4['shift']());}}}(a51_0x243d,0x36e4f));export function withRetargetExistingMetadata(_0x34f128,_0x23fba9,_0x4fd96a={}){const _0x2fdec4=a51_0x1297,_0x4c14e5=_0x4fd96a[_0x2fdec4(0x199)]?_0x34f128[_0x2fdec4(0x19f)]??_0x23fba9[_0x2fdec4(0x19f)]:_0x23fba9[_0x2fdec4(0x19f)]??_0x34f128[_0x2fdec4(0x19f)];return{..._0x34f128,'skillName':_0x4c14e5,'description':_0x23fba9['description']??_0x34f128['description'],'tags':Array[_0x2fdec4(0x19b)](_0x23fba9[_0x2fdec4(0x1a5)])?_0x23fba9[_0x2fdec4(0x1a5)]:_0x34f128[_0x2fdec4(0x1a5)],'version':_0x23fba9[_0x2fdec4(0x1a3)]??_0x34f128[_0x2fdec4(0x1a3)],'sourceSessionId':_0x23fba9[_0x2fdec4(0x19a)]??_0x34f128[_0x2fdec4(0x19a)]};}function a51_0x1297(_0x33a7d8,_0x3b5153){_0x33a7d8=_0x33a7d8-0x192;const _0x243de9=a51_0x243d();let _0x1297e8=_0x243de9[_0x33a7d8];return _0x1297e8;}export function buildRetargetWarning(_0x29d6b8,_0x333d68){const _0x538958=a51_0x1297;if(!_0x29d6b8?.[_0x538958(0x1a1)]||_0x29d6b8[_0x538958(0x1a1)]===_0x333d68)return[];return[{'level':_0x538958(0x1a4),'ruleId':'skill-metadata-appcode-retargeted','file':_0x538958(0x19d),'message':'Local\x20Skill\x20metadata\x20appCode\x20'+_0x29d6b8[_0x538958(0x1a1)]+_0x538958(0x194)+_0x333d68+_0x538958(0x19e),'suggestion':'Review\x20the\x20updated\x20local\x20Skill\x20metadata\x20before\x20the\x20next\x20push.'}];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27d56e,_0x1231ad){const _0x4a5b00=a52_0x19eb,_0x59857f=_0x27d56e();while(!![]){try{const _0x313974=-parseInt(_0x4a5b00(0x157))/0x1+parseInt(_0x4a5b00(0x158))/0x2+-parseInt(_0x4a5b00(0x15b))/0x3*(parseInt(_0x4a5b00(0x151))/0x4)+parseInt(_0x4a5b00(0x154))/0x5+parseInt(_0x4a5b00(0x153))/0x6+parseInt(_0x4a5b00(0x155))/0x7*(parseInt(_0x4a5b00(0x15a))/0x8)+-parseInt(_0x4a5b00(0x15d))/0x9;if(_0x313974===_0x1231ad)break;else _0x59857f['push'](_0x59857f['shift']());}catch(_0x6e8472){_0x59857f['push'](_0x59857f['shift']());}}}(a52_0x2777,0x4bc2f));import{CliErrors}from'../../errors.js';function a52_0x19eb(_0x5492a1,_0x1015ab){_0x5492a1=_0x5492a1-0x14f;const _0x277788=a52_0x2777();let _0x19eb07=_0x277788[_0x5492a1];return _0x19eb07;}export function normalizeSyncScopes(_0x36eb50){const _0x52dcaf=a52_0x19eb,_0x548979=_0x36eb50['trim']();if(!_0x548979||_0x548979===_0x52dcaf(0x156))return[_0x52dcaf(0x15c),'company'];if(_0x548979===_0x52dcaf(0x15c)||_0x548979===_0x52dcaf(0x14f))return[_0x548979];throw CliErrors[_0x52dcaf(0x152)](_0x52dcaf(0x150)+_0x36eb50);}export function normalizeListScope(_0x3e0b90){const _0x3d7b85=a52_0x19eb,_0x36e012=_0x3e0b90['trim']();if(!_0x36e012)return _0x3d7b85(0x156);if(_0x36e012==='personal'||_0x36e012==='company'||_0x36e012===_0x3d7b85(0x156))return _0x36e012;throw CliErrors[_0x3d7b85(0x152)](_0x3d7b85(0x159)+_0x3e0b90);}export function shouldListScope(_0x567bce,_0x38cc4d){const _0x3cd41b=a52_0x19eb;if(_0x567bce===_0x3cd41b(0x156))return!![];return _0x567bce===_0x38cc4d;}export function listScopeToRuntimeScopes(_0x5e1a5b){const _0x4c8294=a52_0x19eb;if(_0x5e1a5b===_0x4c8294(0x156))return[_0x4c8294(0x15c),'company'];return[_0x5e1a5b==='company'?_0x4c8294(0x14f):_0x5e1a5b];}function a52_0x2777(){const _0x640b57=['1557725sZHUdF','2066603lMFulS','all','609235nDOuGH','1072350EgTYji','Unsupported\x20Skill\x20list\x20scope:\x20','16qbectz','1536693ptukEV','personal','4342671xMXfPx','company','Unsupported\x20Skill\x20sync\x20scope:\x20','4rEGYKm','validation','2856756AoRASA'];a52_0x2777=function(){return _0x640b57;};return a52_0x2777();}export function listScopeToRemoteScope(_0x591430){return _0x591430;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ae55e,_0x462487){var _0x2ba786=a53_0x46c1,_0x42d368=_0x3ae55e();while(!![]){try{var _0x1d9ec7=parseInt(_0x2ba786(0x161))/0x1+-parseInt(_0x2ba786(0x15c))/0x2+-parseInt(_0x2ba786(0x156))/0x3*(-parseInt(_0x2ba786(0x155))/0x4)+parseInt(_0x2ba786(0x157))/0x5*(parseInt(_0x2ba786(0x159))/0x6)+-parseInt(_0x2ba786(0x15e))/0x7*(-parseInt(_0x2ba786(0x158))/0x8)+-parseInt(_0x2ba786(0x153))/0x9+-parseInt(_0x2ba786(0x150))/0xa;if(_0x1d9ec7===_0x462487)break;else _0x42d368['push'](_0x42d368['shift']());}catch(_0x345c8a){_0x42d368['push'](_0x42d368['shift']());}}}(a53_0xfcf5,0xd19d1));export function summarizeRuntimeSkill(_0x593ca6){var _0x1bc185=a53_0x46c1;return{'id':_0x593ca6['id'],'skillCode':_0x593ca6[_0x1bc185(0x15a)],'skillName':_0x593ca6['skillName'],'scope':_0x593ca6[_0x1bc185(0x14d)],'version':_0x593ca6[_0x1bc185(0x14f)],'readonly':_0x593ca6[_0x1bc185(0x162)]};}function a53_0x46c1(_0x322e52,_0x444334){_0x322e52=_0x322e52-0x14d;var _0xfcf566=a53_0xfcf5();var _0x46c1cd=_0xfcf566[_0x322e52];return _0x46c1cd;}export function summarizeLocalRuntimeSkill(_0x115831){var _0x5c0231=a53_0x46c1;return{'id':_0x115831['id'],'skillCode':_0x115831[_0x5c0231(0x15a)],'skillName':_0x115831[_0x5c0231(0x154)],'scope':_0x115831[_0x5c0231(0x14d)],'appCode':_0x115831[_0x5c0231(0x151)],'version':_0x115831['version'],'status':_0x115831[_0x5c0231(0x15d)],'readonly':_0x115831[_0x5c0231(0x162)],'tags':_0x115831['tags'],'dir':_0x115831['dir'],'cacheDir':_0x115831['cacheDir'],'skillMdPath':_0x115831[_0x5c0231(0x14e)],'metadataPath':_0x115831['metadataPath'],'linkedPaths':_0x115831[_0x5c0231(0x160)],'contentHash':_0x115831[_0x5c0231(0x15b)],'treeHash':_0x115831[_0x5c0231(0x15f)],'pulledAt':_0x115831[_0x5c0231(0x152)]};}function a53_0xfcf5(){var _0x261490=['35ALRtks','treeHash','linkedPaths','939868dNRsgw','readonly','scope','skillMdPath','version','14639280xHYvgL','appCode','pulledAt','14347674IZochv','skillName','38684weWCUW','303EwuDcc','3971155IWHUJN','2351688mciPNK','6NXInWv','skillCode','contentHash','527968NOALBu','status'];a53_0xfcf5=function(){return _0x261490;};return a53_0xfcf5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a54_0x4a05(_0x408f55,_0x50077a){_0x408f55=_0x408f55-0x11a;const _0x35ea6e=a54_0x35ea();let _0x4a0559=_0x35ea6e[_0x408f55];return _0x4a0559;}function a54_0x35ea(){const _0x4a3a09=['3909HhVkBm','references/runtime-contract.md','##\x20业务状态流转\x0a\x0a【填写本\x20Skill\x20的前置业务状态、允许动作、目标业务状态、fromStatus\x20->\x20toStatus\x20预览、写入后读回核对,以及\x20unknown\x20/\x20needs_manual_check\x20处理。状态迁移合法性必须由业务\x20BFF、Lovrabet\x20平台命令或服务端接口判断,Skill\x20不作为状态事实源。】','1.\x20受控模板预览:【填写待维护内容、影响范围和预览方式】\x0a2.\x20用户确认:【填写确认信息和不可省略的人工判断点】\x0a3.\x20受控维护:【填写确认后的维护步骤和记录方式】\x0a4.\x20只读核对:【填写维护后的核对入口、差异和回滚/修正方式】','\x20的所有必读规则必须位于\x20SKILL.md\x20或\x20references/\x20内。\x0a\x0a##\x20必读文档\x0a\x0a-\x20[SKILL.md](../SKILL.md)\x0a-\x20[runtime-contract.md](runtime-contract.md)\x0a-\x20[output-contract.md](output-contract.md)\x0a\x0a##\x20主边界\x0a\x0a-\x20不得依赖\x20Skill\x20目录外的仓库文件、绝对路径、file\x20URL\x20或本机专属配置。\x0a-\x20文档中的缓存路径、安装路径、示例路径或排障路径不等于运行时包外依赖;只有明确要求读取、链接或执行包外内容时才属于自包含风险。\x0a-\x20如需承接仓库规范,必须把必要规则内化到本\x20Skill\x20包内的\x20references/\x20文件中。\x0a-\x20type=','Unsupported\x20Skill\x20type:\x20','\x0a\x0a##\x20错误与人工接管\x0a\x0aerrors\x20必须包含失败阶段、错误原因和可复核对象。\x0anextActions\x20必须给出重试、补充输入、人工接管或停止处理的动作。\x0a','references/output-contract.md','\x0a##\x20返回契约\x0a\x0a最终输出必须遵守\x20[output-contract.md](output-contract.md)。本文件只补充运行态安全约束;展示字段、状态枚举、失败暴露和人工处理项以\x20output-contract.md\x20为准。\x0a\x0a##\x20失败恢复\x0a\x0a【填写失败状态识别、checkpoint、重试和人工接管方式】\x0a\x0a##\x20禁止事项\x0a\x0a-\x20禁止链接或读取\x20Skill\x20目录外的\x20AGENTS.md、wiki、docs、脚本或个人路径作为运行时必读依赖。\x0a-\x20禁止把说明性的缓存路径、安装路径、示例路径或排障路径包装成运行时必读依赖。\x0a-\x20禁止在未确认影响范围时执行写入。\x0a-\x20禁止隐藏失败或把未知状态描述为成功。\x0a','403489AhPhLa','Use\x20one\x20of:\x20','write','Invalid\x20Skill\x20name:\x20','\x22\x0a\x20\x20generator:\x20\x22lovrabet\x20skill\x20create\x22\x0a---\x0a\x0a#\x20','90TJFOnT','358YpHJkF','36PQkxZv','\x20类型默认不执行业务写入;如流程包含受控维护或人工确认,也必须用\x20mode\x20标明执行阶段并暴露核对结果。','read','402010YABcas','join','timestamp','##\x20状态读回与未知状态处理\x0a\x0a【填写业务状态事实源、fromStatus\x20->\x20toStatus\x20预览、写入后读回核对方式,以及\x20unknown\x20/\x20needs_manual_check\x20的处理边界】\x0a\x0a','\x0adescription:\x20\x22【填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词】\x22\x0ametadata:\x0a\x20\x20type:\x20','99324zPNKcE','test','trainer','4276pNdEKP','\x0a\x0a##\x20内部要求\x0a\x0a执行前必须读取并遵守\x20[runtime-contract.md](references/runtime-contract.md)\x20和\x20[output-contract.md](references/output-contract.md)。\x0a\x0a##\x20使用边界\x0a\x0a【填写该\x20Skill\x20能做什么、不能做什么、适用业务范围和禁止扩大执行范围】\x0a\x0a##\x20输入门禁\x0a\x0a【填写必须具备的输入;缺失业务对象、执行范围、确认信息或权限上下文时必须停止】\x0a\x0a##\x20与现有能力集成\x0a\x0a【填写本\x20Skill\x20使用的\x20lovrabet\x20data、lovrabet\x20sql、lovrabet\x20bff\x20或\x20lovrabet\x20personal-bff\x20命令,以及包内\x20references/\x20中沉淀的运行态入口、脚本对接方式或人工操作边界。不得依赖\x20Skill\x20目录外文件、绝对路径或本机专属配置。】\x0a\x0a##\x20平台能力优先\x0a\x0a【填写本\x20Skill\x20优先使用的\x20Lovrabet\x20平台命令:lovrabet\x20data\x20/\x20lovrabet\x20sql\x20/\x20lovrabet\x20bff\x20/\x20lovrabet\x20personal-bff。本地脚本仅用于平台明确不覆盖的文件格式转换、静态校验、展示整理或第三方薄适配;不得用本地脚本替代平台命令承载业务写入、权限判断、状态机、审批提交或回滚。】\x0a\x0a##\x20第三方服务边界\x0a\x0a【填写是否调用第三方识别、生成、上传或行业服务;如涉及\x20API\x20Key、OAuth、Cookie、登录态或业务数据上传,必须说明由\x20Lovrabet\x20应用后台、BFF\x20或平台适配器统一配置。目标治理口径是\x20Skill\x20不读取、不分发、不保存明文凭证。详细凭证、额度、审计和审核发布规则写入\x20references/runtime-contract.md。】\x0a\x0a##\x20SOP\x20工作流\x0a\x0a','484QqTZZv','\x0a\x0a##\x20展示规范\x0a\x0a【填写面向运营人员的展示字段、差异摘要、成功/失败状态和人工处理项;最终输出必须按\x20references/output-contract.md\x20的\x20status\x20/\x20mode\x20/\x20summary\x20/\x20errors\x20/\x20nextActions\x20返回,不能把\x20unknown、partial_success、failed\x20或\x20needs_manual_check\x20包装为\x20success。】\x0a\x0a##\x20失败恢复\x0a\x0a【填写失败后的\x20checkpoint、重试条件、人工接管方式和避免重复写入的核对步骤】\x0a','trim','665924NAZukE','#\x20Runtime\x20Contract\x0a\x0aSkill\x20push\x20后的\x20zip\x20包就是完整交付产物。','6HoNGWG','SKILL.md','\x0a\x20\x20created:\x20\x22','.\x20Use\x20lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens.','\x20只作为模板选择器,不替代业务权限、风险等级和用户确认。\x0a\x0a##\x20运行态入口\x0a\x0a【填写包内说明的运行态入口、可调用脚本或人工执行边界】\x0a\x0a##\x20凭证与登录态\x0a\x0a【填写本\x20Skill\x20依赖的第三方服务凭证和登录态治理方式。强烈建议通过\x20Lovrabet\x20应用后台或平台服务端适配器做平台托管配置;开发先行阶段如存在临时明文凭证,应标注后续治理计划、适用环境和额度边界,并避免进入长期交付内容。】\x0a\x0a##\x20第三方候选资产\x0a\x0a【填写第三方生成类结果的消费边界。生成类结果仅作为候选素材;涉及商品图、客户资料、Excel\x20或业务文件上传时,必须声明授权、额度、审计、失败降级和人工审核/业务\x20BFF\x20校验后的发布边界。】\x0a\x0a##\x20预览\x20/\x20写入\x20/\x20核对差异\x0a\x0a【填写预览、确认、正式执行和只读核对的顺序】\x0a\x0a','type','4755192DIgZbG','validation'];a54_0x35ea=function(){return _0x4a3a09;};return a54_0x35ea();}const a54_0x5e70e2=a54_0x4a05;(function(_0x137622,_0x369e3f){const _0x184dea=a54_0x4a05,_0x4e0340=_0x137622();while(!![]){try{const _0x29868b=parseInt(_0x184dea(0x143))/0x1+parseInt(_0x184dea(0x11f))/0x2*(parseInt(_0x184dea(0x13a))/0x3)+-parseInt(_0x184dea(0x12b))/0x4*(-parseInt(_0x184dea(0x11e))/0x5)+-parseInt(_0x184dea(0x132))/0x6*(-parseInt(_0x184dea(0x130))/0x7)+-parseInt(_0x184dea(0x138))/0x8+-parseInt(_0x184dea(0x120))/0x9*(parseInt(_0x184dea(0x123))/0xa)+parseInt(_0x184dea(0x12d))/0xb*(parseInt(_0x184dea(0x128))/0xc);if(_0x29868b===_0x369e3f)break;else _0x4e0340['push'](_0x4e0340['shift']());}catch(_0x10fd8a){_0x4e0340['push'](_0x4e0340['shift']());}}}(a54_0x35ea,0x57e95));import{CliErrors}from'../../errors.js';export const SKILL_TYPES=[a54_0x5e70e2(0x11b),'read',a54_0x5e70e2(0x12a)];export const DEFAULT_SKILL_TARGET='.agents/skills';export const SKILL_NAME_PATTERN=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;export const RUNTIME_CONTRACT_FILE=a54_0x5e70e2(0x13b);export const OUTPUT_CONTRACT_FILE=a54_0x5e70e2(0x141);export function validateSkillName(_0x511982){const _0x1b5c1c=a54_0x5e70e2,_0x17161d=_0x511982[_0x1b5c1c(0x12f)]();if(!SKILL_NAME_PATTERN[_0x1b5c1c(0x129)](_0x17161d))throw CliErrors[_0x1b5c1c(0x139)](_0x1b5c1c(0x11c)+_0x511982+_0x1b5c1c(0x135),'Use\x20lowercase\x20letters,\x20numbers,\x20and\x20single\x20hyphens,\x20for\x20example\x20invoice-export.');return _0x17161d;}export function normalizeSkillTemplateType(_0x36c62a){const _0x12ed8e=a54_0x5e70e2,_0x40e83e=(_0x36c62a||_0x12ed8e(0x11b))[_0x12ed8e(0x12f)]()||_0x12ed8e(0x11b);if(SKILL_TYPES['includes'](_0x40e83e))return _0x40e83e;throw CliErrors[_0x12ed8e(0x139)](_0x12ed8e(0x13f)+_0x36c62a,_0x12ed8e(0x11a)+SKILL_TYPES[_0x12ed8e(0x124)](',\x20')+'.');}export function renderSkillTemplate(_0x216c60){const _0x50a79e=a54_0x5e70e2,_0xa85406=validateSkillName(_0x216c60['skillName']),_0x430c15=normalizeSkillTemplateType(_0x216c60[_0x50a79e(0x137)]),_0xde9a45=_0x216c60[_0x50a79e(0x125)]??new Date()['toISOString']();return{'skillName':_0xa85406,'type':_0x430c15,'files':[{'path':_0x50a79e(0x133),'content':renderSkillMd(_0xa85406,_0x430c15,_0xde9a45)},{'path':RUNTIME_CONTRACT_FILE,'content':renderRuntimeContract(_0xa85406,_0x430c15)},{'path':OUTPUT_CONTRACT_FILE,'content':renderOutputContract(_0xa85406,_0x430c15)}]};}function renderSkillMd(_0x286f46,_0x1cb8ed,_0x14ce32){const _0x1bbb94=a54_0x5e70e2,_0xff397e=typeWorkflow(_0x1cb8ed);return'---\x0aname:\x20'+_0x286f46+_0x1bbb94(0x127)+_0x1cb8ed+_0x1bbb94(0x134)+_0x14ce32+_0x1bbb94(0x11d)+_0x286f46+_0x1bbb94(0x12c)+_0xff397e+'\x0a\x0a'+businessStateSection(_0x1cb8ed)+_0x1bbb94(0x12e);}function renderRuntimeContract(_0x377d56,_0x482a19){const _0x161a81=a54_0x5e70e2,_0x239192=_0x482a19===_0x161a81(0x11b)?_0x161a81(0x126):'';return _0x161a81(0x131)+_0x377d56+_0x161a81(0x13e)+_0x482a19+_0x161a81(0x136)+_0x239192+_0x161a81(0x142);}function renderOutputContract(_0x582025,_0x4c2d13){const _0x3b4e95=a54_0x5e70e2,_0xfb515f=_0x4c2d13===_0x3b4e95(0x11b)?'write\x20类型在\x20dry_run\x20下只展示预览、影响范围和差异,不写入业务数据。\x0aconfirmed\x20写入后必须执行读回核对,并把核对结果写入\x20verification。\x0a读回异常、业务状态未知或结果不一致时,status\x20必须为\x20partial_success、failed\x20或\x20needs_manual_check。':_0x4c2d13+_0x3b4e95(0x121);return'#\x20Output\x20Contract\x0a\x0a'+_0x582025+'\x20的最终回复必须让运营人员能判断:是否执行、影响了什么、如何复核、失败后下一步做什么。\x0a\x0a##\x20状态枚举\x0a\x0astatus:\x20success\x20|\x20no_op\x20|\x20partial_success\x20|\x20blocked\x20|\x20failed\x20|\x20needs_manual_check\x0a\x0a-\x20success:动作已完成,且关键结果已核对。\x0a-\x20no_op:没有符合条件的对象或无需变更。\x0a-\x20partial_success:部分对象完成,未完成对象必须进入\x20errors\x20和\x20nextActions。\x0a-\x20blocked:缺少输入、权限、确认或平台能力,无法继续。\x0a-\x20failed:执行失败,必须说明失败阶段、错误和恢复方式。\x0a-\x20needs_manual_check:读回异常、状态未知或人工判断缺失。\x0a\x0aunknown、partial_success、failed、needs_manual_check\x20不能包装为\x20success。\x0a\x0a##\x20输出模式\x0a\x0amode:\x20dry_run\x20|\x20confirmed\x20|\x20read_only\x0a\x0a-\x20dry_run:只展示预览、影响范围和差异,不写入业务数据。\x0a-\x20confirmed:用户明确确认后的执行模式;写入后必须读回核对。\x0a-\x20read_only:只查询、汇总或核对,不触发写入。\x0a\x0a##\x20必填字段\x0a\x0a-\x20status\x0a-\x20mode\x0a-\x20summary\x0a-\x20scope\x0a-\x20changes\x0a-\x20verification\x0a-\x20warnings\x0a-\x20errors\x0a-\x20nextActions\x0a\x0a##\x20写入结果\x0a\x0a'+_0xfb515f+_0x3b4e95(0x140);}function typeWorkflow(_0x1f899f){const _0x59a207=a54_0x5e70e2;if(_0x1f899f===_0x59a207(0x122))return'1.\x20只读查询:【填写查询入口、过滤条件和权限边界】\x0a2.\x20业务汇总:【填写统计口径、字段解释和异常提示】\x0a3.\x20查看链接:【填写可供运营人员复核的记录、页面或报告链接】\x0a4.\x20禁止写入:不得创建、更新、删除或触发会改变业务状态的动作。';if(_0x1f899f===_0x59a207(0x12a))return _0x59a207(0x13d);return'1.\x20dry-run:【填写预览入口、影响范围和差异摘要;不得写入业务数据】\x0a2.\x20用户确认:【填写确认语义、目标对象、数量、风险和操作者责任】\x0a3.\x20confirmed\x20写入:【填写确认后的写入入口和幂等/防重复要求】\x0a4.\x20只读核对:【填写写入后的查询核对、差异展示和结果链接】\x0a5.\x20checkpoint:【填写失败恢复、重试条件和人工接管方式】';}function businessStateSection(_0x5b1353){const _0x22cd30=a54_0x5e70e2;if(_0x5b1353!==_0x22cd30(0x11b))return'';return _0x22cd30(0x13c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a55_0x42409e=a55_0x5baa;(function(_0x2bf7e7,_0x5c7184){const _0x444e0a=a55_0x5baa,_0x22c09e=_0x2bf7e7();while(!![]){try{const _0x2e8f2d=parseInt(_0x444e0a(0x100))/0x1+parseInt(_0x444e0a(0xdf))/0x2*(parseInt(_0x444e0a(0xf3))/0x3)+parseInt(_0x444e0a(0xda))/0x4*(-parseInt(_0x444e0a(0xb3))/0x5)+parseInt(_0x444e0a(0xea))/0x6*(-parseInt(_0x444e0a(0x109))/0x7)+parseInt(_0x444e0a(0xfc))/0x8+parseInt(_0x444e0a(0xff))/0x9*(parseInt(_0x444e0a(0xe9))/0xa)+parseInt(_0x444e0a(0xc4))/0xb*(-parseInt(_0x444e0a(0x103))/0xc);if(_0x2e8f2d===_0x5c7184)break;else _0x22c09e['push'](_0x22c09e['shift']());}catch(_0x49b8a3){_0x22c09e['push'](_0x22c09e['shift']());}}}(a55_0x2357,0x76063));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a55_0x316edc}from'yaml';import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';const SKILL_FILE=a55_0x42409e(0xd2),SUPPORTED_SKILL_TYPES=new Set([a55_0x42409e(0xf7),'read',a55_0x42409e(0xc6)]),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;export function validateSkillDirectory(_0xef4c09,_0x44cb9b={}){const _0x49028a=a55_0x42409e,_0x13a86e=resolveSkillDirectoryRoot(_0xef4c09),_0xc6d5d9=[],_0x37d88d=loadRequiredSkillFile(_0x13a86e,_0xc6d5d9),_0x5e0136=_0x37d88d?parseFrontmatter(_0x37d88d[_0x49028a(0xd9)]):{'hasFrontmatter':![]};_0x37d88d&&validateFrontmatter(_0x37d88d[_0x49028a(0xf1)],_0x5e0136,_0xc6d5d9);validateRuntimeCliReferences(_0x13a86e,_0xc6d5d9);const _0x11508c=_0xc6d5d9[_0x49028a(0xba)](_0x42f716=>_0x42f716[_0x49028a(0xd7)]==='error'),_0x25560f=_0xc6d5d9[_0x49028a(0xba)](_0x993f66=>_0x993f66[_0x49028a(0xd7)]==='warning');return{'ok':_0x11508c[_0x49028a(0xec)]===0x0,'dir':_0x13a86e,'type':_0x5e0136[_0x49028a(0xbf)],'errors':_0x11508c,'warnings':_0x25560f};}function resolveSkillDirectoryRoot(_0x147254){const _0x4ec19e=a55_0x42409e,_0x2f0294=resolve(_0x147254);if(!existsSync(_0x2f0294))throw CliErrors[_0x4ec19e(0x101)](_0x4ec19e(0xbe)+_0x147254);const _0x1625d3=lstatSync(_0x2f0294);if(_0x1625d3[_0x4ec19e(0xfb)]())return _0x2f0294;if(_0x1625d3[_0x4ec19e(0xb1)]()){const _0x942f1e=realpathSync(_0x2f0294);if(lstatSync(_0x942f1e)['isDirectory']())return _0x942f1e;}throw CliErrors[_0x4ec19e(0x101)](_0x4ec19e(0xbe)+_0x147254);}export function throwIfSkillValidationFailed(_0x3d8ed8,_0x5dce62=![]){const _0x490fe8=a55_0x42409e;if(_0x3d8ed8['ok'])return;const _0x5b90f1=_0x3d8ed8[_0x490fe8(0xfe)][_0x490fe8(0xd0)](_0x4b2981=>{const _0x2770eb=_0x490fe8,_0x293b41=_0x4b2981[_0x2770eb(0xc3)]?'#'+_0x4b2981[_0x2770eb(0xc3)]:'';return _0x4b2981[_0x2770eb(0xd7)]['toUpperCase']()+'\x20'+_0x4b2981[_0x2770eb(0xb9)]+'\x20'+_0x4b2981[_0x2770eb(0xc7)]+_0x293b41+':\x20'+_0x4b2981[_0x2770eb(0xd8)]+'\x20Fix:\x20'+_0x4b2981['suggestion'];});throw CliErrors[_0x490fe8(0x101)](_0x490fe8(0xc2)+_0x5b90f1['join']('\x0a'),_0x490fe8(0x102));}function a55_0x2357(){const _0x3be24d=['project','object','dataset','metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','data','ruleId','filter','Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.','SKILL.md\x20is\x20not\x20a\x20file.','name','Skill\x20directory\x20not\x20found:\x20','type','config','Add\x20frontmatter\x20with\x20name\x20and\x20description.','Skill\x20validation\x20failed:\x0a','section','4653715azOOce','false','trainer','file','warning','frontmatter-required','bff','raw','app','trim','service','Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.','map','displayName','SKILL.md','split','Frontmatter\x20displayName\x20is\x20missing.','error','isFile','level','message','content','12DlWtCX','test','workspace','Frontmatter\x20description\x20is\x20empty.','Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.','4kjJIOr','Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.','metadata','SKILL.md\x20must\x20start\x20with\x20frontmatter.','rabetbase-cli-reference','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','number','true','description','logs','10jmLxPg','1294266CVECYA','string','length','SKILL.md\x20must\x20be\x20a\x20regular\x20file.','hasFrontmatter','toLowerCase','page','path','boolean','1303023TEvGaN','internal','structure-complete','search','write','auth','Frontmatter\x20name\x20is\x20missing.','Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.','isDirectory','5924064vSHnVg','push','errors','3397617dEOPRi','886171zKlXZA','validation','Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.','48bIOTzI','has','internal-skill','slice','registry','Set\x20metadata.type\x20to\x20write,\x20read,\x20or\x20trainer.','7LnuUHi','isSymbolicLink','utf8','802460whiccY'];a55_0x2357=function(){return _0x3be24d;};return a55_0x2357();}function loadRequiredSkillFile(_0x1313d1,_0x59def8){const _0xda719e=a55_0x42409e,_0x5a5a42=resolve(_0x1313d1,SKILL_FILE);if(!existsSync(_0x5a5a42))return _0x59def8[_0xda719e(0xfd)](issue(_0xda719e(0xd5),_0xda719e(0xf5),SKILL_FILE,'Missing\x20SKILL.md.',_0xda719e(0xde))),undefined;const _0x4c3b70=lstatSync(_0x5a5a42);if(_0x4c3b70[_0xda719e(0xb1)]())return _0x59def8[_0xda719e(0xfd)](issue(_0xda719e(0xd5),'structure-complete',SKILL_FILE,_0xda719e(0xed),_0xda719e(0xe0))),undefined;if(!_0x4c3b70[_0xda719e(0xd6)]())return _0x59def8[_0xda719e(0xfd)](issue(_0xda719e(0xd5),_0xda719e(0xf5),SKILL_FILE,_0xda719e(0xbc),_0xda719e(0xbb))),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x5a5a42,_0xda719e(0xb2))};}function validateFrontmatter(_0x4f50aa,_0xfa60b5,_0x4259eb){const _0x252d70=a55_0x42409e;if(!_0xfa60b5[_0x252d70(0xee)]){_0x4259eb[_0x252d70(0xfd)](issue(_0x252d70(0xd5),_0x252d70(0xc9),_0x4f50aa,_0x252d70(0xe2),_0x252d70(0xc1)));return;}!_0xfa60b5[_0x252d70(0xbd)]?.[_0x252d70(0xcd)]()&&_0x4259eb[_0x252d70(0xfd)](issue('error',_0x252d70(0xc9),_0x4f50aa,_0x252d70(0xf9),_0x252d70(0xfa))),!_0xfa60b5[_0x252d70(0xd1)]?.[_0x252d70(0xcd)]()&&_0x4259eb['push'](issue(_0x252d70(0xc8),'display-name-recommended',_0x4f50aa,_0x252d70(0xd4),'Set\x20displayName\x20to\x20the\x20human-readable\x20Skill\x20name\x20shown\x20in\x20SkillHub.')),!_0xfa60b5[_0x252d70(0xe7)]?.[_0x252d70(0xcd)]()&&_0x4259eb['push'](issue(_0x252d70(0xd5),'description-required',_0x4f50aa,_0x252d70(0xdd),'填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词。')),_0xfa60b5['internal']===!![]&&_0x4259eb[_0x252d70(0xfd)](issue(_0x252d70(0xd5),_0x252d70(0x105),_0x4f50aa,_0x252d70(0xb7),_0x252d70(0xcf))),_0xfa60b5[_0x252d70(0xbf)]?.[_0x252d70(0xcd)]()&&!SUPPORTED_SKILL_TYPES[_0x252d70(0x104)](_0xfa60b5[_0x252d70(0xbf)])&&_0x4259eb[_0x252d70(0xfd)](issue(_0x252d70(0xd5),_0x252d70(0xc9),_0x4f50aa,'metadata.type\x20must\x20be\x20one\x20of\x20write,\x20read,\x20or\x20trainer.',_0x252d70(0x108)));}function validateRuntimeCliReferences(_0x59e5bf,_0x51ca3a){const _0x11c2bf=a55_0x42409e;for(const _0x5947f6 of findRabetbaseCliInvocations(_0x59e5bf)){_0x51ca3a[_0x11c2bf(0xfd)](issue(_0x11c2bf(0xc8),_0x11c2bf(0xe3),_0x5947f6['file'],'This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.',_0x11c2bf(0xe4),'L'+_0x5947f6['line']));}}function findRabetbaseCliInvocations(_0x2e88e2){const _0x4aefe9=a55_0x42409e;return scanSkillDirectory(_0x2e88e2)[_0x4aefe9(0xba)](_0x410baa=>TEXT_SKILL_FILE_PATTERN[_0x4aefe9(0xdb)](_0x410baa[_0x4aefe9(0xf1)]))['flatMap'](_0x375cf9=>{const _0x25cb4a=_0x4aefe9,_0x28caa5=fileText(_0x375cf9);return _0x28caa5[_0x25cb4a(0xd3)](/\r?\n/)[_0x25cb4a(0xd0)]((_0x367b57,_0x1634c0)=>({'file':_0x375cf9[_0x25cb4a(0xf1)],'line':_0x1634c0+0x1,'text':_0x367b57}))['filter'](({text:_0x290629})=>isRabetbaseCliInvocation(_0x290629))['map'](({file:_0x50a937,line:_0x4e48ba})=>({'file':_0x50a937,'line':_0x4e48ba}));});}const RABETBASE_SUBCOMMANDS=[a55_0x42409e(0xb6),'sql',a55_0x42409e(0xca),a55_0x42409e(0xf0),a55_0x42409e(0xb4),a55_0x42409e(0xcc),'schema',a55_0x42409e(0xce),'artifact','kb',a55_0x42409e(0xc0),a55_0x42409e(0xdc),a55_0x42409e(0xb8),a55_0x42409e(0xf8),a55_0x42409e(0xe8),a55_0x42409e(0x107)],RABETBASE_INVOCATION=new RegExp(String[a55_0x42409e(0xcb)]`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS['join']('|')})\b`+String[a55_0x42409e(0xcb)]`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0xa0ca61){const _0x4aacc3=a55_0x42409e,_0x5f1229=_0xa0ca61[_0x4aacc3(0xf6)](/\brabetbase\b/i);if(_0x5f1229<0x0)return![];const _0x2be396=_0xa0ca61[_0x4aacc3(0x106)](_0x5f1229)[_0x4aacc3(0xd3)](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION[_0x4aacc3(0xdb)](_0x2be396);}function parseFrontmatter(_0x5f530a){const _0x35407a=a55_0x42409e,_0x317d78=_0x5f530a['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x317d78)return{'hasFrontmatter':![]};const _0x37acad=_0x317d78[0x1]??'',_0x3012c3={'hasFrontmatter':!![]};let _0x418a04;try{_0x418a04=a55_0x316edc(_0x37acad);}catch{return _0x3012c3;}const _0x32cc78=asRecord(_0x418a04);if(!_0x32cc78)return _0x3012c3;_0x3012c3[_0x35407a(0xbd)]=scalarToString(_0x32cc78[_0x35407a(0xbd)]),_0x3012c3[_0x35407a(0xd1)]=scalarToString(_0x32cc78['displayName']),_0x3012c3[_0x35407a(0xe7)]=scalarToString(_0x32cc78[_0x35407a(0xe7)]);const _0x1851a8=asRecord(_0x32cc78[_0x35407a(0xe1)]);return _0x1851a8&&(_0x3012c3[_0x35407a(0xbf)]=scalarToString(_0x1851a8[_0x35407a(0xbf)]),_0x3012c3[_0x35407a(0xf4)]=scalarToBoolean(_0x1851a8['internal'])),_0x3012c3;}function asRecord(_0x2ab206){const _0x1bbfab=a55_0x42409e;if(_0x2ab206&&typeof _0x2ab206===_0x1bbfab(0xb5)&&!Array['isArray'](_0x2ab206))return _0x2ab206;return undefined;}function scalarToString(_0x1996f0){const _0x46db5f=a55_0x42409e;if(typeof _0x1996f0===_0x46db5f(0xeb))return _0x1996f0[_0x46db5f(0xcd)]();if(typeof _0x1996f0===_0x46db5f(0xe5)||typeof _0x1996f0===_0x46db5f(0xf2))return String(_0x1996f0);return undefined;}function scalarToBoolean(_0x41f24d){const _0x3f3bf0=a55_0x42409e;if(typeof _0x41f24d===_0x3f3bf0(0xf2))return _0x41f24d;if(typeof _0x41f24d===_0x3f3bf0(0xeb))return cleanBoolean(_0x41f24d);return undefined;}function a55_0x5baa(_0x50fdfb,_0x56d5d2){_0x50fdfb=_0x50fdfb-0xb1;const _0x235722=a55_0x2357();let _0x5baa4a=_0x235722[_0x50fdfb];return _0x5baa4a;}function cleanBoolean(_0x13e977){const _0x4f4fef=a55_0x42409e,_0x149375=_0x13e977[_0x4f4fef(0xcd)]()[_0x4f4fef(0xef)]();if(_0x149375===_0x4f4fef(0xe6))return!![];if(_0x149375===_0x4f4fef(0xc5))return![];return undefined;}function issue(_0x44fba8,_0x223223,_0x4513ee,_0x1d0611,_0x3ed054,_0x545529){return{'level':_0x44fba8,'ruleId':_0x223223,'file':_0x4513ee,'section':_0x545529,'message':_0x1d0611,'suggestion':_0x3ed054};}
|
|
1
|
+
const a55_0x38de35=a55_0x4d05;(function(_0x1790ed,_0x2d8844){const _0x4578a3=a55_0x4d05,_0x2fb84b=_0x1790ed();while(!![]){try{const _0x417944=parseInt(_0x4578a3(0x219))/0x1+parseInt(_0x4578a3(0x213))/0x2+-parseInt(_0x4578a3(0x211))/0x3*(parseInt(_0x4578a3(0x1e6))/0x4)+parseInt(_0x4578a3(0x22e))/0x5+-parseInt(_0x4578a3(0x1f2))/0x6*(-parseInt(_0x4578a3(0x1eb))/0x7)+parseInt(_0x4578a3(0x21d))/0x8*(parseInt(_0x4578a3(0x20a))/0x9)+-parseInt(_0x4578a3(0x200))/0xa;if(_0x417944===_0x2d8844)break;else _0x2fb84b['push'](_0x2fb84b['shift']());}catch(_0x31deb4){_0x2fb84b['push'](_0x2fb84b['shift']());}}}(a55_0x33e5,0x85d54));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a55_0x3cb111}from'yaml';import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';const SKILL_FILE=a55_0x38de35(0x22c),SUPPORTED_SKILL_TYPES=new Set(['write',a55_0x38de35(0x21c),a55_0x38de35(0x1ef)]),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;export function validateSkillDirectory(_0x5a1c62,_0x19f06f={}){const _0x3f009b=a55_0x38de35,_0x57a0c8=resolveSkillDirectoryRoot(_0x5a1c62),_0x3d7aea=[],_0x2761c2=loadRequiredSkillFile(_0x57a0c8,_0x3d7aea),_0x7ce6f6=_0x2761c2?parseFrontmatter(_0x2761c2['content']):{'hasFrontmatter':![]};_0x2761c2&&validateFrontmatter(_0x2761c2[_0x3f009b(0x220)],_0x7ce6f6,_0x3d7aea);validateRuntimeCliReferences(_0x57a0c8,_0x3d7aea);const _0x20d309=_0x3d7aea[_0x3f009b(0x226)](_0x36cd60=>_0x36cd60[_0x3f009b(0x1e5)]==='error'),_0x317f27=_0x3d7aea[_0x3f009b(0x226)](_0x44b652=>_0x44b652['level']==='warning');return{'ok':_0x20d309[_0x3f009b(0x230)]===0x0,'dir':_0x57a0c8,'type':_0x7ce6f6[_0x3f009b(0x21e)],'errors':_0x20d309,'warnings':_0x317f27};}function resolveSkillDirectoryRoot(_0x54e805){const _0x392ab1=a55_0x38de35,_0x1a7539=resolve(_0x54e805);if(!existsSync(_0x1a7539))throw CliErrors[_0x392ab1(0x1f6)]('Skill\x20directory\x20not\x20found:\x20'+_0x54e805);const _0xf4da77=lstatSync(_0x1a7539);if(_0xf4da77['isDirectory']())return _0x1a7539;if(_0xf4da77['isSymbolicLink']()){const _0x1d2a8b=realpathSync(_0x1a7539);if(lstatSync(_0x1d2a8b)[_0x392ab1(0x1f1)]())return _0x1d2a8b;}throw CliErrors[_0x392ab1(0x1f6)](_0x392ab1(0x21b)+_0x54e805);}export function throwIfSkillValidationFailed(_0x6ba8ba,_0x2ae7bb=![]){const _0x38cc17=a55_0x38de35;if(_0x6ba8ba['ok'])return;const _0x36be39=_0x6ba8ba['errors'][_0x38cc17(0x221)](_0x3012a0=>{const _0xce160e=_0x38cc17,_0x56e985=_0x3012a0[_0xce160e(0x210)]?'#'+_0x3012a0[_0xce160e(0x210)]:'';return _0x3012a0[_0xce160e(0x1e5)][_0xce160e(0x20e)]()+'\x20'+_0x3012a0[_0xce160e(0x223)]+'\x20'+_0x3012a0[_0xce160e(0x206)]+_0x56e985+':\x20'+_0x3012a0[_0xce160e(0x1e9)]+_0xce160e(0x228)+_0x3012a0['suggestion'];});throw CliErrors[_0x38cc17(0x1f6)](_0x38cc17(0x20c)+_0x36be39[_0x38cc17(0x1f8)]('\x0a'),'Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.');}function loadRequiredSkillFile(_0x485007,_0x1d8544){const _0x18377b=a55_0x38de35,_0x54ced0=resolve(_0x485007,SKILL_FILE);if(!existsSync(_0x54ced0))return _0x1d8544[_0x18377b(0x205)](issue('error',_0x18377b(0x1f5),SKILL_FILE,_0x18377b(0x1fe),_0x18377b(0x229))),undefined;const _0xa7bb1b=lstatSync(_0x54ced0);if(_0xa7bb1b[_0x18377b(0x1e8)]())return _0x1d8544[_0x18377b(0x205)](issue(_0x18377b(0x234),'structure-complete',SKILL_FILE,_0x18377b(0x209),_0x18377b(0x20d))),undefined;if(!_0xa7bb1b[_0x18377b(0x22d)]())return _0x1d8544['push'](issue(_0x18377b(0x234),_0x18377b(0x1f5),SKILL_FILE,_0x18377b(0x1ee),'Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.')),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x54ced0,'utf8')};}function validateFrontmatter(_0x5921ec,_0x3e001e,_0x519c42){const _0x172636=a55_0x38de35;if(!_0x3e001e[_0x172636(0x1ec)]){_0x519c42[_0x172636(0x205)](issue(_0x172636(0x234),'frontmatter-required',_0x5921ec,_0x172636(0x1f4),'Add\x20frontmatter\x20with\x20name\x20and\x20description.'));return;}!_0x3e001e[_0x172636(0x231)]?.[_0x172636(0x1ff)]()&&_0x519c42['push'](issue(_0x172636(0x234),_0x172636(0x1f0),_0x5921ec,'Frontmatter\x20name\x20is\x20missing.',_0x172636(0x203))),!_0x3e001e[_0x172636(0x21f)]?.[_0x172636(0x1ff)]()&&_0x519c42[_0x172636(0x205)](issue(_0x172636(0x22f),_0x172636(0x232),_0x5921ec,_0x172636(0x1f3),'Set\x20displayName\x20to\x20the\x20human-readable\x20Skill\x20name\x20shown\x20in\x20SkillHub.')),!_0x3e001e['description']?.['trim']()&&_0x519c42[_0x172636(0x205)](issue(_0x172636(0x234),_0x172636(0x1fb),_0x5921ec,_0x172636(0x20b),_0x172636(0x21a))),_0x3e001e['internal']===!![]&&_0x519c42[_0x172636(0x205)](issue('error','internal-skill',_0x5921ec,_0x172636(0x22b),_0x172636(0x204))),_0x3e001e[_0x172636(0x21e)]?.[_0x172636(0x1ff)]()&&!SUPPORTED_SKILL_TYPES['has'](_0x3e001e[_0x172636(0x21e)])&&_0x519c42[_0x172636(0x205)](issue(_0x172636(0x234),'frontmatter-required',_0x5921ec,_0x172636(0x212),'Set\x20metadata.type\x20to\x20write,\x20read,\x20or\x20trainer.'));}function validateRuntimeCliReferences(_0x43e86b,_0x284260){const _0x3eba56=a55_0x38de35;for(const _0x384563 of findRabetbaseCliInvocations(_0x43e86b)){_0x284260[_0x3eba56(0x205)](issue('warning',_0x3eba56(0x1ea),_0x384563[_0x3eba56(0x206)],_0x3eba56(0x1e4),_0x3eba56(0x1f7),'L'+_0x384563['line']));}}function findRabetbaseCliInvocations(_0x464293){const _0x593d15=a55_0x38de35;return scanSkillDirectory(_0x464293)[_0x593d15(0x226)](_0x33b993=>TEXT_SKILL_FILE_PATTERN[_0x593d15(0x1fa)](_0x33b993[_0x593d15(0x220)]))[_0x593d15(0x1e7)](_0x228a39=>{const _0x4b67a5=_0x593d15,_0x511ac7=fileText(_0x228a39);return _0x511ac7[_0x4b67a5(0x218)](/\r?\n/)['map']((_0x2c5ef7,_0x1c61b6)=>({'file':_0x228a39[_0x4b67a5(0x220)],'line':_0x1c61b6+0x1,'text':_0x2c5ef7}))[_0x4b67a5(0x226)](({text:_0xe4309e})=>isRabetbaseCliInvocation(_0xe4309e))['map'](({file:_0x37007e,line:_0x127812})=>({'file':_0x37007e,'line':_0x127812}));});}const RABETBASE_SUBCOMMANDS=['dataset','sql',a55_0x38de35(0x1fc),a55_0x38de35(0x207),'project','app',a55_0x38de35(0x227),'service','artifact','kb',a55_0x38de35(0x216),a55_0x38de35(0x233),'data',a55_0x38de35(0x215),a55_0x38de35(0x225),'registry'],RABETBASE_INVOCATION=new RegExp(String[a55_0x38de35(0x1fd)]`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS[a55_0x38de35(0x1f8)]('|')})\b`+String[a55_0x38de35(0x1fd)]`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0x703595){const _0x5c9c1d=a55_0x38de35,_0x26ec83=_0x703595[_0x5c9c1d(0x217)](/\brabetbase\b/i);if(_0x26ec83<0x0)return![];const _0x4fa973=_0x703595[_0x5c9c1d(0x22a)](_0x26ec83)['split'](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION[_0x5c9c1d(0x1fa)](_0x4fa973);}function a55_0x4d05(_0x575bda,_0x42fe52){_0x575bda=_0x575bda-0x1e4;const _0x33e5c0=a55_0x33e5();let _0x4d05f9=_0x33e5c0[_0x575bda];return _0x4d05f9;}function parseFrontmatter(_0x2f0962){const _0x2622b3=a55_0x38de35,_0x1bfff5=_0x2f0962[_0x2622b3(0x214)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1bfff5)return{'hasFrontmatter':![]};const _0x50442c=_0x1bfff5[0x1]??'',_0x33f8d9={'hasFrontmatter':!![]};let _0x5bfd03;try{_0x5bfd03=a55_0x3cb111(_0x50442c);}catch{return _0x33f8d9;}const _0x6cfac5=asRecord(_0x5bfd03);if(!_0x6cfac5)return _0x33f8d9;_0x33f8d9['name']=scalarToString(_0x6cfac5[_0x2622b3(0x231)]),_0x33f8d9[_0x2622b3(0x21f)]=scalarToString(_0x6cfac5[_0x2622b3(0x21f)]),_0x33f8d9[_0x2622b3(0x202)]=scalarToString(_0x6cfac5['description']);const _0x4fab21=asRecord(_0x6cfac5['metadata']);return _0x4fab21&&(_0x33f8d9[_0x2622b3(0x21e)]=scalarToString(_0x4fab21[_0x2622b3(0x21e)]),_0x33f8d9[_0x2622b3(0x1ed)]=scalarToBoolean(_0x4fab21[_0x2622b3(0x1ed)])),_0x33f8d9;}function asRecord(_0x5c49e1){if(_0x5c49e1&&typeof _0x5c49e1==='object'&&!Array['isArray'](_0x5c49e1))return _0x5c49e1;return undefined;}function scalarToString(_0x5ed266){const _0x3559a2=a55_0x38de35;if(typeof _0x5ed266==='string')return _0x5ed266[_0x3559a2(0x1ff)]();if(typeof _0x5ed266===_0x3559a2(0x222)||typeof _0x5ed266==='boolean')return String(_0x5ed266);return undefined;}function scalarToBoolean(_0x9aaf81){const _0x56006f=a55_0x38de35;if(typeof _0x9aaf81===_0x56006f(0x20f))return _0x9aaf81;if(typeof _0x9aaf81===_0x56006f(0x208))return cleanBoolean(_0x9aaf81);return undefined;}function cleanBoolean(_0x467901){const _0x3719f1=a55_0x38de35,_0x45e482=_0x467901[_0x3719f1(0x1ff)]()[_0x3719f1(0x224)]();if(_0x45e482===_0x3719f1(0x201))return!![];if(_0x45e482===_0x3719f1(0x1f9))return![];return undefined;}function issue(_0x434bf5,_0x147b92,_0x35bd0b,_0x3f7804,_0x467c3b,_0x1934d3){return{'level':_0x434bf5,'ruleId':_0x147b92,'file':_0x35bd0b,'section':_0x1934d3,'message':_0x3f7804,'suggestion':_0x467c3b};}function a55_0x33e5(){const _0x4a0b04=['false','test','description-required','bff','raw','Missing\x20SKILL.md.','trim','15532550VEVFIw','true','description','Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.','Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.','push','file','page','string','SKILL.md\x20must\x20be\x20a\x20regular\x20file.','3230622OlqtoI','Frontmatter\x20description\x20is\x20empty.','Skill\x20validation\x20failed:\x0a','Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.','toUpperCase','boolean','section','116988ipUjiR','metadata.type\x20must\x20be\x20one\x20of\x20write,\x20read,\x20or\x20trainer.','1613630faoxDI','match','auth','config','search','split','752523shHCrL','填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词。','Skill\x20directory\x20not\x20found:\x20','read','24pJrhyz','type','displayName','path','map','number','ruleId','toLowerCase','logs','filter','schema','\x20Fix:\x20','Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.','slice','metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','SKILL.md','isFile','666930icwDxF','warning','length','name','display-name-recommended','workspace','error','This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.','level','72lBYDyV','flatMap','isSymbolicLink','message','rabetbase-cli-reference','236355mGMDPe','hasFrontmatter','internal','SKILL.md\x20is\x20not\x20a\x20file.','trainer','frontmatter-required','isDirectory','6jsRIPL','Frontmatter\x20displayName\x20is\x20missing.','SKILL.md\x20must\x20start\x20with\x20frontmatter.','structure-complete','validation','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','join'];a55_0x33e5=function(){return _0x4a0b04;};return a55_0x33e5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0x125ac4=a56_0x3120;function a56_0x3120(_0x1d65d0,_0x226053){_0x1d65d0=_0x1d65d0-0x13c;const _0x319ef4=a56_0x319e();let _0x3120a3=_0x319ef4[_0x1d65d0];return _0x3120a3;}function a56_0x319e(){const _0xcca688=['verbose','detail','951592ZkimBf','read','34810452hwFpzW','sqlContent','3ugznoO','2916994PtWbHz','596266XWPnfw','3464488QXWiYK','16706160lASpBr','description','9gOnXwy','11DWgryX','sqlCode','25nduZlA','3082499gqROFk','18jCBbXe','appCode','sqlName','dbId'];a56_0x319e=function(){return _0xcca688;};return a56_0x319e();}(function(_0x5537bc,_0x147b8a){const _0x15ee2b=a56_0x3120,_0x3381bc=_0x5537bc();while(!![]){try{const _0x5bdaa1=parseInt(_0x15ee2b(0x14e))/0x1+parseInt(_0x15ee2b(0x14d))/0x2*(-parseInt(_0x15ee2b(0x14c))/0x3)+parseInt(_0x15ee2b(0x148))/0x4*(parseInt(_0x15ee2b(0x140))/0x5)+parseInt(_0x15ee2b(0x142))/0x6*(parseInt(_0x15ee2b(0x141))/0x7)+parseInt(_0x15ee2b(0x14f))/0x8+-parseInt(_0x15ee2b(0x13d))/0x9*(-parseInt(_0x15ee2b(0x150))/0xa)+parseInt(_0x15ee2b(0x13e))/0xb*(-parseInt(_0x15ee2b(0x14a))/0xc);if(_0x5bdaa1===_0x147b8a)break;else _0x3381bc['push'](_0x3381bc['shift']());}catch(_0x51236d){_0x3381bc['push'](_0x3381bc['shift']());}}}(a56_0x319e,0xcfcc0));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a56_0x125ac4(0x147),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a56_0x125ac4(0x149),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x3fdf73){const _0x2472e8=a56_0x125ac4,_0x24268a=await getSqlQueryInfo(_0x3fdf73[_0x2472e8(0x143)],_0x3fdf73['str']('sqlcode')),_0x42eaa6=_0x3fdf73['bool'](_0x2472e8(0x146));if(_0x42eaa6)return{'ok':!![],'data':_0x24268a};const _0x988227=_0x24268a[_0x2472e8(0x145)]?await getDbName(_0x3fdf73[_0x2472e8(0x143)],_0x24268a['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x24268a[_0x2472e8(0x13f)],'sqlName':_0x24268a[_0x2472e8(0x144)],'db':_0x988227?_0x988227+'\x20('+_0x24268a[_0x2472e8(0x145)]+')':_0x24268a[_0x2472e8(0x145)]??'','description':_0x24268a[_0x2472e8(0x13c)]??'','sqlContent':_0x24268a[_0x2472e8(0x14b)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a57_0x3a0a(_0x139ed3,_0x4bf665){_0x139ed3=_0x139ed3-0x73;const _0xd34ad6=a57_0xd34a();let _0x3a0a6c=_0xd34ad6[_0x139ed3];return _0x3a0a6c;}const a57_0x159c5d=a57_0x3a0a;(function(_0x1818bd,_0x558ee8){const _0x4fe89f=a57_0x3a0a,_0x19d24b=_0x1818bd();while(!![]){try{const _0x57b413=parseInt(_0x4fe89f(0x80))/0x1*(parseInt(_0x4fe89f(0x74))/0x2)+-parseInt(_0x4fe89f(0x7a))/0x3*(-parseInt(_0x4fe89f(0x78))/0x4)+-parseInt(_0x4fe89f(0x85))/0x5*(-parseInt(_0x4fe89f(0x82))/0x6)+-parseInt(_0x4fe89f(0x7e))/0x7*(parseInt(_0x4fe89f(0x88))/0x8)+parseInt(_0x4fe89f(0x86))/0x9*(-parseInt(_0x4fe89f(0x7d))/0xa)+-parseInt(_0x4fe89f(0x77))/0xb+-parseInt(_0x4fe89f(0x7f))/0xc;if(_0x57b413===_0x558ee8)break;else _0x19d24b['push'](_0x19d24b['shift']());}catch(_0x174cf9){_0x19d24b['push'](_0x19d24b['shift']());}}}(a57_0xd34a,0xec965));function a57_0xd34a(){const _0x1b137f=['12599180txweKq','4nosgfv','isArray','5563410mFMvKN','params','exec','11474000GaUKNV','14HELBnx','17973336IPEPdw','1907BZkWcj','length','1474452urHEmD','\x20row(s)\x20in\x20','Returned\x20','30APKcUs','9rqczlh','execSuccess','1897584IzXprw','execResult','sqlcode','execError','now','1998nRorkX','SQL\x20execution\x20failed','str'];a57_0xd34a=function(){return _0x1b137f;};return a57_0xd34a();}import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a57_0x159c5d(0x7c),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x1d1667){const _0x4aa823=a57_0x159c5d,_0x39b9ff=parseJsonParams(_0x1d1667[_0x4aa823(0x76)](_0x4aa823(0x7b))),_0x343c1f=Date['now'](),_0x2b22e3=await executeSdkSql(_0x1d1667[_0x4aa823(0x76)](_0x4aa823(0x8a)),_0x39b9ff),_0x506bee=Date[_0x4aa823(0x73)]()-_0x343c1f,_0xb75d01=_0x2b22e3?.[_0x4aa823(0x89)]??_0x2b22e3,_0x16271e=_0x2b22e3?.[_0x4aa823(0x87)]??!![];if(!_0x16271e)return{'ok':![],'data':{'error':_0x2b22e3?.[_0x4aa823(0x8b)]||_0x4aa823(0x75),'elapsed':_0x506bee},'message':'SQL\x20execution\x20failed'};const _0x4b6a60=Array[_0x4aa823(0x79)](_0xb75d01)?_0xb75d01:[];return{'ok':!![],'data':{'rows':_0x4b6a60,'rowCount':_0x4b6a60[_0x4aa823(0x81)],'elapsed':_0x506bee},'message':_0x4aa823(0x84)+_0x4b6a60[_0x4aa823(0x81)]+_0x4aa823(0x83)+_0x506bee+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40bf07,_0x584e24){const _0x45afdd=a58_0x1628,_0xa82d1a=_0x40bf07();while(!![]){try{const _0xb6ceb4=-parseInt(_0x45afdd(0xdd))/0x1+parseInt(_0x45afdd(0xe6))/0x2*(-parseInt(_0x45afdd(0xde))/0x3)+-parseInt(_0x45afdd(0xe3))/0x4*(-parseInt(_0x45afdd(0xe4))/0x5)+-parseInt(_0x45afdd(0xdf))/0x6+-parseInt(_0x45afdd(0xe2))/0x7+parseInt(_0x45afdd(0xe5))/0x8*(parseInt(_0x45afdd(0xe0))/0x9)+parseInt(_0x45afdd(0xe1))/0xa;if(_0xb6ceb4===_0x584e24)break;else _0xa82d1a['push'](_0xa82d1a['shift']());}catch(_0x443084){_0xa82d1a['push'](_0xa82d1a['shift']());}}}(a58_0xccec,0x98cea));function a58_0x1628(_0x2e1988,_0x3ba095){_0x2e1988=_0x2e1988-0xdd;const _0xccec0a=a58_0xccec();let _0x16283a=_0xccec0a[_0x2e1988];return _0x16283a;}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlExec}from'../../commands/sql/exec.js';function a58_0xccec(){const _0x16b43b=['16549910AKwbpM','6105554OBflHO','44AVyogP','305615peNHzH','16ZMNweM','1175864OxbcZu','49927aXJZQT','6rjcKxU','3813690mHzlRz','4644819QfSZRR'];a58_0xccec=function(){return _0x16b43b;};return a58_0xccec();}export const sqlDefinitions=[sqlDetail,sqlExec];
|
package/lib/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x38764d=a59_0x1bdf;(function(_0x33482e,_0x31c073){const _0x5a6e27=a59_0x1bdf,_0x4dd6d5=_0x33482e();while(!![]){try{const _0x25dd03=-parseInt(_0x5a6e27(0x1c4))/0x1*(parseInt(_0x5a6e27(0x1ab))/0x2)+parseInt(_0x5a6e27(0x19b))/0x3+parseInt(_0x5a6e27(0x18f))/0x4+parseInt(_0x5a6e27(0x1c5))/0x5*(-parseInt(_0x5a6e27(0x197))/0x6)+-parseInt(_0x5a6e27(0x1a0))/0x7*(-parseInt(_0x5a6e27(0x1a2))/0x8)+parseInt(_0x5a6e27(0x1ca))/0x9*(parseInt(_0x5a6e27(0x183))/0xa)+-parseInt(_0x5a6e27(0x185))/0xb*(parseInt(_0x5a6e27(0x1ce))/0xc);if(_0x25dd03===_0x31c073)break;else _0x4dd6d5['push'](_0x4dd6d5['shift']());}catch(_0x21fac2){_0x4dd6d5['push'](_0x4dd6d5['shift']());}}}(a59_0x2249,0xd13c6));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';function a59_0x2249(){const _0x322537=['message','pipe','boolean','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','513261UsnBqY','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','prerelease','no-skills','96BTpnIN','skipped','source','Already\x20on\x20requested\x20version\x20(v','match','=1).','130LbVwKl','minor','2659745EjzuBl','log','version','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','skills','Current\x20version:\x20','exit\x20','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','error','beta','6595504ZKjkhS','\x20CLI\x20from\x20npm','Updating\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','run','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','unknown','Version\x20comparison\x20failed.','84NkqgKJ','Already\x20up\x20to\x20date\x20(v','npm','filter','4838583rewwmL','str','entries','flag','/-/package/','7paiXvt','Checking\x20npm\x20dist-tags...','8119248SyuqXQ','write','inherit','stdout','major','trim','bool','stderr','map','4GHzQqc','nonInteractive','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','Checking\x20CLI\x20Built-in\x20Skill...','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','\x20->\x20','length','\x20\x20Run\x20manually:\x20lovrabet\x20cli-skill\x20install','status','string','timeout','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','json','Invalid\x20version:\x20','validation','Install\x20a\x20specific\x20CLI\x20version','latest','update','cwd','patch','object','/dist-tags','Updated\x20to\x20v','args','513415qztHit','428500VqMCEs'];a59_0x2249=function(){return _0x322537;};return a59_0x2249();}function a59_0x1bdf(_0x2e9af0,_0xb4aeea){_0x2e9af0=_0x2e9af0-0x180;const _0x224955=a59_0x2249();let _0x1bdfa8=_0x224955[_0x2e9af0];return _0x1bdfa8;}import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a59_0x38764d(0x1bc),'type':a59_0x38764d(0x1c8),'description':a59_0x38764d(0x18c),'default':![]},{'name':a59_0x38764d(0x18e),'type':a59_0x38764d(0x1c8),'description':a59_0x38764d(0x188),'default':![]},{'name':'version','type':'string','description':a59_0x38764d(0x1bb)},{'name':a59_0x38764d(0x1cd),'type':a59_0x38764d(0x1c8),'description':a59_0x38764d(0x1b7),'default':![]},{'name':a59_0x38764d(0x189),'type':a59_0x38764d(0x1c8),'description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function parseSemver(_0x1244c5){const _0x4bb5fa=a59_0x38764d,_0x1ff1b6=_0x1244c5[_0x4bb5fa(0x1a7)]()[_0x4bb5fa(0x181)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x1ff1b6)return null;return{'major':Number(_0x1ff1b6[0x1]),'minor':Number(_0x1ff1b6[0x2]),'patch':Number(_0x1ff1b6[0x3]),'prerelease':_0x1ff1b6[0x4]};}function compareSemver(_0xe4b0d3,_0x419573){const _0x2da268=a59_0x38764d,_0x546525=parseSemver(_0xe4b0d3),_0x3560c5=parseSemver(_0x419573);if(!_0x546525||!_0x3560c5)throw CliErrors['validation'](_0x2da268(0x196),_0x2da268(0x1cb));for(const _0xe1a624 of[_0x2da268(0x1a6),_0x2da268(0x184),_0x2da268(0x1bf)]){if(_0x546525[_0xe1a624]<_0x3560c5[_0xe1a624])return-0x1;if(_0x546525[_0xe1a624]>_0x3560c5[_0xe1a624])return 0x1;}if(!_0x546525[_0x2da268(0x1cc)]&&!_0x3560c5[_0x2da268(0x1cc)])return 0x0;if(!_0x546525[_0x2da268(0x1cc)])return 0x1;if(!_0x3560c5['prerelease'])return-0x1;if(_0x546525[_0x2da268(0x1cc)]===_0x3560c5[_0x2da268(0x1cc)])return 0x0;return _0x546525[_0x2da268(0x1cc)]<_0x3560c5[_0x2da268(0x1cc)]?-0x1:0x1;}function getRequestedVersion(_0x36ca64){const _0x49a02a=a59_0x38764d,_0x411149=_0x36ca64[_0x49a02a(0x19c)](_0x49a02a(0x187))[_0x49a02a(0x1a7)]();if(_0x411149)return _0x411149;return String(_0x36ca64[_0x49a02a(0x1c3)]?.[0x0]??'')[_0x49a02a(0x1a7)]();}function shouldSkipCliBuiltInSkill(_0x5d72c8){const _0x4bf746=a59_0x38764d;return _0x5d72c8[_0x4bf746(0x1a8)]('no-skills')||_0x5d72c8[_0x4bf746(0x19e)](_0x4bf746(0x189))===![];}async function validateUpdateFlags(_0x35858f){const _0x50e318=a59_0x38764d,_0x5ae963=getRequestedVersion(_0x35858f),_0x2ce50e=[_0x35858f[_0x50e318(0x1a8)]('latest')?'latest':'',_0x35858f[_0x50e318(0x1a8)](_0x50e318(0x18e))?'beta':'',_0x5ae963?_0x50e318(0x187):''][_0x50e318(0x19a)](Boolean);if(_0x2ce50e[_0x50e318(0x1b2)]>0x1)throw CliErrors['validation'](_0x50e318(0x1b0),_0x50e318(0x1af));if(_0x5ae963&&!parseSemver(_0x5ae963))throw CliErrors[_0x50e318(0x1ba)](_0x50e318(0x1b9)+_0x5ae963,'Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.');}async function fetchNpmDistTags(){const _0x4444e1=a59_0x38764d;try{const _0x2bd64e=NPM_REGISTRY_BASE_URL+_0x4444e1(0x19f)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x4444e1(0x1c1),_0x340586=await fetch(_0x2bd64e,{'signal':AbortSignal[_0x4444e1(0x1b6)](0x2710)});if(!_0x340586['ok'])return null;const _0x3e6030=await _0x340586[_0x4444e1(0x1b8)]();if(!_0x3e6030||typeof _0x3e6030!==_0x4444e1(0x1c0))return null;return Object['fromEntries'](Object[_0x4444e1(0x19d)](_0x3e6030)[_0x4444e1(0x19a)](([,_0x3028c7])=>typeof _0x3028c7===_0x4444e1(0x1b5)&&_0x3028c7[_0x4444e1(0x1a7)]())[_0x4444e1(0x1aa)](([_0x4590d9,_0x1e3268])=>[_0x4590d9,String(_0x1e3268)['trim']()]));}catch{return null;}}async function resolveTargetVersion(_0x441b2d){const _0x47d1ec=a59_0x38764d,_0x450234=getRequestedVersion(_0x441b2d);if(_0x450234)return{'version':_0x450234,'source':_0x47d1ec(0x187)};const _0x42d63e=_0x441b2d['bool']('beta')?_0x47d1ec(0x18e):_0x47d1ec(0x1bc),_0x304c8e=await fetchNpmDistTags(),_0x4c9bdc=_0x304c8e?.[_0x42d63e];if(!_0x4c9bdc)return null;return{'version':_0x4c9bdc,'source':_0x42d63e};}function shouldInstallTarget(_0x4c3f9e,_0x44cfa7){const _0x267982=a59_0x38764d,_0x122079=compareSemver(_0x4c3f9e,_0x44cfa7[_0x267982(0x187)]);if(_0x44cfa7[_0x267982(0x1d0)]===_0x267982(0x187))return _0x122079!==0x0;return _0x122079<0x0;}function installCliPackage(_0x4be058,_0x1d35b0){const _0x4744df=a59_0x38764d,_0x3aecac=resolveNpmBin(_0x4744df(0x199)),_0x5f440a=['install','-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4be058];console[_0x4744df(0x186)]('*\x20'+[_0x3aecac,..._0x5f440a]['join']('\x20'));const _0x183d6c=spawnSync(_0x3aecac,_0x5f440a,{'cwd':process[_0x4744df(0x1be)](),'stdio':_0x1d35b0?_0x4744df(0x1c7):_0x4744df(0x1a4),'env':process.env,'shell':![]});if(_0x183d6c[_0x4744df(0x1b4)]===0x0)return{'ok':!![]};let _0x3f4f01=_0x183d6c[_0x4744df(0x18d)]?.[_0x4744df(0x1c6)]||_0x4744df(0x18b)+(_0x183d6c[_0x4744df(0x1b4)]??_0x4744df(0x195));if(_0x1d35b0){const _0x4b41b6=_0x183d6c[_0x4744df(0x1a9)]?_0x183d6c[_0x4744df(0x1a9)]['toString']()['trim']():'',_0x2b8e36=_0x183d6c[_0x4744df(0x1a5)]?_0x183d6c[_0x4744df(0x1a5)]['toString']()['trim']():'';if(_0x4b41b6)_0x3f4f01=_0x4b41b6;else{if(_0x2b8e36)_0x3f4f01=_0x2b8e36;}}return{'ok':![],'error':_0x3f4f01};}async function installCliBuiltInSkill(_0x2ed48c){const _0x44011b=a59_0x38764d;console['log'](_0x44011b(0x1ae));const _0x4566ec=runNpxSkillsAddGlobal(process[_0x44011b(0x1be)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x2ed48c?_0x44011b(0x1c7):_0x44011b(0x1a4)});if(_0x4566ec[_0x44011b(0x1cf)]){console[_0x44011b(0x186)]('\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20('+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x44011b(0x182));return;}if(_0x4566ec['ok']){console['log']('\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.');return;}console['warn'](_0x44011b(0x1ad)+(_0x4566ec[_0x44011b(0x18d)]||_0x44011b(0x195))),console['log'](_0x44011b(0x1b3));}async function execute(_0x11cf3b){const _0x143491=a59_0x38764d;await validateUpdateFlags(_0x11cf3b);const _0x40c10f=getCliVersion();console['log'](_0x143491(0x18a)+_0x40c10f),console['log'](_0x143491(0x1a1));const _0x387507=await resolveTargetVersion(_0x11cf3b);if(!_0x387507){const _0x37b1b0=_0x11cf3b[_0x143491(0x1a8)](_0x143491(0x18e))?_0x143491(0x18e):_0x143491(0x1bc),_0x4b7d6b='Unable\x20to\x20resolve\x20'+_0x37b1b0+'\x20version\x20from\x20npm.';return console['warn'](_0x4b7d6b),console['log'](_0x143491(0x192)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x37b1b0),{'ok':![]};}if(!shouldInstallTarget(_0x40c10f,_0x387507)){const _0x37851f=_0x387507[_0x143491(0x1d0)]===_0x143491(0x187)?_0x143491(0x180)+_0x387507[_0x143491(0x187)]+').':_0x143491(0x198)+_0x387507['version']+').';return console[_0x143491(0x186)](_0x37851f),shouldSkipCliBuiltInSkill(_0x11cf3b)?console['log'](_0x143491(0x194)):await installCliBuiltInSkill(_0x11cf3b['nonInteractive']),{'ok':!![]};}console[_0x143491(0x186)](_0x143491(0x191)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x40c10f+_0x143491(0x1b1)+_0x387507['version']);const _0x16e7b1=installCliPackage(_0x387507[_0x143491(0x187)],_0x11cf3b[_0x143491(0x1ac)]);if(!_0x16e7b1['ok']){const _0x4bf090='Update\x20failed:\x20'+(_0x16e7b1['error']||'unknown');return console[_0x143491(0x18d)](_0x4bf090),console[_0x143491(0x186)]('\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x387507[_0x143491(0x187)]),{'ok':![]};}return console['log'](_0x143491(0x1c2)+_0x387507[_0x143491(0x187)]+'.'),console[_0x143491(0x186)](_0x143491(0x1c9)),shouldSkipCliBuiltInSkill(_0x11cf3b)?console[_0x143491(0x186)](_0x143491(0x194)):await installCliBuiltInSkill(_0x11cf3b[_0x143491(0x1ac)]),{'ok':!![]};}export const updateDefinition={'service':a59_0x38764d(0x1bd),'command':a59_0x38764d(0x193),'description':'Update\x20'+CLI_BIN_NAME+a59_0x38764d(0x190),'risk':a59_0x38764d(0x1a3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a59_0x558648=a59_0x5cb2;(function(_0x4857c3,_0x492342){const _0x5eb26a=a59_0x5cb2,_0xeb7ba0=_0x4857c3();while(!![]){try{const _0xb181f5=parseInt(_0x5eb26a(0x1fd))/0x1+-parseInt(_0x5eb26a(0x1eb))/0x2+parseInt(_0x5eb26a(0x1ec))/0x3+-parseInt(_0x5eb26a(0x1f5))/0x4*(-parseInt(_0x5eb26a(0x1cb))/0x5)+-parseInt(_0x5eb26a(0x1f1))/0x6+parseInt(_0x5eb26a(0x1c5))/0x7+-parseInt(_0x5eb26a(0x1e1))/0x8;if(_0xb181f5===_0x492342)break;else _0xeb7ba0['push'](_0xeb7ba0['shift']());}catch(_0x2e14bb){_0xeb7ba0['push'](_0xeb7ba0['shift']());}}}(a59_0x4c9d,0x2676a));import{spawnSync}from'node:child_process';function a59_0x4c9d(){const _0x2efac4=['filter','fromEntries','1635025weHxeM','major','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(','Checking\x20npm\x20dist-tags...','timeout','stdout','50ooyNLz','unknown','Invalid\x20version:\x20','match','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Run\x20manually:\x20lovrabet\x20cli-skill\x20install','install','warn','version','pipe','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','beta','str','status','run','validation','join','Update\x20failed:\x20','message','npm','update','json','1134344Rgcmqg','bool','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','entries','source','prerelease','string','boolean','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20version\x20from\x20npm.','513200QVvmdr','446412KtzWsU','length','log','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','428166lqiFrE','stderr','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','10004XiJwFs','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Already\x20on\x20requested\x20version\x20(v','error','flag','args','\x20->\x20','map','219911LumjqP','no-skills','skills','minor','\x20CLI\x20from\x20npm','toString','Version\x20comparison\x20failed.','cwd','inherit','/dist-tags','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','trim','latest'];a59_0x4c9d=function(){return _0x2efac4;};return a59_0x4c9d();}import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a59_0x558648(0x1c2),'type':a59_0x558648(0x1e8),'description':'Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','default':![]},{'name':'beta','type':a59_0x558648(0x1e8),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a59_0x558648(0x1d3),'type':a59_0x558648(0x1e7),'description':'Install\x20a\x20specific\x20CLI\x20version'},{'name':a59_0x558648(0x1fe),'type':a59_0x558648(0x1e8),'description':a59_0x558648(0x1d5),'default':![]},{'name':a59_0x558648(0x1ff),'type':'boolean','description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function parseSemver(_0x27dca0){const _0x1861e1=a59_0x558648,_0x1cace0=_0x27dca0[_0x1861e1(0x1c1)]()[_0x1861e1(0x1ce)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x1cace0)return null;return{'major':Number(_0x1cace0[0x1]),'minor':Number(_0x1cace0[0x2]),'patch':Number(_0x1cace0[0x3]),'prerelease':_0x1cace0[0x4]};}function compareSemver(_0x112c2c,_0x591d10){const _0x3131bd=a59_0x558648,_0x53e74e=parseSemver(_0x112c2c),_0x326571=parseSemver(_0x591d10);if(!_0x53e74e||!_0x326571)throw CliErrors[_0x3131bd(0x1da)](_0x3131bd(0x1bc),_0x3131bd(0x1c0));for(const _0x59814a of[_0x3131bd(0x1c6),_0x3131bd(0x200),'patch']){if(_0x53e74e[_0x59814a]<_0x326571[_0x59814a])return-0x1;if(_0x53e74e[_0x59814a]>_0x326571[_0x59814a])return 0x1;}if(!_0x53e74e[_0x3131bd(0x1e6)]&&!_0x326571['prerelease'])return 0x0;if(!_0x53e74e[_0x3131bd(0x1e6)])return 0x1;if(!_0x326571[_0x3131bd(0x1e6)])return-0x1;if(_0x53e74e[_0x3131bd(0x1e6)]===_0x326571[_0x3131bd(0x1e6)])return 0x0;return _0x53e74e[_0x3131bd(0x1e6)]<_0x326571[_0x3131bd(0x1e6)]?-0x1:0x1;}function getRequestedVersion(_0x3cffbe){const _0x5310f8=a59_0x558648,_0x416c99=_0x3cffbe[_0x5310f8(0x1d7)](_0x5310f8(0x1d3))[_0x5310f8(0x1c1)]();if(_0x416c99)return _0x416c99;return String(_0x3cffbe[_0x5310f8(0x1fa)]?.[0x0]??'')['trim']();}function shouldSkipCliBuiltInSkill(_0x12f881){const _0x12cb85=a59_0x558648;return _0x12f881[_0x12cb85(0x1e2)](_0x12cb85(0x1fe))||_0x12f881[_0x12cb85(0x1f9)](_0x12cb85(0x1ff))===![];}function a59_0x5cb2(_0x435fef,_0x4e5ff2){_0x435fef=_0x435fef-0x1bb;const _0x4c9d59=a59_0x4c9d();let _0x5cb2a5=_0x4c9d59[_0x435fef];return _0x5cb2a5;}async function validateUpdateFlags(_0x3e5808){const _0x4355c3=a59_0x558648,_0x46be60=getRequestedVersion(_0x3e5808),_0x3f5bff=[_0x3e5808['bool'](_0x4355c3(0x1c2))?_0x4355c3(0x1c2):'',_0x3e5808['bool'](_0x4355c3(0x1d6))?'beta':'',_0x46be60?'version':'']['filter'](Boolean);if(_0x3f5bff[_0x4355c3(0x1ed)]>0x1)throw CliErrors[_0x4355c3(0x1da)]('--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.',_0x4355c3(0x1f4));if(_0x46be60&&!parseSemver(_0x46be60))throw CliErrors[_0x4355c3(0x1da)](_0x4355c3(0x1cd)+_0x46be60,_0x4355c3(0x1f6));}async function fetchNpmDistTags(){const _0x38829f=a59_0x558648;try{const _0x21d26d=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x38829f(0x1bf),_0xf459aa=await fetch(_0x21d26d,{'signal':AbortSignal[_0x38829f(0x1c9)](0x2710)});if(!_0xf459aa['ok'])return null;const _0x250089=await _0xf459aa[_0x38829f(0x1e0)]();if(!_0x250089||typeof _0x250089!=='object')return null;return Object[_0x38829f(0x1c4)](Object[_0x38829f(0x1e4)](_0x250089)[_0x38829f(0x1c3)](([,_0x1486fe])=>typeof _0x1486fe===_0x38829f(0x1e7)&&_0x1486fe[_0x38829f(0x1c1)]())[_0x38829f(0x1fc)](([_0x13633a,_0x5f1b29])=>[_0x13633a,String(_0x5f1b29)[_0x38829f(0x1c1)]()]));}catch{return null;}}async function resolveTargetVersion(_0x90a2df){const _0x2f74ad=a59_0x558648,_0x25201a=getRequestedVersion(_0x90a2df);if(_0x25201a)return{'version':_0x25201a,'source':'version'};const _0x58b8c1=_0x90a2df['bool'](_0x2f74ad(0x1d6))?_0x2f74ad(0x1d6):_0x2f74ad(0x1c2),_0x40cc28=await fetchNpmDistTags(),_0x261212=_0x40cc28?.[_0x58b8c1];if(!_0x261212)return null;return{'version':_0x261212,'source':_0x58b8c1};}function shouldInstallTarget(_0x196da1,_0x146565){const _0x323e06=a59_0x558648,_0x30565c=compareSemver(_0x196da1,_0x146565[_0x323e06(0x1d3)]);if(_0x146565[_0x323e06(0x1e5)]===_0x323e06(0x1d3))return _0x30565c!==0x0;return _0x30565c<0x0;}function installCliPackage(_0x30d2fb,_0xb4f4e1){const _0x484fd3=a59_0x558648,_0x16eaa7=resolveNpmBin(_0x484fd3(0x1de)),_0x2c7a09=[_0x484fd3(0x1d1),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x30d2fb];console[_0x484fd3(0x1ee)]('*\x20'+[_0x16eaa7,..._0x2c7a09][_0x484fd3(0x1db)]('\x20'));const _0x1f0df6=spawnSync(_0x16eaa7,_0x2c7a09,{'cwd':process[_0x484fd3(0x1bd)](),'stdio':_0xb4f4e1?'pipe':_0x484fd3(0x1be),'env':process.env,'shell':![]});if(_0x1f0df6[_0x484fd3(0x1d8)]===0x0)return{'ok':!![]};let _0x4a1bcc=_0x1f0df6[_0x484fd3(0x1f8)]?.[_0x484fd3(0x1dd)]||'exit\x20'+(_0x1f0df6[_0x484fd3(0x1d8)]??_0x484fd3(0x1cc));if(_0xb4f4e1){const _0x15bafa=_0x1f0df6[_0x484fd3(0x1f2)]?_0x1f0df6[_0x484fd3(0x1f2)][_0x484fd3(0x1bb)]()['trim']():'',_0x3cdc4a=_0x1f0df6[_0x484fd3(0x1ca)]?_0x1f0df6[_0x484fd3(0x1ca)][_0x484fd3(0x1bb)]()['trim']():'';if(_0x15bafa)_0x4a1bcc=_0x15bafa;else{if(_0x3cdc4a)_0x4a1bcc=_0x3cdc4a;}}return{'ok':![],'error':_0x4a1bcc};}async function installCliBuiltInSkill(_0x5b5646){const _0x441028=a59_0x558648;console[_0x441028(0x1ee)]('Checking\x20CLI\x20Built-in\x20Skill...');const _0x331564=runNpxSkillsAddGlobal(process[_0x441028(0x1bd)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x5b5646?_0x441028(0x1d4):_0x441028(0x1be)});if(_0x331564['skipped']){console[_0x441028(0x1ee)](_0x441028(0x1c7)+LOVRABET_SKIP_NPX_SKILLS_ENV+'=1).');return;}if(_0x331564['ok']){console[_0x441028(0x1ee)](_0x441028(0x1f0));return;}console[_0x441028(0x1d2)](_0x441028(0x1ef)+(_0x331564[_0x441028(0x1f8)]||_0x441028(0x1cc))),console['log'](_0x441028(0x1d0));}async function execute(_0x5e106e){const _0x8f7330=a59_0x558648;await validateUpdateFlags(_0x5e106e);const _0x20a38b=getCliVersion();console['log']('Current\x20version:\x20'+_0x20a38b),console['log'](_0x8f7330(0x1c8));const _0x506f35=await resolveTargetVersion(_0x5e106e);if(!_0x506f35){const _0x5e2db5=_0x5e106e[_0x8f7330(0x1e2)](_0x8f7330(0x1d6))?_0x8f7330(0x1d6):'latest',_0x5bf591='Unable\x20to\x20resolve\x20'+_0x5e2db5+_0x8f7330(0x1ea);return console['warn'](_0x5bf591),console[_0x8f7330(0x1ee)](_0x8f7330(0x1e9)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x5e2db5),{'ok':![]};}if(!shouldInstallTarget(_0x20a38b,_0x506f35)){const _0x11356f=_0x506f35[_0x8f7330(0x1e5)]===_0x8f7330(0x1d3)?_0x8f7330(0x1f7)+_0x506f35['version']+').':'Already\x20up\x20to\x20date\x20(v'+_0x506f35['version']+').';return console[_0x8f7330(0x1ee)](_0x11356f),shouldSkipCliBuiltInSkill(_0x5e106e)?console['log'](_0x8f7330(0x1e3)):await installCliBuiltInSkill(_0x5e106e['nonInteractive']),{'ok':!![]};}console[_0x8f7330(0x1ee)]('Updating\x20'+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x20a38b+_0x8f7330(0x1fb)+_0x506f35[_0x8f7330(0x1d3)]);const _0x499492=installCliPackage(_0x506f35[_0x8f7330(0x1d3)],_0x5e106e['nonInteractive']);if(!_0x499492['ok']){const _0xb06992=_0x8f7330(0x1dc)+(_0x499492[_0x8f7330(0x1f8)]||_0x8f7330(0x1cc));return console[_0x8f7330(0x1f8)](_0xb06992),console[_0x8f7330(0x1ee)](_0x8f7330(0x1cf)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x506f35[_0x8f7330(0x1d3)]),{'ok':![]};}return console[_0x8f7330(0x1ee)]('Updated\x20to\x20v'+_0x506f35['version']+'.'),console[_0x8f7330(0x1ee)](_0x8f7330(0x1f3)),shouldSkipCliBuiltInSkill(_0x5e106e)?console['log'](_0x8f7330(0x1e3)):await installCliBuiltInSkill(_0x5e106e['nonInteractive']),{'ok':!![]};}export const updateDefinition={'service':a59_0x558648(0x1df),'command':a59_0x558648(0x1d9),'description':'Update\x20'+CLI_BIN_NAME+a59_0x558648(0x201),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x5955d0=a60_0x4d13;(function(_0x34f494,_0x32970a){const _0x313a5b=a60_0x4d13,_0x2d3419=_0x34f494();while(!![]){try{const _0xe47a2e=parseInt(_0x313a5b(0x17a))/0x1*(-parseInt(_0x313a5b(0x16f))/0x2)+-parseInt(_0x313a5b(0x16c))/0x3+-parseInt(_0x313a5b(0x175))/0x4+parseInt(_0x313a5b(0x154))/0x5+-parseInt(_0x313a5b(0x157))/0x6*(parseInt(_0x313a5b(0x152))/0x7)+-parseInt(_0x313a5b(0x155))/0x8+parseInt(_0x313a5b(0x156))/0x9;if(_0xe47a2e===_0x32970a)break;else _0x2d3419['push'](_0x2d3419['shift']());}catch(_0x4c9b92){_0x2d3419['push'](_0x2d3419['shift']());}}}(a60_0x3d4d,0xe708e));import{CLI_BIN_NAME}from'../../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../../constant/env.js';import{CliErrors}from'../../errors.js';import{readConfigFile,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';function a60_0x3d4d(){const _0x3c396b=['../../commands/app/remote-source.js','string','appCode','accessKey','join','../../core/api-client.js','Invalid\x20env\x20\x22','defaultApp','appName','envName','\x20--appcode\x20<code>\x20[--env\x20daily]','map','boolean','App\x20name\x20to\x20bind\x20as\x20the\x20current\x20workspace\x20default','Resolving\x20--app\x20requires\x20accessKey.\x20Pass\x20--appcode\x20directly,\x20or\x20set\x20accessKey\x20before\x20running\x20','3895962swYgbV','\x0aAccessKey:\x20not\x20written','filter','542cYRAfF','from','validation','authRequired','\x20--app\x20<name>\x20[--env\x20daily]\x20or\x20','write','2155720lUJzuA','length','\x20workspace\x20','Target\x20environment','app','69hXewje','appcode','env','str','Available\x20apps:\x20','App\x20\x22','\x22\x20not\x20found.','trim','apps','command','\x0aEnv:\x20','Usage:\x20','21YnjHdl','project','7583400UwwFsx','13646272AlkLOQ','43247979amxVNz','3627252XZnvkd','yes','items','Set\x20app\x20context\x20for\x20the\x20current\x20workspace','use','object'];a60_0x3d4d=function(){return _0x3c396b;};return a60_0x3d4d();}const WORKSPACE_USE_FLAGS=[{'name':'app','type':a60_0x5955d0(0x15e),'description':a60_0x5955d0(0x16a)},{'name':a60_0x5955d0(0x17b),'type':a60_0x5955d0(0x15e),'description':'App\x20code\x20to\x20bind\x20directly'},{'name':'env','type':a60_0x5955d0(0x15e),'description':a60_0x5955d0(0x178),'enum':[...RUNTIME_ENV_VALUES]},{'name':a60_0x5955d0(0x158),'type':a60_0x5955d0(0x169),'description':'Compatibility\x20flag;\x20workspace\x20config\x20updates\x20are\x20non-interactive','default':![]}];async function executeWorkspaceUse(_0xc1dad0,_0x3efb78){const _0x244885=a60_0x5955d0,_0x2d170c=_0xc1dad0[_0x244885(0x17d)](_0x244885(0x179))['trim'](),_0x3863a4=_0xc1dad0[_0x244885(0x17d)](_0x244885(0x17b))[_0x244885(0x14d)](),_0x4833fb=_0xc1dad0[_0x244885(0x17d)](_0x244885(0x17c))['trim'](),_0xb203cf=resolveWorkspaceEnv(_0x4833fb||_0xc1dad0[_0x244885(0x166)]||DEFAULT_CONFIG_VALUES[_0x244885(0x17c)]);if(!_0x2d170c&&!_0x3863a4)throw CliErrors[_0x244885(0x171)]('Missing\x20workspace\x20app\x20selector.',_0x244885(0x151)+CLI_BIN_NAME+_0x244885(0x177)+_0x3efb78+_0x244885(0x173)+CLI_BIN_NAME+_0x244885(0x177)+_0x3efb78+_0x244885(0x167));const _0x3d7dd5=_0x3863a4||await resolveRemoteAppCode({'command':_0x3efb78,'appName':_0x2d170c,'env':_0xb203cf,'accessKey':_0xc1dad0[_0x244885(0x160)]}),_0x6444d5=writeWorkspaceConfig({'command':_0x3efb78,'appName':_0x2d170c,'appcode':_0x3d7dd5,'env':_0xb203cf,'shouldWriteEnv':!!_0x4833fb,'accessKey':_0xc1dad0[_0x244885(0x160)]});return{'ok':!![],'data':{'configPath':_0x6444d5,'app':_0x2d170c||null,'appcode':_0x3d7dd5,'env':_0x4833fb?_0xb203cf:null,'accessKeyWritten':![],'command':'workspace\x20'+_0x3efb78},'message':buildWorkspaceMessage(_0x6444d5,_0x2d170c,_0x3d7dd5,_0x4833fb?_0xb203cf:undefined)};}async function resolveRemoteAppCode(_0x257119){const _0x3438c4=a60_0x5955d0;if(!_0x257119[_0x3438c4(0x160)])throw CliErrors[_0x3438c4(0x172)](_0x3438c4(0x16b)+CLI_BIN_NAME+_0x3438c4(0x177)+_0x257119[_0x3438c4(0x14f)]+'.');const {setActiveAK:_0x9c4aa3}=await import(_0x3438c4(0x162)),{getRemoteAppList:_0x266a7e}=await import(_0x3438c4(0x15d));_0x9c4aa3(_0x257119[_0x3438c4(0x160)]);const _0x9d4849=await _0x266a7e({'env':_0x257119[_0x3438c4(0x17c)],'accessKey':_0x257119[_0x3438c4(0x160)],'noCache':![]}),_0x458f71=findAppByName(_0x9d4849[_0x3438c4(0x159)],_0x257119['appName']);if(_0x458f71&&!isRuntimeAccessibleApp(_0x458f71))throw runtimeInaccessibleAppError(_0x458f71,'\x22'+_0x257119[_0x3438c4(0x165)]+'\x22');const _0x2ded3b=_0x458f71?.[_0x3438c4(0x15f)]?.[_0x3438c4(0x14d)]();if(_0x2ded3b)return _0x2ded3b;const _0x24de21=_0x9d4849[_0x3438c4(0x159)][_0x3438c4(0x168)](_0x38226f=>_0x38226f[_0x3438c4(0x165)])[_0x3438c4(0x16e)](Boolean),_0x13af7d=_0x24de21[_0x3438c4(0x176)]?_0x3438c4(0x17e)+Array[_0x3438c4(0x170)](new Set(_0x24de21))[_0x3438c4(0x161)](',\x20')+'.':'Run\x20`'+CLI_BIN_NAME+'\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20pass\x20--appcode\x20directly.';throw CliErrors[_0x3438c4(0x171)](_0x3438c4(0x17f)+_0x257119['appName']+_0x3438c4(0x14c),_0x13af7d);}function writeWorkspaceConfig(_0x12c8d9){const _0x28c046=a60_0x5955d0,_0x5d1fb6=resolveWriteConfigPath(_0x28c046(0x153)),_0x18a456=readConfigFile(_0x5d1fb6);_0x12c8d9['shouldWriteEnv']&&(_0x18a456[_0x28c046(0x17c)]=_0x12c8d9[_0x28c046(0x17c)]);if(_0x12c8d9[_0x28c046(0x165)]){const _0x13cd84=isRecord(_0x18a456[_0x28c046(0x14e)])?{..._0x18a456[_0x28c046(0x14e)]}:{},_0x3cd72e=isRecord(_0x13cd84[_0x12c8d9[_0x28c046(0x165)]])?_0x13cd84[_0x12c8d9['appName']]:{};_0x13cd84[_0x12c8d9['appName']]={..._0x3cd72e,'appcode':_0x12c8d9['appcode']},_0x18a456[_0x28c046(0x14e)]=_0x13cd84,_0x18a456[_0x28c046(0x164)]=_0x12c8d9[_0x28c046(0x165)];if(_0x18a456[_0x28c046(0x179)])delete _0x18a456['app'];return writeAndReturn(_0x5d1fb6,_0x18a456);}_0x18a456['appcode']=_0x12c8d9[_0x28c046(0x17b)];if(_0x18a456['app'])delete _0x18a456['app'];return writeAndReturn(_0x5d1fb6,_0x18a456);}function writeAndReturn(_0x2405e3,_0x7fce06){return writeConfigFile(_0x2405e3,_0x7fce06),_0x2405e3;}function resolveWorkspaceEnv(_0x38665){const _0x417114=a60_0x5955d0;if(RUNTIME_ENV_VALUES['includes'](_0x38665))return _0x38665;throw CliErrors[_0x417114(0x171)](_0x417114(0x163)+_0x38665+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x417114(0x161)](',\x20'));}function buildWorkspaceMessage(_0x7706d2,_0x525227,_0x172de2,_0x4d3736){const _0x4af39e=a60_0x5955d0,_0x58acef=_0x525227?_0x525227+'\x20('+_0x172de2+')':_0x172de2,_0x30563d=_0x4d3736?_0x4af39e(0x150)+_0x4d3736:'';return'Workspace\x20configured.\x0aConfig\x20file:\x20'+_0x7706d2+'\x0aDefault\x20app:\x20'+_0x58acef+_0x30563d+_0x4af39e(0x16d);}function isRecord(_0x2eaf74){const _0x4adb74=a60_0x5955d0;return typeof _0x2eaf74===_0x4adb74(0x15c)&&_0x2eaf74!==null&&!Array['isArray'](_0x2eaf74);}function makeWorkspaceCommand(_0x2cc8d1){const _0x451074=a60_0x5955d0;return{'service':'workspace','command':_0x2cc8d1,'description':_0x2cc8d1==='init'?'Initialize\x20app\x20context\x20for\x20the\x20current\x20workspace':_0x451074(0x15a),'risk':_0x451074(0x174),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':WORKSPACE_USE_FLAGS,async 'execute'(_0x29419b){return executeWorkspaceUse(_0x29419b,_0x2cc8d1);}};}function a60_0x4d13(_0x14bde2,_0x2a024c){_0x14bde2=_0x14bde2-0x14c;const _0x3d4dec=a60_0x3d4d();let _0x4d1322=_0x3d4dec[_0x14bde2];return _0x4d1322;}export const workspaceDefinitions=[makeWorkspaceCommand('init'),makeWorkspaceCommand(a60_0x5955d0(0x15b))];
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x47c011=a61_0xad91;(function(_0x56cd45,_0x3cafb3){const _0x581641=a61_0xad91,_0x5e8a10=_0x56cd45();while(!![]){try{const _0x522288=-parseInt(_0x581641(0x161))/0x1*(parseInt(_0x581641(0x159))/0x2)+-parseInt(_0x581641(0x158))/0x3+parseInt(_0x581641(0x151))/0x4*(-parseInt(_0x581641(0x162))/0x5)+parseInt(_0x581641(0x170))/0x6*(-parseInt(_0x581641(0x16e))/0x7)+-parseInt(_0x581641(0x16c))/0x8+parseInt(_0x581641(0x163))/0x9*(-parseInt(_0x581641(0x154))/0xa)+-parseInt(_0x581641(0x16d))/0xb*(-parseInt(_0x581641(0x15e))/0xc);if(_0x522288===_0x3cafb3)break;else _0x5e8a10['push'](_0x5e8a10['shift']());}catch(_0x85baa1){_0x5e8a10['push'](_0x5e8a10['shift']());}}}(a61_0xb41f,0x989b2));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';function a61_0xb41f(){const _0x18b80a=['743118WYTmig','map','44GYmpnm','importable','Locale','1820KIWhtR','Target\x20environment','Override\x20user\x20domain','Override\x20API\x20domain','3633549goeeYz','11942CFYoQz',';\x20local\x20alias:\x20apps.<alias>.appcode','format','Default\x20page\x20size','cliSettableTopLevel','276qWFYBb','Access\x20key\x20(client-ak\x20auth)','env','22cOYcQD','486090jiXQLt','39978peGIPT','Default\x20output\x20format','Config\x20key.\x20Top-level:\x20','locale','fromEntries','Override\x20runtime\x20domain','entries','Risk\x20level','enumValues','5693352uAtkFL','2238731bFYJlu','7QDSVBp','Override\x20SkillHub\x20domain'];a61_0xb41f=function(){return _0x18b80a;};return a61_0xb41f();}export const CONFIG_FIELD_SCHEMAS={'env':{'description':a61_0x47c011(0x155),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x47c011(0x160)],'importable':!![]},'format':{'description':a61_0x47c011(0x164),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x47c011(0x15b)],'importable':!![]},'pageSize':{'description':a61_0x47c011(0x15c),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a61_0x47c011(0x157),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a61_0x47c011(0x156),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a61_0x47c011(0x168),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'skillHubDomain':{'description':a61_0x47c011(0x16f),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':a61_0x47c011(0x15f),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a61_0x47c011(0x16a),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES['riskLevel'],'importable':!![]},'locale':{'description':a61_0x47c011(0x153),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x47c011(0x166)],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object[a61_0x47c011(0x169)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x17bc94])=>_0x17bc94[a61_0x47c011(0x15d)])['map'](([_0xb4b691])=>_0xb4b691));export const CONFIG_ENUM_VALUES=Object[a61_0x47c011(0x167)](Object[a61_0x47c011(0x169)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0xde84c0])=>_0xde84c0[a61_0x47c011(0x16b)])[a61_0x47c011(0x171)](([_0x3bf2ec,_0x2b5dd5])=>[_0x3bf2ec,[..._0x2b5dd5[a61_0x47c011(0x16b)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object[a61_0x47c011(0x169)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x3fea1d])=>_0x3fea1d[a61_0x47c011(0x152)])[a61_0x47c011(0x171)](([_0x5df2e3])=>_0x5df2e3);export function getConfigFieldSchema(_0x10747e){return CONFIG_FIELD_SCHEMAS[_0x10747e];}export function getConfigEnumValues(_0x3e4aee){const _0x186c92=a61_0x47c011;return getConfigFieldSchema(_0x3e4aee)?.[_0x186c92(0x16b)];}export function getConfigDefaultValue(_0x1c33ba){return getConfigFieldSchema(_0x1c33ba)?.['defaultValue'];}export function isTopLevelConfigKey(_0x2e90af){return TOP_LEVEL_CONFIG_KEYS['has'](_0x2e90af);}export function isLegacyCompatConfigKey(_0x273d0d){return getConfigFieldSchema(_0x273d0d)?.['legacyCompatOnly']===!![];}function a61_0xad91(_0x3634a7,_0x3c214c){_0x3634a7=_0x3634a7-0x151;const _0xb41fd2=a61_0xb41f();let _0xad9153=_0xb41fd2[_0x3634a7];return _0xad9153;}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x3c5d7d){return[..._0x3c5d7d]['join'](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x1b80b7=a61_0x47c011;return _0x1b80b7(0x165)+getTopLevelConfigKeySummary()+_0x1b80b7(0x15a);}export function buildAppProfileListFields(_0x46f16f){return{'env':_0x46f16f,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
package/lib/constant/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a62_0x468dc0=a62_0x46b0;(function(_0x53dd03,_0x3a5554){const _0xa13a91=a62_0x46b0,_0x561f37=_0x53dd03();while(!![]){try{const _0x3a436f=parseInt(_0xa13a91(0x113))/0x1*(-parseInt(_0xa13a91(0x115))/0x2)+parseInt(_0xa13a91(0x11d))/0x3+-parseInt(_0xa13a91(0x11c))/0x4+parseInt(_0xa13a91(0x116))/0x5*(parseInt(_0xa13a91(0x117))/0x6)+parseInt(_0xa13a91(0x114))/0x7+-parseInt(_0xa13a91(0x118))/0x8+parseInt(_0xa13a91(0x11a))/0x9;if(_0x3a436f===_0x3a5554)break;else _0x561f37['push'](_0x561f37['shift']());}catch(_0x474f64){_0x561f37['push'](_0x561f37['shift']());}}}(a62_0x2c5d,0xbea50));export const APP_PUBLISH_STATUS={'Published':a62_0x468dc0(0x11b),'Unpublished':a62_0x468dc0(0x112)};function a62_0x46b0(_0x5b0f78,_0x29d071){_0x5b0f78=_0x5b0f78-0x112;const _0x2c5d29=a62_0x2c5d();let _0x46b08e=_0x2c5d29[_0x5b0f78];return _0x46b08e;}export const RUNTIME_ACCESSIBLE_APP_STATUS=APP_PUBLISH_STATUS[a62_0x468dc0(0x119)];function a62_0x2c5d(){const _0x18bb5f=['2230905gCbghh','6StNdeJ','7168208wQuVlD','Published','17531235PISIFu','PUBLISHED','1321404TPQFzI','753000jKVZYD','UNPUBLISH','231331GexxLl','3631712PzSElz','10TCsvyi'];a62_0x2c5d=function(){return _0x18bb5f;};return a62_0x2c5d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3b5b5b,_0x2a737c){const _0x16a8da=a63_0x5687,_0xc17dfc=_0x3b5b5b();while(!![]){try{const _0x52dc30=parseInt(_0x16a8da(0x96))/0x1+-parseInt(_0x16a8da(0x95))/0x2+parseInt(_0x16a8da(0x99))/0x3*(-parseInt(_0x16a8da(0x9a))/0x4)+-parseInt(_0x16a8da(0x9b))/0x5+-parseInt(_0x16a8da(0x93))/0x6+parseInt(_0x16a8da(0x97))/0x7+parseInt(_0x16a8da(0x94))/0x8*(parseInt(_0x16a8da(0x92))/0x9);if(_0x52dc30===_0x2a737c)break;else _0xc17dfc['push'](_0xc17dfc['shift']());}catch(_0x5222c6){_0xc17dfc['push'](_0xc17dfc['shift']());}}}(a63_0x3299,0xceabf));function a63_0x3299(){const _0x4793cf=['9mQoyeC','5207340zirUmK','30938800vqiCwk','2771024ummfgV','1026303LuRDTO','3006528LiRZYV','ClientAk','1243146psaFrD','12NecbOU','4900410CYzxwo'];a63_0x3299=function(){return _0x4793cf;};return a63_0x3299();}function a63_0x5687(_0x5068bd,_0x5125b7){_0x5068bd=_0x5068bd-0x92;const _0x329913=a63_0x3299();let _0x568756=_0x329913[_0x5068bd];return _0x568756;}export const AUTH_MODE={'ClientAk':'client-ak'};export function isAuthMode(_0xccc33e){const _0x1424f2=a63_0x5687;return _0xccc33e===AUTH_MODE[_0x1424f2(0x98)];}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x5c6071=a64_0x329b;(function(_0x5262c8,_0x452f88){const _0x7a47df=a64_0x329b,_0x160e0b=_0x5262c8();while(!![]){try{const _0x341490=parseInt(_0x7a47df(0x14b))/0x1+parseInt(_0x7a47df(0x168))/0x2+parseInt(_0x7a47df(0x14c))/0x3+parseInt(_0x7a47df(0x157))/0x4+-parseInt(_0x7a47df(0x164))/0x5*(parseInt(_0x7a47df(0x142))/0x6)+-parseInt(_0x7a47df(0x140))/0x7*(parseInt(_0x7a47df(0x154))/0x8)+parseInt(_0x7a47df(0x15d))/0x9*(-parseInt(_0x7a47df(0x15f))/0xa);if(_0x341490===_0x452f88)break;else _0x160e0b['push'](_0x160e0b['shift']());}catch(_0x3257b3){_0x160e0b['push'](_0x160e0b['shift']());}}}(a64_0x3dad,0xc5ee2));import{PRODUCT_CONFIG}from'../constant/product.js';function a64_0x329b(_0x2699f0,_0x60ca27){_0x2699f0=_0x2699f0-0x13d;const _0x3dad00=a64_0x3dad();let _0x329b75=_0x3dad00[_0x2699f0];return _0x329b75;}import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG[a64_0x5c6071(0x15a)];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a64_0x5c6071(0x167)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a64_0x5c6071(0x14a),'type':'string','description':a64_0x5c6071(0x14f),'hint':'<code>'},{'name':'app','meowKey':'app','type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a64_0x5c6071(0x161)},{'name':a64_0x5c6071(0x13d),'meowKey':a64_0x5c6071(0x13d),'type':'string','description':a64_0x5c6071(0x147),'hint':a64_0x5c6071(0x149)},{'name':'format','meowKey':a64_0x5c6071(0x153),'type':a64_0x5c6071(0x15b),'description':'Output\x20format','hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a64_0x5c6071(0x15b),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','hint':a64_0x5c6071(0x15e)},{'name':'dry-run','meowKey':a64_0x5c6071(0x151),'type':a64_0x5c6071(0x155),'description':a64_0x5c6071(0x145)},{'name':a64_0x5c6071(0x156),'meowKey':a64_0x5c6071(0x156),'type':'boolean','description':a64_0x5c6071(0x159)},{'name':a64_0x5c6071(0x169),'meowKey':a64_0x5c6071(0x160),'type':a64_0x5c6071(0x155),'description':a64_0x5c6071(0x16c)},{'name':a64_0x5c6071(0x16b),'meowKey':a64_0x5c6071(0x16b),'type':'boolean','description':a64_0x5c6071(0x16d)},{'name':'ci','meowKey':'ci','type':a64_0x5c6071(0x155),'description':a64_0x5c6071(0x158),'hidden':!![]},{'name':a64_0x5c6071(0x144),'meowKey':a64_0x5c6071(0x144),'type':a64_0x5c6071(0x155),'description':a64_0x5c6071(0x152)},{'name':'id','meowKey':'id','type':a64_0x5c6071(0x15b),'description':a64_0x5c6071(0x146),'hidden':!![]},{'name':a64_0x5c6071(0x148),'meowKey':'name','type':a64_0x5c6071(0x15b),'description':a64_0x5c6071(0x16a),'hidden':!![]},{'name':a64_0x5c6071(0x150),'meowKey':a64_0x5c6071(0x150),'type':'string','description':'SQL\x20query\x20code','hidden':!![]},{'name':a64_0x5c6071(0x143),'meowKey':'params','type':a64_0x5c6071(0x15b),'description':a64_0x5c6071(0x13e),'hidden':!![]},{'name':a64_0x5c6071(0x163),'meowKey':'verbose','type':a64_0x5c6071(0x155),'description':a64_0x5c6071(0x165),'hidden':!![]},{'name':a64_0x5c6071(0x15c),'meowKey':a64_0x5c6071(0x15c),'type':a64_0x5c6071(0x155),'description':a64_0x5c6071(0x13f),'hidden':!![]}];function a64_0x3dad(){const _0x57e508=['help','Preview\x20operation\x20without\x20executing','Record\x20ID','Environment','name','production\x20|\x20development\x20|\x20daily','appcode','1525546hcAczg','176418weveEn','meowKey','app','Override\x20appcode','sqlcode','dryRun','Show\x20help','format','152mfttPj','boolean','yes','4235652SzBsaT','Alias\x20for\x20--non-interactive','Skip\x20confirmation\x20for\x20high-risk\x20writes','cliBinName','string','clear','3519PrHUUW','<expr>','29760hnDWGv','nonInteractive','<name>','dry-run','verbose','663185UGFiFQ','Verbose\x20output','type','cliDisplayName','1412494Gezvpy','non-interactive','Name\x20filter','global','Force\x20non-interactive\x20mode\x20(CI)','Use\x20global\x20config\x20scope','env','JSON\x20params\x20for\x20execute\x20commands','Clear\x20output','311178KdTwqb','fromEntries','24HmBNhX','params'];a64_0x3dad=function(){return _0x57e508;};return a64_0x3dad();}export const PIPELINE_FLAG_NAMES=new Set(['appcode',a64_0x5c6071(0x14e),a64_0x5c6071(0x13d),'format','jq',a64_0x5c6071(0x162),'yes','non-interactive','ci']);export function buildMeowFlags(){const _0x2b88cf=a64_0x5c6071;return Object[_0x2b88cf(0x141)](GLOBAL_FLAGS['map'](_0x17fb3c=>[_0x17fb3c[_0x2b88cf(0x14d)],{'type':_0x17fb3c[_0x2b88cf(0x166)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a65_0x158593=a65_0x3b5f;function a65_0x3b5f(_0x3c9c4c,_0x157acd){_0x3c9c4c=_0x3c9c4c-0x103;const _0x2b69f8=a65_0x2b69();let _0x3b5fa0=_0x2b69f8[_0x3c9c4c];return _0x3b5fa0;}function a65_0x2b69(){const _0x1acf4f=['compress','5557320mPxiwi','726748lBjYgG','en-US','78516FjcSde','36svbYrb','6772IDLjUH','main','10uUkLjc','6HRYOiX','65624qPSCbQ','754537GqvNxW','3488103WXeNGY','1630axwMpk'];a65_0x2b69=function(){return _0x1acf4f;};return a65_0x2b69();}(function(_0x29ac03,_0x48c9e7){const _0x1479fb=a65_0x3b5f,_0x5c84b3=_0x29ac03();while(!![]){try{const _0x58d12e=parseInt(_0x1479fb(0x106))/0x1+-parseInt(_0x1479fb(0x10c))/0x2*(-parseInt(_0x1479fb(0x10b))/0x3)+-parseInt(_0x1479fb(0x108))/0x4*(-parseInt(_0x1479fb(0x10f))/0x5)+-parseInt(_0x1479fb(0x107))/0x6*(parseInt(_0x1479fb(0x10d))/0x7)+parseInt(_0x1479fb(0x103))/0x8+-parseInt(_0x1479fb(0x10e))/0x9+parseInt(_0x1479fb(0x10a))/0xa*(parseInt(_0x1479fb(0x104))/0xb);if(_0x58d12e===_0x48c9e7)break;else _0x5c84b3['push'](_0x5c84b3['shift']());}catch(_0x45e079){_0x5c84b3['push'](_0x5c84b3['shift']());}}}(a65_0x2b69,0x6724e));export const DEFAULT_APP_PROFILE_NAME=a65_0x158593(0x109);export const DEFAULT_CONFIG_VALUES={'env':'production','format':'compress','locale':a65_0x158593(0x105),'riskLevel':'write'};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a65_0x158593(0x110);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x4e6eec=a66_0x2301;(function(_0x560196,_0x479fc0){const _0x1d886b=a66_0x2301,_0x253864=_0x560196();while(!![]){try{const _0x8a0a81=parseInt(_0x1d886b(0xae))/0x1+parseInt(_0x1d886b(0xb5))/0x2+parseInt(_0x1d886b(0xb0))/0x3*(parseInt(_0x1d886b(0xaf))/0x4)+-parseInt(_0x1d886b(0xb7))/0x5+parseInt(_0x1d886b(0xb6))/0x6+-parseInt(_0x1d886b(0xb1))/0x7+-parseInt(_0x1d886b(0xb2))/0x8*(-parseInt(_0x1d886b(0xb4))/0x9);if(_0x8a0a81===_0x479fc0)break;else _0x253864['push'](_0x253864['shift']());}catch(_0x2679aa){_0x253864['push'](_0x253864['shift']());}}}(a66_0x457e,0xd63b3));import{PRODUCT_CONFIG}from'../constant/product.js';export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a66_0x4e6eec(0xb3)];function a66_0x457e(){const _0x10b3a2=['npmPackageName','27mBPrUw','1813130aNMXEI','2654136pQvOeQ','8223640HIBSZU','skillSource','npmRegistryBaseUrl','1259585fWXlyv','236WKSYFo','39222xNJHUc','9054514ENXzke','1162264GBacfq'];a66_0x457e=function(){return _0x10b3a2;};return a66_0x457e();}function a66_0x2301(_0xde0cf5,_0x35da1e){_0xde0cf5=_0xde0cf5-0xae;const _0x457e8d=a66_0x457e();let _0x23012b=_0x457e8d[_0xde0cf5];return _0x23012b;}export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG[a66_0x4e6eec(0xb8)];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG[a66_0x4e6eec(0xb9)];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a67_0x5bd1(_0x2f324e,_0x37393b){_0x2f324e=_0x2f324e-0xbc;const _0x25f051=a67_0x25f0();let _0x5bd1b7=_0x25f051[_0x2f324e];return _0x5bd1b7;}const a67_0x263295=a67_0x5bd1;(function(_0x54ccce,_0x3dbc72){const _0x42ef87=a67_0x5bd1,_0x131052=_0x54ccce();while(!![]){try{const _0x3eaa05=-parseInt(_0x42ef87(0xbd))/0x1+-parseInt(_0x42ef87(0xc2))/0x2+parseInt(_0x42ef87(0xc6))/0x3+-parseInt(_0x42ef87(0xc0))/0x4*(parseInt(_0x42ef87(0xbc))/0x5)+-parseInt(_0x42ef87(0xc9))/0x6*(parseInt(_0x42ef87(0xc1))/0x7)+-parseInt(_0x42ef87(0xcb))/0x8+parseInt(_0x42ef87(0xcc))/0x9;if(_0x3eaa05===_0x3dbc72)break;else _0x131052['push'](_0x131052['shift']());}catch(_0x6d04d){_0x131052['push'](_0x131052['shift']());}}}(a67_0x25f0,0xaebc4));import{getEnv,isProduction}from'../constant/env.js';import{PRODUCT_CONFIG}from'../constant/product.js';let customApiDomain,customUserDomain,customRuntimeDomain,customSkillHubDomain;export function initDomains(_0x28456d){const _0x43c44d=a67_0x5bd1;customApiDomain=_0x28456d?.[_0x43c44d(0xcd)],customUserDomain=_0x28456d?.['userDomain'],customRuntimeDomain=_0x28456d?.[_0x43c44d(0xc3)],customSkillHubDomain=_0x28456d?.[_0x43c44d(0xc5)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a67_0x263295(0xbf)]['production'][a67_0x263295(0xc8)]:PRODUCT_CONFIG[a67_0x263295(0xbf)][a67_0x263295(0xc7)]['user']);export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a67_0x263295(0xbf)]['production']['api']:PRODUCT_CONFIG[a67_0x263295(0xbf)][a67_0x263295(0xc7)][a67_0x263295(0xc4)]);export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a67_0x263295(0xbf)]['production']['runtime']:PRODUCT_CONFIG[a67_0x263295(0xbf)][a67_0x263295(0xc7)]['runtime']);function a67_0x25f0(){const _0x151e8f=['runtimeDomain','api','skillHubDomain','264354jwgCiV','nonProduction','user','48CRfABc','production','3959096AJufuG','37592424nElpby','apiDomain','905YDNucw','726204xDwFxX','skillhub','domains','25524yhadcA','969157lmXXkU','131356nkbfNw'];a67_0x25f0=function(){return _0x151e8f;};return a67_0x25f0();}export const getSkillHubDomain=()=>customSkillHubDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a67_0x263295(0xbf)][a67_0x263295(0xca)][a67_0x263295(0xbe)]:PRODUCT_CONFIG['domains'][a67_0x263295(0xc7)][a67_0x263295(0xbe)]);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0x286084=a68_0x310c;function a68_0x310c(_0x32e52c,_0x142559){_0x32e52c=_0x32e52c-0x1c6;const _0x484c0e=a68_0x484c();let _0x310c73=_0x484c0e[_0x32e52c];return _0x310c73;}(function(_0x203060,_0x1e7dff){const _0x5c7288=a68_0x310c,_0x2b0797=_0x203060();while(!![]){try{const _0x318f93=-parseInt(_0x5c7288(0x1d2))/0x1*(parseInt(_0x5c7288(0x1c6))/0x2)+-parseInt(_0x5c7288(0x1d0))/0x3*(-parseInt(_0x5c7288(0x1cc))/0x4)+-parseInt(_0x5c7288(0x1cb))/0x5+-parseInt(_0x5c7288(0x1d1))/0x6*(-parseInt(_0x5c7288(0x1cf))/0x7)+parseInt(_0x5c7288(0x1c9))/0x8+parseInt(_0x5c7288(0x1d4))/0x9+-parseInt(_0x5c7288(0x1ca))/0xa*(parseInt(_0x5c7288(0x1d3))/0xb);if(_0x318f93===_0x1e7dff)break;else _0x2b0797['push'](_0x2b0797['shift']());}catch(_0x21332f){_0x2b0797['push'](_0x2b0797['shift']());}}}(a68_0x484c,0x5c699));import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=[a68_0x286084(0x1c7),a68_0x286084(0x1c8),'daily'];export function normalizeEnv(_0x144619){const _0x54bbb1=a68_0x286084;return _0x144619===_0x54bbb1(0x1ce)?_0x54bbb1(0x1c7):_0x144619;}export function isProduction(_0x58ad34){const _0x3644b7=a68_0x286084;return normalizeEnv(_0x58ad34)===_0x3644b7(0x1c7);}export function isDaily(_0x490242){const _0x56ec17=a68_0x286084;return normalizeEnv(_0x490242)===_0x56ec17(0x1cd);}export function isDev(_0x47343e){const _0x5c6398=normalizeEnv(_0x47343e);return _0x5c6398==='development'||_0x5c6398==='dev';}let env=normalizeEnv(productEnv('ENV')||a68_0x286084(0x1c7));export function getEnv(){return env;}function a68_0x484c(){const _0x1d8848=['4WRcknb','daily','online','7ebxgOV','1094655JLdArW','635436pQJNxn','281cdzFGq','11GwptWj','6491421uRbsKV','588bKQAQv','production','development','3799448Aunutt','5998930oJAmpS','3029815FBsunq'];a68_0x484c=function(){return _0x1d8848;};return a68_0x484c();}export function initEnv(_0x4ca7b8){env=normalizeEnv(_0x4ca7b8);}
|