@lovrabet/lovrabet-cli 2.3.3 → 2.3.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -3
- 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/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.d.ts +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.d.ts +2 -2
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +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.d.ts +4 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.d.ts +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.d.ts +7 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +12 -3
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +5 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +4 -2
- package/skills/lovrabet/guides/troubleshooting.md +1 -1
- package/skills/lovrabet/references/lovrabet-config-commands.md +8 -7
- package/skills/lovrabet/references/lovrabet-config.md +4 -3
- package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +14 -2
- package/skills/lovrabet/references/lovrabet-service-tree.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x20ba2c=a127_0x1252;function a127_0x1252(_0x3fce48,_0x2877ba){_0x3fce48=_0x3fce48-0xc6;const _0x5951d9=a127_0x5951();let _0x1252e1=_0x5951d9[_0x3fce48];return _0x1252e1;}function a127_0x5951(){const _0x59dbf9=['runtimeDomain','kbServiceDomain','enterprise','1089305eEIKTh','2005BoCBTi','1046Awjixn','8167430PQhzKu','64kLljlt','lovrabet-routing/v1','e3423cad71c22edb18a8481be7bdb733ff2d4136c31aa3ae6da56271e32cced7','userDomain','156537XMYyBl','apiDomain','552228oxSfbO','1557LOVRcL','135954IHOfDj','1020DONHJQ'];a127_0x5951=function(){return _0x59dbf9;};return a127_0x5951();}(function(_0x2e2995,_0xbde3ac){const _0x1f124f=a127_0x1252,_0x8b7e86=_0x2e2995();while(!![]){try{const _0x24b368=-parseInt(_0x1f124f(0xd5))/0x1+-parseInt(_0x1f124f(0xcb))/0x2*(parseInt(_0x1f124f(0xd4))/0x3)+-parseInt(_0x1f124f(0xd3))/0x4+parseInt(_0x1f124f(0xca))/0x5*(-parseInt(_0x1f124f(0xd6))/0x6)+-parseInt(_0x1f124f(0xc9))/0x7+parseInt(_0x1f124f(0xcd))/0x8*(parseInt(_0x1f124f(0xd1))/0x9)+parseInt(_0x1f124f(0xcc))/0xa;if(_0x24b368===_0xbde3ac)break;else _0x8b7e86['push'](_0x8b7e86['shift']());}catch(_0x362601){_0x8b7e86['push'](_0x8b7e86['shift']());}}}(a127_0x5951,0x2d91e));export const ENTERPRISE_ROUTING_SCHEMA_DIGEST=a127_0x20ba2c(0xcf);export const ENTERPRISE_ROUTING_PROTOCOL=a127_0x20ba2c(0xce);export const ENTERPRISE_ROUTING_KIND=a127_0x20ba2c(0xc8);export const ENTERPRISE_ROUTING_DOMAIN_FIELDS=[a127_0x20ba2c(0xd0),a127_0x20ba2c(0xd2),a127_0x20ba2c(0xc6),'skillDomain',a127_0x20ba2c(0xc7)];export const REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS=[a127_0x20ba2c(0xd0),a127_0x20ba2c(0xd2),a127_0x20ba2c(0xc6),'skillDomain'];
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x90c2eb,_0x344444){const _0x2cc8b9=a128_0x439c,_0x5a4226=_0x90c2eb();while(!![]){try{const _0x588d5e=-parseInt(_0x2cc8b9(0x1f9))/0x1*(-parseInt(_0x2cc8b9(0x1f8))/0x2)+parseInt(_0x2cc8b9(0x1ef))/0x3*(-parseInt(_0x2cc8b9(0x1f1))/0x4)+-parseInt(_0x2cc8b9(0x1ec))/0x5*(parseInt(_0x2cc8b9(0x1f7))/0x6)+-parseInt(_0x2cc8b9(0x1fb))/0x7*(parseInt(_0x2cc8b9(0x1f3))/0x8)+-parseInt(_0x2cc8b9(0x1ed))/0x9*(-parseInt(_0x2cc8b9(0x1eb))/0xa)+-parseInt(_0x2cc8b9(0x1ee))/0xb*(-parseInt(_0x2cc8b9(0x1f6))/0xc)+parseInt(_0x2cc8b9(0x1f5))/0xd*(parseInt(_0x2cc8b9(0x1fa))/0xe);if(_0x588d5e===_0x344444)break;else _0x5a4226['push'](_0x5a4226['shift']());}catch(_0x44c58d){_0x5a4226['push'](_0x5a4226['shift']());}}}(a128_0x4242,0x374f2));import{jsx as a128_0x181689,jsxs as a128_0x1a5ea7}from'react/jsx-runtime';import{useEffect}from'react';import{Box,Text,useApp}from'ink';function a128_0x439c(_0x338398,_0x4d7368){_0x338398=_0x338398-0x1eb;const _0x424223=a128_0x4242();let _0x439c63=_0x424223[_0x338398];return _0x439c63;}function a128_0x4242(){const _0x1a9706=['2HOlaug','3893610eCyiOT','327264ydGako','380MHXKqy','25775KjRnDi','56655xFNTBj','908171FmowNa','3WzqxeG','\x20\x20Use\x20','743124UmYNcI','\x20to\x20view\x20available\x20commands.','40aWRtvj','green','13FVxOKs','12cgnIwc','438cUUpFW','422516dcKDRP'];a128_0x4242=function(){return _0x1a9706;};return a128_0x4242();}import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'./constant/cli.js';export function Help(){const _0xa0fbd9=a128_0x439c,{exit:_0x4ebb1e}=useApp();return useEffect(()=>{_0x4ebb1e();},[_0x4ebb1e]),a128_0x1a5ea7(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a128_0x181689(Box,{'children':a128_0x181689(Text,{'bold':!![],'color':_0xa0fbd9(0x1f4),'children':'\x20\x20'+CLI_DISPLAY_NAME})}),a128_0x1a5ea7(Box,{'marginTop':0x1,'children':[a128_0x181689(Text,{'dimColor':!![],'children':_0xa0fbd9(0x1f0)}),a128_0x181689(Text,{'bold':!![],'color':'green','children':CLI_BIN_NAME+'\x20--help'}),a128_0x181689(Text,{'dimColor':!![],'children':_0xa0fbd9(0x1f2)})]})]});}
|
package/lib/postinstall.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a129_0x2f6b(_0x31d644,_0x427903){_0x31d644=_0x31d644-0x162;const _0x2fb323=a129_0x2fb3();let _0x2f6ba5=_0x2fb323[_0x31d644];return _0x2f6ba5;}(function(_0x4fb790,_0x817429){const _0x3467b2=a129_0x2f6b,_0x5fa3aa=_0x4fb790();while(!![]){try{const _0x29ed32=parseInt(_0x3467b2(0x170))/0x1+-parseInt(_0x3467b2(0x169))/0x2*(-parseInt(_0x3467b2(0x172))/0x3)+-parseInt(_0x3467b2(0x171))/0x4+parseInt(_0x3467b2(0x17a))/0x5+parseInt(_0x3467b2(0x179))/0x6*(parseInt(_0x3467b2(0x174))/0x7)+parseInt(_0x3467b2(0x163))/0x8*(-parseInt(_0x3467b2(0x16a))/0x9)+parseInt(_0x3467b2(0x177))/0xa*(-parseInt(_0x3467b2(0x16d))/0xb);if(_0x29ed32===_0x817429)break;else _0x5fa3aa['push'](_0x5fa3aa['shift']());}catch(_0x3bc827){_0x5fa3aa['push'](_0x5fa3aa['shift']());}}}(a129_0x2fb3,0x827ff));import{installBuiltinSkill}from'./skills/builtin-skill.js';export async function runPostinstall(_0x55780c={}){const _0x46c87a=a129_0x2f6b,_0x18a20a=installBuiltinSkill(_0x55780c);if(_0x18a20a['ok']){const _0x329d8e=_0x18a20a['changed']?_0x46c87a(0x164):_0x46c87a(0x166),_0x38ff9c=_0x18a20a[_0x46c87a(0x173)]?_0x46c87a(0x162)+_0x18a20a['installedPath']:_0x46c87a(0x16e);return console[_0x46c87a(0x16b)](_0x46c87a(0x17b)+_0x18a20a[_0x46c87a(0x16c)]+'\x20'+_0x329d8e+_0x38ff9c),_0x18a20a;}const _0x11b293='[BUILTIN_SKILL_INSTALL_'+(_0x18a20a['code']??_0x46c87a(0x176))+']\x20'+(_0x18a20a[_0x46c87a(0x168)]??_0x46c87a(0x167))+'.\x20'+(_0x46c87a(0x16f)+_0x18a20a['repairCommand']);if(_0x18a20a[_0x46c87a(0x165)]===_0x46c87a(0x178))throw new Error(_0x11b293);return console[_0x46c87a(0x175)](_0x11b293),_0x18a20a;}function a129_0x2fb3(){const _0x3b743f=['\x20via\x20skills@latest','Repair\x20with:\x20','322256hhGZmg','1604396QtvxLj','2065701FPJMFW','installedPath','146237kTuKVI','warn','FAILED','16192290zcaiuv','SOURCE_INVALID','282disyCg','2874020opzTNG','Lovrabet\x20Built-in\x20Skill\x20','\x20at\x20','7784RhbOEC','installed','code','already\x20current','Installation\x20failed','error','2LswLln','117wrmGpd','log','skillVersion','11KNitpz'];a129_0x2fb3=function(){return _0x3b743f;};return a129_0x2fb3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a130_0x4139(){const _0x3d8c0=['risk','21dgzpfS','257077lcUpuR','666042MApxCY','944952kQuKgq','92dScDwj','650030CsMoBO','slice','write','4659347ffpnBW','4umUGZa','confirmationDescription','11517MlOcgx','description','string','10KETurf','trim','99aRkGsZ','25627548jSwQOJ','replace'];a130_0x4139=function(){return _0x3d8c0;};return a130_0x4139();}(function(_0xa1ad2d,_0x5656a6){const _0x5987f1=a130_0x593d,_0x426c21=_0xa1ad2d();while(!![]){try{const _0x23807d=-parseInt(_0x5987f1(0x11b))/0x1*(parseInt(_0x5987f1(0x10f))/0x2)+-parseInt(_0x5987f1(0x111))/0x3*(-parseInt(_0x5987f1(0x10a))/0x4)+parseInt(_0x5987f1(0x114))/0x5*(parseInt(_0x5987f1(0x11c))/0x6)+-parseInt(_0x5987f1(0x11a))/0x7*(parseInt(_0x5987f1(0x109))/0x8)+parseInt(_0x5987f1(0x116))/0x9*(-parseInt(_0x5987f1(0x10b))/0xa)+-parseInt(_0x5987f1(0x10e))/0xb+parseInt(_0x5987f1(0x117))/0xc;if(_0x23807d===_0x5656a6)break;else _0x426c21['push'](_0x426c21['shift']());}catch(_0x4fa91f){_0x426c21['push'](_0x426c21['shift']());}}}(a130_0x4139,0x6b223));const DESCRIPTION_MAX_LENGTH=0x1f4;function a130_0x593d(_0x2a2d43,_0x232bd8){_0x2a2d43=_0x2a2d43-0x109;const _0x413971=a130_0x4139();let _0x593d40=_0x413971[_0x2a2d43];return _0x593d40;}export function buildLovrabetConfirmationRequest(_0x415bee,_0x46fe94,_0x20f25c){const _0x43efc0=a130_0x593d,_0x3a5c19=normalizeText(_0x415bee[_0x43efc0(0x110)],DESCRIPTION_MAX_LENGTH),_0xc8b16e=normalizeText(_0x415bee[_0x43efc0(0x112)],DESCRIPTION_MAX_LENGTH);return{'operation':_0x46fe94,'risk':requireWriteRisk(_0x415bee),'description':_0x3a5c19||_0xc8b16e||'Run\x20this\x20write\x20operation',..._0x20f25c?{'signal':_0x20f25c}:{}};}function requireWriteRisk(_0x81585){const _0x2373af=a130_0x593d;if(_0x81585['risk']===_0x2373af(0x10d)||_0x81585[_0x2373af(0x119)]==='high-risk-write')return _0x81585['risk'];throw new Error('Lovrabet\x20confirmation\x20requires\x20a\x20write\x20command.');}function normalizeText(_0x222d9f,_0x3caf0a){const _0x51f8cb=a130_0x593d;if(typeof _0x222d9f!==_0x51f8cb(0x113))return'';return _0x222d9f['replace'](/[\u0000-\u001f\u007f]+/g,'\x20')[_0x51f8cb(0x118)](/\s+/g,'\x20')[_0x51f8cb(0x115)]()[_0x51f8cb(0x10c)](0x0,_0x3caf0a);}
|
package/lib/runtime/event.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x389247,_0x580b2a){const _0x45d920=a131_0x3487,_0x50cb80=_0x389247();while(!![]){try{const _0x588919=parseInt(_0x45d920(0x79))/0x1*(-parseInt(_0x45d920(0x7e))/0x2)+-parseInt(_0x45d920(0x7a))/0x3*(parseInt(_0x45d920(0x7c))/0x4)+parseInt(_0x45d920(0x7f))/0x5+parseInt(_0x45d920(0x84))/0x6+-parseInt(_0x45d920(0x83))/0x7*(-parseInt(_0x45d920(0x77))/0x8)+-parseInt(_0x45d920(0x76))/0x9*(-parseInt(_0x45d920(0x74))/0xa)+parseInt(_0x45d920(0x87))/0xb*(-parseInt(_0x45d920(0x88))/0xc);if(_0x588919===_0x580b2a)break;else _0x50cb80['push'](_0x50cb80['shift']());}catch(_0x28a55e){_0x50cb80['push'](_0x50cb80['shift']());}}}(a131_0x4a68,0x26e9b));export function canonicalLovrabetOperation(_0x4eabef){const _0x30f66c=a131_0x3487;return[_0x4eabef[_0x30f66c(0x7d)],..._0x4eabef[_0x30f66c(0x78)][_0x30f66c(0x81)]()['split'](/\s+/)]['filter'](Boolean)[_0x30f66c(0x82)]('.');}function a131_0x4a68(){const _0x5c1cd7=['120IIVtSZ','write','77859OydeXF','376144DeEcHj','command','137916ODqzSs','2139SHFGjI','high-risk-write','1124hKnjVE','service','2eBaSWE','880855oMvEui','lovrabet.write.completed','trim','join','21aJUlgI','1016706qxjHlc','writeEventSubject','risk','1056xnzvDv','11604gedZdX'];a131_0x4a68=function(){return _0x5c1cd7;};return a131_0x4a68();}function a131_0x3487(_0x3d8d7f,_0x10ac73){_0x3d8d7f=_0x3d8d7f-0x74;const _0x4a68ea=a131_0x4a68();let _0x3487b2=_0x4a68ea[_0x3d8d7f];return _0x3487b2;}export function createLovrabetWriteMetadata(_0x11f1f5,_0x1eb32e,_0x2b17de,_0x4440d3){const _0x10f8d7=a131_0x3487;if(_0x4440d3||_0x2b17de['ok']!==!![]||_0x11f1f5[_0x10f8d7(0x86)]!==_0x10f8d7(0x75)&&_0x11f1f5[_0x10f8d7(0x86)]!==_0x10f8d7(0x7b))return undefined;const _0x1399e9=_0x11f1f5[_0x10f8d7(0x85)]?.(_0x2b17de),_0x6d21c9={'type':_0x10f8d7(0x80),'operation':_0x1eb32e,'risk':_0x11f1f5[_0x10f8d7(0x86)],..._0x1399e9?{'subject':_0x1399e9}:{}};return{'lovrabet':{'schemaVersion':0x1,'event':_0x6d21c9}};}
|
package/lib/runtime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a132_0x2627(_0x356e49,_0x505071){_0x356e49=_0x356e49-0x117;const _0x434ef3=a132_0x434e();let _0x26274a=_0x434ef3[_0x356e49];return _0x26274a;}(function(_0x261637,_0x1d531a){const _0x245b75=a132_0x2627,_0x245e4b=_0x261637();while(!![]){try{const _0x58cf16=parseInt(_0x245b75(0x119))/0x1+-parseInt(_0x245b75(0x121))/0x2+-parseInt(_0x245b75(0x122))/0x3*(-parseInt(_0x245b75(0x124))/0x4)+-parseInt(_0x245b75(0x11b))/0x5+parseInt(_0x245b75(0x128))/0x6+-parseInt(_0x245b75(0x135))/0x7*(-parseInt(_0x245b75(0x118))/0x8)+parseInt(_0x245b75(0x133))/0x9;if(_0x58cf16===_0x1d531a)break;else _0x245e4b['push'](_0x245e4b['shift']());}catch(_0x5605c1){_0x245e4b['push'](_0x245e4b['shift']());}}}(a132_0x434e,0x4b835));import{buildConfigFromFlags,initGlobalEnvironment}from'../context.js';import{createLovrabetRunnerAdapter,createPipelineEnv,finalizeLovrabetRuntimeState,runCommand}from'../framework/runner.js';import{canonicalLovrabetOperation,createLovrabetWriteMetadata}from'../runtime/event.js';import{buildLovrabetConfirmationRequest}from'../runtime/confirmation.js';import{resolveLovrabetInvocation}from'../runtime/resolve.js';import{runSerialized}from'../runtime/queue.js';const defaultPresentation={'present'({result:_0x5189f1,command:_0x46481a,risk:_0x8b4260,dryRun:_0x4f6c32}){const _0x1d9913=a132_0x2627;return JSON[_0x1d9913(0x130)]({'ok':_0x5189f1['ok'],'command':_0x46481a,'risk':_0x8b4260,..._0x4f6c32?{'dryRun':!![]}:{},..._0x5189f1[_0x1d9913(0x12f)]!==undefined?{'data':_0x5189f1['data']}:{},..._0x5189f1['message']?{'message':_0x5189f1[_0x1d9913(0x120)]}:{}});}};export async function invokeLovrabet(_0x291c2a,_0x1a25ac){const _0x7a4e31=a132_0x2627;throwIfAborted(_0x1a25ac[_0x7a4e31(0x127)]);const _0x95fea3=await resolveLovrabetInvocation(_0x291c2a),_0x15be5f=canonicalLovrabetOperation(_0x95fea3[_0x7a4e31(0x138)]);return await confirmWriteBeforeQueue(_0x95fea3[_0x7a4e31(0x138)],_0x95fea3['rawFlags'],_0x15be5f,_0x1a25ac),runSerialized(async()=>{const _0x24d253=_0x7a4e31;throwIfAborted(_0x1a25ac[_0x24d253(0x127)]);const _0x4229ca={},_0x163b53=buildConfigFromFlags(_0x95fea3[_0x24d253(0x136)]);await initGlobalEnvironment(_0x163b53);const _0x2d01dd=createPipelineEnv(_0x163b53,{..._0x95fea3[_0x24d253(0x136)],'yes':_0x95fea3[_0x24d253(0x138)]['risk']===_0x24d253(0x11f)?!![]:_0x95fea3[_0x24d253(0x136)][_0x24d253(0x13a)],'nonInteractive':!![]});_0x2d01dd[_0x24d253(0x131)]=_0x95fea3['args'],_0x2d01dd[_0x24d253(0x11e)]=!![],_0x2d01dd[_0x24d253(0x123)]=_0x24d253(0x11f);const _0x398344=withAbortSignal(_0x95fea3[_0x24d253(0x138)],_0x1a25ac[_0x24d253(0x127)]),_0x4a2f1f=createLovrabetRunnerAdapter({'formatOutput'(_0x5582f4,_0x5a90c9){const _0x503a68=_0x24d253;_0x4229ca[_0x503a68(0x126)]=_0x5582f4,_0x4229ca[_0x503a68(0x117)]=_0x5a90c9[_0x503a68(0x117)],_0x4229ca['risk']=_0x5a90c9[_0x503a68(0x129)],_0x4229ca[_0x503a68(0x139)]=_0x5a90c9[_0x503a68(0x139)],_0x4229ca[_0x503a68(0x11d)]=_0x5a90c9['dryRun']===!![];},async 'confirmHighRisk'(){throw new Error('Embedded\x20Lovrabet\x20confirmation\x20must\x20run\x20inside\x20execute.');}});try{await runCommand(_0x398344,_0x2d01dd,_0x4a2f1f);if(!_0x4229ca[_0x24d253(0x126)]||!_0x4229ca[_0x24d253(0x117)]||!_0x4229ca[_0x24d253(0x129)]||!_0x4229ca[_0x24d253(0x139)])throw new Error(_0x24d253(0x137));const _0x38f645=_0x1a25ac['presentation']??defaultPresentation,_0x616e69=_0x4229ca[_0x24d253(0x11d)]===!![],_0x204aa7={'result':_0x4229ca[_0x24d253(0x126)],'command':_0x4229ca[_0x24d253(0x117)],'operation':_0x15be5f,'risk':_0x4229ca[_0x24d253(0x129)],'format':_0x4229ca[_0x24d253(0x139)],'dryRun':_0x616e69},_0x5bcfe6=createLovrabetWriteMetadata(_0x95fea3[_0x24d253(0x138)],_0x15be5f,_0x4229ca['result'],_0x616e69);let _0x43432c;try{_0x43432c=await _0x38f645[_0x24d253(0x132)](_0x204aa7);}catch(_0x2b3be6){if(!_0x5bcfe6||_0x38f645===defaultPresentation)throw _0x2b3be6;_0x43432c=await defaultPresentation[_0x24d253(0x132)](_0x204aa7);}return{'operation':_0x15be5f,'risk':_0x4229ca[_0x24d253(0x129)],'mode':_0x616e69?_0x24d253(0x12a):_0x24d253(0x12d),'result':_0x4229ca['result'],'output':_0x43432c,..._0x5bcfe6?{'metadata':_0x5bcfe6}:{}};}finally{await finalizeLovrabetRuntimeState();}});}async function confirmWriteBeforeQueue(_0x534e3f,_0x12c310,_0x42becf,_0x2d9b3c){const _0x18b1ca=a132_0x2627;if(_0x12c310[_0x18b1ca(0x11d)]===!![]||_0x534e3f[_0x18b1ca(0x129)]!==_0x18b1ca(0x12c)&&_0x534e3f[_0x18b1ca(0x129)]!==_0x18b1ca(0x11f))return;await _0x2d9b3c[_0x18b1ca(0x11a)][_0x18b1ca(0x125)](buildLovrabetConfirmationRequest(_0x534e3f,_0x42becf,_0x2d9b3c[_0x18b1ca(0x127)]));}function withAbortSignal(_0x151074,_0x2e2769){return{..._0x151074,async 'execute'(_0x5160a2){const _0x5cb181=a132_0x2627;return throwIfAborted(_0x2e2769),_0x151074[_0x5cb181(0x12d)]({..._0x5160a2,'signal':_0x2e2769});}};}function throwIfAborted(_0x3d7f4a){const _0x9b1028=a132_0x2627;if(_0x3d7f4a?.[_0x9b1028(0x12b)])throw _0x3d7f4a[_0x9b1028(0x11c)]instanceof Error?_0x3d7f4a[_0x9b1028(0x11c)]:new DOMException(_0x9b1028(0x134),_0x9b1028(0x12e));}function a132_0x434e(){const _0x423fd5=['yes','command','32dDjZys','35608kAUEYS','confirmation','2923110fuwDIM','reason','dryRun','isNonInteractive','high-risk-write','message','1093296pViMWK','268401IYcfSM','riskLevel','4BDyeIP','confirm','result','signal','2160336GiMicq','risk','dry-run','aborted','write','execute','AbortError','data','stringify','args','present','3245796KLNZnd','Lovrabet\x20invocation\x20aborted.','1040893lfwqiw','rawFlags','Lovrabet\x20invocation\x20completed\x20without\x20a\x20captured\x20command\x20result.','definition','format'];a132_0x434e=function(){return _0x423fd5;};return a132_0x434e();}
|
package/lib/runtime/queue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1a58a6,_0x31c35e){const _0x2c8c16=a133_0x1f43,_0x554708=_0x1a58a6();while(!![]){try{const _0x50e971=-parseInt(_0x2c8c16(0xf7))/0x1+parseInt(_0x2c8c16(0xff))/0x2*(-parseInt(_0x2c8c16(0xfa))/0x3)+parseInt(_0x2c8c16(0xfd))/0x4+-parseInt(_0x2c8c16(0xf9))/0x5*(-parseInt(_0x2c8c16(0x100))/0x6)+-parseInt(_0x2c8c16(0xf8))/0x7*(-parseInt(_0x2c8c16(0xfb))/0x8)+parseInt(_0x2c8c16(0xfc))/0x9+-parseInt(_0x2c8c16(0xfe))/0xa*(parseInt(_0x2c8c16(0x101))/0xb);if(_0x50e971===_0x31c35e)break;else _0x554708['push'](_0x554708['shift']());}catch(_0x42b42a){_0x554708['push'](_0x554708['shift']());}}}(a133_0x40ea,0x7c6a3));function a133_0x40ea(){const _0x2460a8=['993618ruaNjO','852620ugysoM','30gLUoJJ','356662GiMwxN','18906XkfStm','986073OXHpsg','503659ufMvqE','9723YiVkUH','755QhzgIO','3wlkGnv','3808OtuYbz'];a133_0x40ea=function(){return _0x2460a8;};return a133_0x40ea();}function a133_0x1f43(_0x537247,_0x5efaa9){_0x537247=_0x537247-0xf7;const _0x40ea9d=a133_0x40ea();let _0x1f439b=_0x40ea9d[_0x537247];return _0x1f439b;}let tail=Promise['resolve']();export async function runSerialized(_0x5dd25b){const _0x43593c=tail;let _0xacb2e2;tail=new Promise(_0x55c070=>{_0xacb2e2=_0x55c070;}),await _0x43593c['catch'](()=>undefined);try{return await _0x5dd25b();}finally{_0xacb2e2();}}
|
package/lib/runtime/resolve.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d1b20,_0x360edf){const _0x5b7a30=a134_0xd27d,_0x141b16=_0x4d1b20();while(!![]){try{const _0x42cba0=-parseInt(_0x5b7a30(0x17e))/0x1+parseInt(_0x5b7a30(0x17f))/0x2*(parseInt(_0x5b7a30(0x174))/0x3)+-parseInt(_0x5b7a30(0x183))/0x4+parseInt(_0x5b7a30(0x17a))/0x5*(parseInt(_0x5b7a30(0x182))/0x6)+-parseInt(_0x5b7a30(0x17d))/0x7+-parseInt(_0x5b7a30(0x172))/0x8*(parseInt(_0x5b7a30(0x17b))/0x9)+parseInt(_0x5b7a30(0x181))/0xa*(parseInt(_0x5b7a30(0x17c))/0xb);if(_0x42cba0===_0x360edf)break;else _0x141b16['push'](_0x141b16['shift']());}catch(_0x1751a5){_0x141b16['push'](_0x141b16['shift']());}}}(a134_0x2b79,0xb3478));import a134_0x6f1e6e from'meow';function a134_0xd27d(_0x7e9fde,_0x5dcaaa){_0x7e9fde=_0x7e9fde-0x16c;const _0x2b7996=a134_0x2b79();let _0xd27d3d=_0x2b7996[_0x7e9fde];return _0xd27d3d;}import{findDefinition,getServiceEntry,isKnownService,resolveRemovedCommand}from'../commands/registry.js';import{resolveDynamicServiceCommand}from'../commands/service/dynamic.js';import{buildMeowFlags}from'../constant/cli.js';function a134_0x2b79(){const _0x27a207=['../commands/registry.js','definition','2029424ZGnjzj','defaultCommand','27dYNJfv','flags','unknownCommand','Lovrabet\x20argv\x20must\x20include\x20a\x20service\x20and\x20command.','input','message','5DVYvCo','27uTobHE','29577515pDvHkN','2009539PjHXpz','972661BuaOBG','76026KqebFn','hint','10hyXptL','3274338qmbEUB','3286420IDJzKY','assign','validation','join','../framework/preparse.js'];a134_0x2b79=function(){return _0x27a207;};return a134_0x2b79();}import{CliErrors}from'../errors.js';export async function resolveLovrabetInvocation(_0x145fa0){const _0x3a3e0b=a134_0xd27d,_0x2174d0=a134_0x6f1e6e('',{'importMeta':import.meta,'argv':_0x145fa0,'flags':buildMeowFlags(),'autoHelp':![],'autoVersion':![]}),_0x4f39ab=[..._0x2174d0[_0x3a3e0b(0x178)]],_0x42f074=_0x2174d0[_0x3a3e0b(0x175)];await correctFlags(_0x42f074);const _0x4c20ec=_0x4f39ab[0x0];if(!_0x4c20ec)throw CliErrors[_0x3a3e0b(0x16d)](_0x3a3e0b(0x177));const _0x25f5dc=resolveRemovedCommand(_0x4c20ec,_0x4f39ab[0x1]);if(_0x25f5dc)throw CliErrors[_0x3a3e0b(0x16d)](_0x25f5dc[_0x3a3e0b(0x179)],_0x25f5dc[_0x3a3e0b(0x180)]);if(!isKnownService(_0x4c20ec)){const _0x189d54=resolveDynamicServiceCommand(_0x4f39ab,_0x42f074);if(!_0x189d54)throw CliErrors[_0x3a3e0b(0x176)](_0x4f39ab[_0x3a3e0b(0x16e)]('\x20'));return Object['assign'](_0x42f074,_0x189d54[_0x3a3e0b(0x175)]),{'definition':_0x189d54[_0x3a3e0b(0x171)],'rawFlags':_0x42f074,'args':_0x189d54['args']};}const _0x325fa7=getServiceEntry(_0x4c20ec),_0x583363=_0x4f39ab[0x1]||_0x325fa7[_0x3a3e0b(0x173)];if(!_0x583363)throw CliErrors[_0x3a3e0b(0x16d)]('Lovrabet\x20argv\x20must\x20include\x20a\x20command\x20for\x20service\x20\x22'+_0x4c20ec+'\x22.');const _0x5385f2=findDefinition(_0x4c20ec,_0x583363);if(!_0x5385f2)throw CliErrors[_0x3a3e0b(0x176)](_0x4c20ec+'\x20'+_0x583363);return{'definition':_0x5385f2,'rawFlags':_0x42f074,'args':_0x4f39ab['slice'](0x2)};}async function correctFlags(_0x57b036){const _0x3d9f64=a134_0xd27d;try{const {correctFlags:_0x344753}=await import(_0x3d9f64(0x16f)),{getAllDefinitions:_0x35db09}=await import(_0x3d9f64(0x170)),_0x5ae63e=_0x35db09()['flatMap'](_0x41ce6e=>_0x41ce6e[_0x3d9f64(0x175)]??[]),_0x887538=_0x344753(_0x57b036,_0x5ae63e);Object[_0x3d9f64(0x16c)](_0x57b036,_0x887538[_0x3d9f64(0x175)]);}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a136_0x7755(){const _0x47dc69=['isSymbolicLink','reason','length','SKILL.md','sort','missing','current','94854UwPOOx','skipped','package.json','split','INSTALL_FAILED','sha256','schemaVersion','files','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','2499602LPYkwz','message','packageVersion','home','root','2154856OvpaPe','path','present','trim','572885iWGiVE','Unsafe\x20manifest\x20path:\x20','isDirectory','lovrabet','unverifiable','parse',':\x5cs*(.+)$','13476617kPmcGM','Installed\x20Skill\x20state\x20is\x20','includes','manifest','state','every','44190EKfPfe','skillVersion','unknown','name','70RIfmhT','join','version','skills@latest\x20exited\x20','152UBrtAc','installedPath','lovrabet.manifest.json','SOURCE_INVALID','startsWith','skills','absent','flatMap','hex','2aRYSow','lovrabet\x20cli-skill\x20install','6310IRLqtH','7911vpteEh','packageRoot','digest','utf8','isFile','update','stdio'];a136_0x7755=function(){return _0x47dc69;};return a136_0x7755();}const a136_0x4cd20e=a136_0x1d80;(function(_0x5ac6be,_0x5d809c){const _0x1d3dde=a136_0x1d80,_0x49ed7a=_0x5ac6be();while(!![]){try{const _0x24feaf=parseInt(_0x1d3dde(0x1e5))/0x1*(-parseInt(_0x1d3dde(0x203))/0x2)+parseInt(_0x1d3dde(0x1f2))/0x3*(-parseInt(_0x1d3dde(0x1fa))/0x4)+parseInt(_0x1d3dde(0x1f6))/0x5*(-parseInt(_0x1d3dde(0x214))/0x6)+-parseInt(_0x1d3dde(0x1dc))/0x7+parseInt(_0x1d3dde(0x1e1))/0x8+parseInt(_0x1d3dde(0x206))/0x9*(parseInt(_0x1d3dde(0x205))/0xa)+parseInt(_0x1d3dde(0x1ec))/0xb;if(_0x24feaf===_0x5d809c)break;else _0x49ed7a['push'](_0x49ed7a['shift']());}catch(_0x2ad123){_0x49ed7a['push'](_0x49ed7a['shift']());}}}(a136_0x7755,0x528c4));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a136_0x4cd20e(0x204),SKILL_NAME=a136_0x4cd20e(0x1e8);function frontmatterValue(_0x546c14,_0x2cbcf5){const _0x421182=a136_0x4cd20e;return _0x546c14['match'](new RegExp('^'+_0x2cbcf5+_0x421182(0x1eb),'m'))?.[0x1]?.[_0x421182(0x1e4)]()??'';}function listFiles(_0x31f5ad,_0x974fdf=_0x31f5ad){const _0x3122e1=a136_0x4cd20e;return readdirSync(_0x974fdf,{'withFileTypes':!![]})[_0x3122e1(0x201)](_0x24d55c=>{const _0xa8eac0=_0x3122e1,_0x2046b6=join(_0x974fdf,_0x24d55c[_0xa8eac0(0x1f5)]),_0x3b2a55=lstatSync(_0x2046b6);if(_0x3b2a55[_0xa8eac0(0x20d)]())throw new Error('Symbolic\x20link\x20is\x20not\x20allowed:\x20'+_0x2046b6);if(_0x3b2a55[_0xa8eac0(0x1e7)]())return listFiles(_0x31f5ad,_0x2046b6);if(!_0x3b2a55[_0xa8eac0(0x20a)]())throw new Error('Unsupported\x20Skill\x20entry:\x20'+_0x2046b6);return[relative(_0x31f5ad,_0x2046b6)['split'](sep)[_0xa8eac0(0x1f7)]('/')];})[_0x3122e1(0x211)]((_0x37d315,_0x5abfdb)=>_0x37d315<_0x5abfdb?-0x1:_0x37d315>_0x5abfdb?0x1:0x0);}function digestFiles(_0x54a406,_0x5252ef){const _0x4cc654=a136_0x4cd20e,_0x55ec33=createHash(_0x4cc654(0x219));for(const _0x555a78 of _0x5252ef){if(_0x555a78[_0x4cc654(0x1fe)]('/')||_0x555a78[_0x4cc654(0x217)]('/')[_0x4cc654(0x1ee)]('..')||_0x555a78[_0x4cc654(0x1ee)]('\x5c'))throw new Error(_0x4cc654(0x1e6)+_0x555a78);_0x55ec33[_0x4cc654(0x20b)](_0x555a78),_0x55ec33['update']('\x00'),_0x55ec33[_0x4cc654(0x20b)](readFileSync(join(_0x54a406,..._0x555a78[_0x4cc654(0x217)]('/')))),_0x55ec33[_0x4cc654(0x20b)]('\x00');}return _0x55ec33['digest'](_0x4cc654(0x202));}function sameFiles(_0x81974f,_0x5bb2b6){const _0x3b4105=a136_0x4cd20e;return _0x81974f['length']===_0x5bb2b6[_0x3b4105(0x20f)]&&_0x81974f[_0x3b4105(0x1f1)]((_0xa691c9,_0x386a59)=>_0xa691c9===_0x5bb2b6[_0x386a59]);}function readSource(_0x3e1020){const _0x5aab44=a136_0x4cd20e,_0x40e36d=JSON[_0x5aab44(0x1ea)](readFileSync(join(_0x3e1020,_0x5aab44(0x216)),'utf8')),_0x1a39a4=JSON['parse'](readFileSync(join(_0x3e1020,_0x5aab44(0x1ff),_0x5aab44(0x1fc)),_0x5aab44(0x209))),_0x176da2=join(_0x3e1020,'skills',SKILL_NAME),_0x264650=frontmatterValue(readFileSync(join(_0x176da2,'SKILL.md'),_0x5aab44(0x209)),_0x5aab44(0x1f8)),_0x30b46a=listFiles(_0x176da2);if(_0x1a39a4[_0x5aab44(0x1d9)]!==0x1||_0x1a39a4[_0x5aab44(0x1f5)]!==SKILL_NAME||!_0x40e36d['version']||_0x1a39a4[_0x5aab44(0x1de)]!==_0x40e36d[_0x5aab44(0x1f8)]||_0x1a39a4[_0x5aab44(0x1f3)]!==_0x40e36d[_0x5aab44(0x1f8)]||_0x264650!==_0x40e36d[_0x5aab44(0x1f8)]||!sameFiles(_0x30b46a,_0x1a39a4[_0x5aab44(0x1da)])||digestFiles(_0x176da2,_0x30b46a)!==_0x1a39a4[_0x5aab44(0x208)])throw new Error(_0x5aab44(0x1db));return{'packageVersion':_0x40e36d[_0x5aab44(0x1f8)],'skillVersion':_0x264650,'root':_0x176da2,'manifest':_0x1a39a4};}function installedSkillPath(_0xdcb356){const _0x14aa5b=a136_0x4cd20e,_0x343295=resolveInstalledSkill(SKILL_NAME,{'home':_0xdcb356});if(_0x343295['state']===_0x14aa5b(0x1e3))return{'state':_0x14aa5b(0x1e3),'path':dirname(_0x343295[_0x14aa5b(0x1e2)])};if(_0x343295['state']===_0x14aa5b(0x200))return{'state':_0x14aa5b(0x212)};return{'state':_0x14aa5b(0x1e9),'reason':_0x343295[_0x14aa5b(0x20e)]};}export function inspectInstalledBuiltinSkillVersion(_0x5360f7,_0x5c9df2={}){const _0x43994c=a136_0x4cd20e,_0x14af0c=installedSkillPath(_0x5c9df2[_0x43994c(0x1df)]??homedir());if(_0x14af0c['state']===_0x43994c(0x212))return{'state':_0x43994c(0x212),'expectedVersion':_0x5360f7,'repairCommand':REPAIR_COMMAND};if(_0x14af0c[_0x43994c(0x1f0)]===_0x43994c(0x1e9))return{'state':_0x43994c(0x1e9),'expectedVersion':_0x5360f7,'reason':_0x14af0c['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x5c3014=frontmatterValue(readFileSync(join(_0x14af0c[_0x43994c(0x1e2)],'SKILL.md'),_0x43994c(0x209)),'version');return{'state':_0x5c3014===_0x5360f7?_0x43994c(0x213):'version_mismatch','expectedVersion':_0x5360f7,'skillVersion':_0x5c3014,'installedPath':_0x14af0c['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x5b405e){return{'state':_0x43994c(0x1e9),'expectedVersion':_0x5360f7,'installedPath':_0x14af0c[_0x43994c(0x1e2)],'reason':_0x5b405e instanceof Error?_0x5b405e[_0x43994c(0x1dd)]:String(_0x5b405e),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x4db9d7={}){const _0x25e118=a136_0x4cd20e,_0x1a09a3=_0x4db9d7[_0x25e118(0x207)]??DEFAULT_PACKAGE_ROOT;let _0x149c4;try{_0x149c4=readSource(_0x1a09a3);}catch(_0x441e81){return{'state':'unverifiable','packageVersion':'unknown','reason':_0x441e81 instanceof Error?_0x441e81[_0x25e118(0x1dd)]:String(_0x441e81),'repairCommand':REPAIR_COMMAND};}const _0x440ec7=installedSkillPath(_0x4db9d7['home']??homedir());if(_0x440ec7[_0x25e118(0x1f0)]==='missing')return{'state':_0x25e118(0x212),'packageVersion':_0x149c4['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x440ec7['state']===_0x25e118(0x1e9))return{'state':_0x25e118(0x1e9),'packageVersion':_0x149c4[_0x25e118(0x1de)],'reason':_0x440ec7[_0x25e118(0x20e)],'repairCommand':REPAIR_COMMAND};try{const _0x10491b=frontmatterValue(readFileSync(join(_0x440ec7[_0x25e118(0x1e2)],_0x25e118(0x210)),_0x25e118(0x209)),_0x25e118(0x1f8));if(_0x10491b!==_0x149c4[_0x25e118(0x1f3)])return{'state':'version_mismatch','packageVersion':_0x149c4['packageVersion'],'skillVersion':_0x10491b,'installedPath':_0x440ec7[_0x25e118(0x1e2)],'repairCommand':REPAIR_COMMAND};const _0x3299b2=listFiles(_0x440ec7['path']),_0x4b0a19=digestFiles(_0x440ec7[_0x25e118(0x1e2)],_0x3299b2);return{'state':sameFiles(_0x3299b2,_0x149c4[_0x25e118(0x1ef)][_0x25e118(0x1da)])&&_0x4b0a19===_0x149c4[_0x25e118(0x1ef)]['digest']?_0x25e118(0x213):'content_mismatch','packageVersion':_0x149c4[_0x25e118(0x1de)],'skillVersion':_0x10491b,'installedPath':_0x440ec7[_0x25e118(0x1e2)],'digest':_0x4b0a19,'repairCommand':REPAIR_COMMAND};}catch(_0x15881e){return{'state':_0x25e118(0x1e9),'packageVersion':_0x149c4[_0x25e118(0x1de)],'installedPath':_0x440ec7['path'],'reason':_0x15881e instanceof Error?_0x15881e['message']:String(_0x15881e),'repairCommand':REPAIR_COMMAND};}}function a136_0x1d80(_0x4ba359,_0x3cf8c5){_0x4ba359=_0x4ba359-0x1d9;const _0x77551f=a136_0x7755();let _0x1d8061=_0x77551f[_0x4ba359];return _0x1d8061;}function failure(_0x4d5dc0,_0x177b21,_0x295ca8,_0x3440c1){const _0x17680b=a136_0x4cd20e;return{'ok':![],'code':_0x4d5dc0,'packageVersion':_0x177b21['packageVersion'],'skillVersion':_0x177b21[_0x17680b(0x1f3)],'installedPath':_0x3440c1,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x295ca8 instanceof Error?_0x295ca8[_0x17680b(0x1dd)]:String(_0x295ca8)};}export function installBuiltinSkill(_0x33015b={}){const _0xa8726b=a136_0x4cd20e,_0x1b176c=_0x33015b[_0xa8726b(0x207)]??DEFAULT_PACKAGE_ROOT,_0xa0d1c4=_0x33015b[_0xa8726b(0x1df)]??homedir();let _0x75c2d2;try{_0x75c2d2=readSource(_0x1b176c);}catch(_0x4e8f24){return failure(_0xa8726b(0x1fd),{'packageVersion':'unknown','skillVersion':_0xa8726b(0x1f4)},_0x4e8f24);}const _0x4f5306=inspectBuiltinSkill({'packageRoot':_0x1b176c,'home':_0xa0d1c4}),_0x50e89d=runNpxSkillsAddGlobal(_0x1b176c,_0x75c2d2[_0xa8726b(0x1e0)],{'stdio':_0x33015b[_0xa8726b(0x20c)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0xa0d1c4}});if(_0x50e89d[_0xa8726b(0x215)])return{'ok':!![],'packageVersion':_0x75c2d2[_0xa8726b(0x1de)],'skillVersion':_0x75c2d2[_0xa8726b(0x1f3)],'installedPath':_0x4f5306[_0xa8726b(0x1fb)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x50e89d['ok'])return failure(_0xa8726b(0x218),_0x75c2d2,_0x50e89d['error']??_0xa8726b(0x1f9)+_0x50e89d['status']);const _0x26fcc8=inspectBuiltinSkill({'packageRoot':_0x1b176c,'home':_0xa0d1c4});if(_0x26fcc8[_0xa8726b(0x1f0)]!==_0xa8726b(0x213))return failure('VERIFY_FAILED',_0x75c2d2,_0x26fcc8['reason']??_0xa8726b(0x1ed)+_0x26fcc8[_0xa8726b(0x1f0)],_0x26fcc8[_0xa8726b(0x1fb)]);return{'ok':!![],'packageVersion':_0x75c2d2[_0xa8726b(0x1de)],'skillVersion':_0x75c2d2[_0xa8726b(0x1f3)],'installedPath':_0x26fcc8[_0xa8726b(0x1fb)],'changed':_0x4f5306['state']!==_0xa8726b(0x213),'repairCommand':REPAIR_COMMAND};}
|
|
1
|
+
const a136_0x389b2b=a136_0x2945;(function(_0xc75ba3,_0x6a7491){const _0x3bff41=a136_0x2945,_0x354ed1=_0xc75ba3();while(!![]){try{const _0x26508a=-parseInt(_0x3bff41(0x191))/0x1+-parseInt(_0x3bff41(0x19d))/0x2+parseInt(_0x3bff41(0x16e))/0x3+parseInt(_0x3bff41(0x1ac))/0x4*(-parseInt(_0x3bff41(0x178))/0x5)+parseInt(_0x3bff41(0x172))/0x6+-parseInt(_0x3bff41(0x19f))/0x7*(-parseInt(_0x3bff41(0x174))/0x8)+-parseInt(_0x3bff41(0x187))/0x9;if(_0x26508a===_0x6a7491)break;else _0x354ed1['push'](_0x354ed1['shift']());}catch(_0x33147a){_0x354ed1['push'](_0x354ed1['shift']());}}}(a136_0x18ac,0x33e77));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';function a136_0x2945(_0x1365df,_0x395dcf){_0x1365df=_0x1365df-0x16c;const _0x18acd6=a136_0x18ac();let _0x294549=_0x18acd6[_0x1365df];return _0x294549;}import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a136_0x389b2b(0x17b),SKILL_NAME=a136_0x389b2b(0x182),debug=debuglog('lovrabet-skills');function frontmatterValue(_0x1b7a57,_0x5c18db){const _0x3e13f3=a136_0x389b2b;return _0x1b7a57[_0x3e13f3(0x1a1)](new RegExp('^'+_0x5c18db+_0x3e13f3(0x1ae),'m'))?.[0x1]?.['trim']()??'';}function listFiles(_0x20c805,_0x29f95e=_0x20c805){const _0x553110=a136_0x389b2b;return readdirSync(_0x29f95e,{'withFileTypes':!![]})[_0x553110(0x17a)](_0x7b3ff8=>{const _0x3b94b1=_0x553110,_0x656347=join(_0x29f95e,_0x7b3ff8[_0x3b94b1(0x1a3)]),_0x7fc392=lstatSync(_0x656347);if(_0x7fc392[_0x3b94b1(0x1a7)]())throw new Error(_0x3b94b1(0x17e)+_0x656347);if(_0x7fc392[_0x3b94b1(0x195)]())return listFiles(_0x20c805,_0x656347);if(!_0x7fc392[_0x3b94b1(0x16f)]())throw new Error(_0x3b94b1(0x1b1)+_0x656347);return[relative(_0x20c805,_0x656347)[_0x3b94b1(0x189)](sep)[_0x3b94b1(0x1b0)]('/')];})[_0x553110(0x193)]((_0x2b02f6,_0x39db43)=>_0x2b02f6<_0x39db43?-0x1:_0x2b02f6>_0x39db43?0x1:0x0);}function digestFiles(_0x206cbb,_0x5d3451){const _0x485b10=a136_0x389b2b,_0x1cd204=createHash(_0x485b10(0x1b2));for(const _0x18651c of _0x5d3451){if(_0x18651c[_0x485b10(0x186)]('/')||_0x18651c[_0x485b10(0x189)]('/')[_0x485b10(0x173)]('..')||_0x18651c[_0x485b10(0x173)]('\x5c'))throw new Error(_0x485b10(0x18c)+_0x18651c);_0x1cd204[_0x485b10(0x19b)](_0x18651c),_0x1cd204['update']('\x00'),_0x1cd204[_0x485b10(0x19b)](readFileSync(join(_0x206cbb,..._0x18651c[_0x485b10(0x189)]('/')))),_0x1cd204[_0x485b10(0x19b)]('\x00');}return _0x1cd204[_0x485b10(0x184)]('hex');}function sameFiles(_0x3a6c1f,_0x1d5029){const _0x835de1=a136_0x389b2b;return _0x3a6c1f['length']===_0x1d5029[_0x835de1(0x19c)]&&_0x3a6c1f[_0x835de1(0x196)]((_0x3465b0,_0x387754)=>_0x3465b0===_0x1d5029[_0x387754]);}function readSource(_0x1bcc0f){const _0x2b847f=a136_0x389b2b,_0x1ad17c=JSON['parse'](readFileSync(join(_0x1bcc0f,_0x2b847f(0x180)),_0x2b847f(0x1a4))),_0x10dc42=JSON[_0x2b847f(0x199)](readFileSync(join(_0x1bcc0f,_0x2b847f(0x183),_0x2b847f(0x17f)),_0x2b847f(0x1a4))),_0x4f5947=join(_0x1bcc0f,_0x2b847f(0x183),SKILL_NAME),_0xd4a606=frontmatterValue(readFileSync(join(_0x4f5947,_0x2b847f(0x177)),_0x2b847f(0x1a4)),'version'),_0x2f5007=listFiles(_0x4f5947);if(_0x10dc42[_0x2b847f(0x170)]!==0x1||_0x10dc42['name']!==SKILL_NAME||!_0x1ad17c[_0x2b847f(0x175)]||_0x10dc42[_0x2b847f(0x17d)]!==_0x1ad17c[_0x2b847f(0x175)]||_0x10dc42['skillVersion']!==_0x1ad17c[_0x2b847f(0x175)]||_0xd4a606!==_0x1ad17c[_0x2b847f(0x175)]||!sameFiles(_0x2f5007,_0x10dc42[_0x2b847f(0x176)])||digestFiles(_0x4f5947,_0x2f5007)!==_0x10dc42[_0x2b847f(0x184)])throw new Error(_0x2b847f(0x18a));return{'packageVersion':_0x1ad17c[_0x2b847f(0x175)],'skillVersion':_0xd4a606,'root':_0x4f5947,'manifest':_0x10dc42};}function installedSkillPath(_0xbb0b75){const _0x13ba00=a136_0x389b2b,_0x37456f=resolveInstalledSkill(SKILL_NAME,{'home':_0xbb0b75});if(_0x37456f[_0x13ba00(0x198)]==='present')return{'state':_0x13ba00(0x16c),'path':dirname(_0x37456f[_0x13ba00(0x18e)])};if(_0x37456f[_0x13ba00(0x198)]===_0x13ba00(0x188))return{'state':_0x13ba00(0x16d)};return{'state':_0x13ba00(0x1a8),'reason':_0x37456f[_0x13ba00(0x1aa)]};}function a136_0x18ac(){const _0x1b4091=['present','missing','1249653KljEEt','isFile','schemaVersion','SOURCE_INVALID','1675560ucWAGN','includes','24UcqtSC','version','files','SKILL.md','5iPSDce','message','flatMap','lovrabet\x20cli-skill\x20install','content_mismatch','packageVersion','Symbolic\x20link\x20is\x20not\x20allowed:\x20','lovrabet.manifest.json','package.json','count','lovrabet','skills','digest','skillVersion','startsWith','265797kcaIdI','absent','split','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','skipped','Unsafe\x20manifest\x20path:\x20','skills@latest\x20exited\x20','path','manifest','partialFailure','291616WsRgVf','home','sort','pipe','isDirectory','every','current','state','parse','error','update','length','220786dTMCpV','Installed\x20Skill\x20state\x20is\x20','845243hsxkzy','status','match','packageRoot','name','utf8','log','output','isSymbolicLink','unverifiable','\x20verified;\x20','reason','unknown','1655668QyDMBL','installedPath',':\x5cs*(.+)$','version_mismatch','join','Unsupported\x20Skill\x20entry:\x20','sha256'];a136_0x18ac=function(){return _0x1b4091;};return a136_0x18ac();}export function inspectInstalledBuiltinSkillVersion(_0x46f575,_0x3c87a2={}){const _0xd56cdb=a136_0x389b2b,_0x467d17=installedSkillPath(_0x3c87a2[_0xd56cdb(0x192)]??homedir());if(_0x467d17[_0xd56cdb(0x198)]===_0xd56cdb(0x16d))return{'state':_0xd56cdb(0x16d),'expectedVersion':_0x46f575,'repairCommand':REPAIR_COMMAND};if(_0x467d17[_0xd56cdb(0x198)]===_0xd56cdb(0x1a8))return{'state':_0xd56cdb(0x1a8),'expectedVersion':_0x46f575,'reason':_0x467d17[_0xd56cdb(0x1aa)],'repairCommand':REPAIR_COMMAND};try{const _0x344e00=frontmatterValue(readFileSync(join(_0x467d17[_0xd56cdb(0x18e)],_0xd56cdb(0x177)),_0xd56cdb(0x1a4)),_0xd56cdb(0x175));return{'state':_0x344e00===_0x46f575?_0xd56cdb(0x197):_0xd56cdb(0x1af),'expectedVersion':_0x46f575,'skillVersion':_0x344e00,'installedPath':_0x467d17[_0xd56cdb(0x18e)],'repairCommand':REPAIR_COMMAND};}catch(_0x4116c1){return{'state':_0xd56cdb(0x1a8),'expectedVersion':_0x46f575,'installedPath':_0x467d17[_0xd56cdb(0x18e)],'reason':_0x4116c1 instanceof Error?_0x4116c1['message']:String(_0x4116c1),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x30f1c8={}){const _0x430f3c=a136_0x389b2b,_0x4cdcea=_0x30f1c8[_0x430f3c(0x1a2)]??DEFAULT_PACKAGE_ROOT;let _0x4ae897;try{_0x4ae897=readSource(_0x4cdcea);}catch(_0x2e9030){return{'state':_0x430f3c(0x1a8),'packageVersion':_0x430f3c(0x1ab),'reason':_0x2e9030 instanceof Error?_0x2e9030[_0x430f3c(0x179)]:String(_0x2e9030),'repairCommand':REPAIR_COMMAND};}const _0x4b7e33=installedSkillPath(_0x30f1c8[_0x430f3c(0x192)]??homedir());if(_0x4b7e33['state']==='missing')return{'state':_0x430f3c(0x16d),'packageVersion':_0x4ae897['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x4b7e33[_0x430f3c(0x198)]===_0x430f3c(0x1a8))return{'state':_0x430f3c(0x1a8),'packageVersion':_0x4ae897[_0x430f3c(0x17d)],'reason':_0x4b7e33[_0x430f3c(0x1aa)],'repairCommand':REPAIR_COMMAND};try{const _0x1baeda=frontmatterValue(readFileSync(join(_0x4b7e33[_0x430f3c(0x18e)],_0x430f3c(0x177)),'utf8'),_0x430f3c(0x175));if(_0x1baeda!==_0x4ae897[_0x430f3c(0x185)])return{'state':_0x430f3c(0x1af),'packageVersion':_0x4ae897[_0x430f3c(0x17d)],'skillVersion':_0x1baeda,'installedPath':_0x4b7e33[_0x430f3c(0x18e)],'repairCommand':REPAIR_COMMAND};const _0x13c73c=listFiles(_0x4b7e33[_0x430f3c(0x18e)]),_0x3ec14b=digestFiles(_0x4b7e33['path'],_0x13c73c);return{'state':sameFiles(_0x13c73c,_0x4ae897[_0x430f3c(0x18f)][_0x430f3c(0x176)])&&_0x3ec14b===_0x4ae897[_0x430f3c(0x18f)][_0x430f3c(0x184)]?_0x430f3c(0x197):_0x430f3c(0x17c),'packageVersion':_0x4ae897[_0x430f3c(0x17d)],'skillVersion':_0x1baeda,'installedPath':_0x4b7e33[_0x430f3c(0x18e)],'digest':_0x3ec14b,'repairCommand':REPAIR_COMMAND};}catch(_0x3bdc5c){return{'state':'unverifiable','packageVersion':_0x4ae897[_0x430f3c(0x17d)],'installedPath':_0x4b7e33[_0x430f3c(0x18e)],'reason':_0x3bdc5c instanceof Error?_0x3bdc5c[_0x430f3c(0x179)]:String(_0x3bdc5c),'repairCommand':REPAIR_COMMAND};}}function failure(_0x2f9867,_0x5ea972,_0x202a09,_0x70e498){const _0x2cd21f=a136_0x389b2b;return{'ok':![],'code':_0x2f9867,'packageVersion':_0x5ea972[_0x2cd21f(0x17d)],'skillVersion':_0x5ea972[_0x2cd21f(0x185)],'installedPath':_0x70e498,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x202a09 instanceof Error?_0x202a09[_0x2cd21f(0x179)]:String(_0x202a09)};}export function installBuiltinSkill(_0xcaac06={}){const _0x58659e=a136_0x389b2b,_0x563711=_0xcaac06[_0x58659e(0x1a2)]??DEFAULT_PACKAGE_ROOT,_0x4b6ad8=_0xcaac06[_0x58659e(0x192)]??homedir();let _0x15b781;try{_0x15b781=readSource(_0x563711);}catch(_0x4ce3f2){return failure(_0x58659e(0x171),{'packageVersion':_0x58659e(0x1ab),'skillVersion':_0x58659e(0x1ab)},_0x4ce3f2);}const _0xb20e63=inspectBuiltinSkill({'packageRoot':_0x563711,'home':_0x4b6ad8}),_0x1e8f2d=runNpxSkillsAddGlobal(_0x563711,_0x15b781['root'],{'stdio':_0xcaac06['stdio']??_0x58659e(0x194),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x4b6ad8}});if(_0x1e8f2d[_0x58659e(0x18b)])return{'ok':!![],'packageVersion':_0x15b781[_0x58659e(0x17d)],'skillVersion':_0x15b781[_0x58659e(0x185)],'installedPath':_0xb20e63[_0x58659e(0x1ad)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x1e8f2d['ok'])return failure('INSTALL_FAILED',_0x15b781,_0x1e8f2d[_0x58659e(0x19a)]??_0x58659e(0x18d)+_0x1e8f2d[_0x58659e(0x1a0)]);const _0x560d89=inspectBuiltinSkill({'packageRoot':_0x563711,'home':_0x4b6ad8});if(_0x560d89['state']!==_0x58659e(0x197)){const _0x132f15=_0x560d89[_0x58659e(0x1aa)]??_0x58659e(0x19e)+_0x560d89[_0x58659e(0x198)];return failure('VERIFY_FAILED',_0x15b781,_0x1e8f2d[_0x58659e(0x190)]?_0x132f15+'\x0a'+_0x1e8f2d[_0x58659e(0x190)][_0x58659e(0x1a6)]:_0x132f15,_0x560d89[_0x58659e(0x1ad)]);}return _0x1e8f2d[_0x58659e(0x190)]&&(debug('Installer\x20reported\x20partial\x20target\x20failures:\x0a%s',_0x1e8f2d[_0x58659e(0x190)][_0x58659e(0x1a6)]),console[_0x58659e(0x1a5)]('CLI\x20Built-in\x20Skill\x20'+_0x15b781[_0x58659e(0x185)]+_0x58659e(0x1a9)+_0x1e8f2d[_0x58659e(0x190)][_0x58659e(0x181)]+'\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.')),{'ok':!![],'packageVersion':_0x15b781['packageVersion'],'skillVersion':_0x15b781[_0x58659e(0x185)],'installedPath':_0x560d89[_0x58659e(0x1ad)],'changed':_0xb20e63['state']!==_0x58659e(0x197),'repairCommand':REPAIR_COMMAND};}
|
|
@@ -35,6 +35,11 @@ export interface RunNpxSkillsAddResult {
|
|
|
35
35
|
status: number | null;
|
|
36
36
|
code?: NpxSkillsErrorCode;
|
|
37
37
|
error?: string;
|
|
38
|
+
/** Some auto-selected targets failed; caller must verify the installed Skill before display. */
|
|
39
|
+
partialFailure?: {
|
|
40
|
+
count: number;
|
|
41
|
+
output: string;
|
|
42
|
+
};
|
|
38
43
|
/** `true` when execution was intentionally skipped via env var. */
|
|
39
44
|
skipped?: boolean;
|
|
40
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x3812ac=a137_0x5a6e;(function(_0x4ad1cd,_0x530c3d){const _0x1010f1=a137_0x5a6e,_0x5077f7=_0x4ad1cd();while(!![]){try{const _0x39b1da=-parseInt(_0x1010f1(0x16f))/0x1+parseInt(_0x1010f1(0x181))/0x2*(-parseInt(_0x1010f1(0x18d))/0x3)+parseInt(_0x1010f1(0x188))/0x4+parseInt(_0x1010f1(0x16d))/0x5+-parseInt(_0x1010f1(0x18e))/0x6+parseInt(_0x1010f1(0x187))/0x7*(parseInt(_0x1010f1(0x18c))/0x8)+parseInt(_0x1010f1(0x182))/0x9*(-parseInt(_0x1010f1(0x159))/0xa);if(_0x39b1da===_0x530c3d)break;else _0x5077f7['push'](_0x5077f7['shift']());}catch(_0x12f02b){_0x5077f7['push'](_0x5077f7['shift']());}}}(a137_0x1a9d,0xc5c8b));import{execaSync}from'execa';function a137_0x5a6e(_0x57f2bf,_0x515ce6){_0x57f2bf=_0x57f2bf-0x158;const _0x1a9ddc=a137_0x1a9d();let _0x5a6eed=_0x1a9ddc[_0x57f2bf];return _0x5a6eed;}import{LOVRABET_SKILL_SOURCE as a137_0x1786ce}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';function a137_0x1a9d(){const _0x41d936=['expectedSkillName','CHILD_EXIT_NONZERO','unknown','present','Installer\x20reported\x20','EPERM','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','log','pipe','6803725DVzPmR','npx','638308XhszQm','PERMISSION_DENIED','checked','npx\x20terminated\x20by\x20signal\x20','stdio','presence','signal','NPX_NOT_FOUND','CHILD_TERMINATED','shortMessage','trim','Skill\x20\x22','stdout','match','ENOENT','message','unverifiable','\x22\x20install\x20state:\x20','2RxlXyQ','5741127SwfSuU','reason','SKILL_NOT_INSTALLED','join','npx\x20failed\x20to\x20start','821275nppfhS','4913416iVajJK','exit\x20','code','!\x20Could\x20not\x20verify\x20\x22','40hdDXfX','1922313APJlXc','2691714cZyhXJ','partialFailure','stderr','NPM_CONFIG_GLOBAL','10VjRGzF','skipNpxSkillsEnvSuffix','globalSkillName','warn','exitCode','state','SPAWN_FAILED','\x20failed\x20target(s)','skills@latest','npm_config_global','absent'];a137_0x1a9d=function(){return _0x41d936;};return a137_0x1a9d();}import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a137_0x1786ce;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG['internalSkillSource'];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a137_0x3812ac(0x15b)];export function resolveGlobalSkillName(_0x343f42){const _0x30eb3f=a137_0x3812ac;switch(_0x343f42[_0x30eb3f(0x179)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a137_0x3812ac(0x15a)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x19f61a,_0x379676,_0x1b287d){return{'ok':![],'status':_0x379676,'code':_0x19f61a,'error':'['+_0x19f61a+']\x20'+_0x1b287d};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x27ea17,_0x53b4dc=LOVRABET_SKILL_SOURCE,_0x23134b){const _0x2e6d76=a137_0x3812ac;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x284b9d=['-y',_0x2e6d76(0x161),'add',_0x53b4dc,'-g','-y'],_0x48875c=[_0x2e6d76(0x16e),..._0x284b9d][_0x2e6d76(0x185)]('\x20');console['log']('*\x20'+_0x48875c);const _0x5cfa64={...process.env};delete _0x5cfa64[_0x2e6d76(0x162)],delete _0x5cfa64[_0x2e6d76(0x158)];const _0x19835e=execaSync('npx',_0x284b9d,{'cwd':_0x27ea17,'stdio':_0x2e6d76(0x16c),'env':_0x5cfa64,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x2ada2c=[_0x19835e[_0x2e6d76(0x17b)]?String(_0x19835e[_0x2e6d76(0x17b)]):'',_0x19835e[_0x2e6d76(0x190)]?String(_0x19835e[_0x2e6d76(0x190)]):'']['filter'](Boolean)[_0x2e6d76(0x185)]('\x0a')['trim'](),_0x4de4f5=_0x19835e[_0x2e6d76(0x15d)]??null,_0x1b6915=_0x4f70fc=>{const _0x3281c1=_0x2e6d76;return _0x23134b?.[_0x3281c1(0x173)]!==_0x3281c1(0x16c)&&!_0x4f70fc[_0x3281c1(0x18f)]&&_0x2ada2c&&console[_0x3281c1(0x16b)](_0x2ada2c),_0x4f70fc;};if(_0x19835e['code']){const _0x54109e=_0x19835e['code']===_0x2e6d76(0x17d)?_0x2e6d76(0x176):_0x19835e[_0x2e6d76(0x18a)]===_0x2e6d76(0x169)||_0x19835e[_0x2e6d76(0x18a)]==='EACCES'?_0x2e6d76(0x170):_0x2e6d76(0x15f);return _0x1b6915(failure(_0x54109e,_0x4de4f5,_0x19835e[_0x2e6d76(0x178)]??_0x19835e[_0x2e6d76(0x17e)]??_0x19835e['code']));}if(_0x19835e[_0x2e6d76(0x175)])return _0x1b6915(failure(_0x2e6d76(0x177),_0x4de4f5,_0x2e6d76(0x172)+_0x19835e[_0x2e6d76(0x175)]));if(_0x19835e['failed']&&_0x4de4f5===null)return _0x1b6915(failure(_0x2e6d76(0x15f),_0x4de4f5,_0x19835e[_0x2e6d76(0x178)]??_0x19835e[_0x2e6d76(0x17e)]??_0x2e6d76(0x186)));if(_0x4de4f5!==0x0)return _0x1b6915(failure(_0x2e6d76(0x165),_0x4de4f5,_0x2ada2c||_0x19835e[_0x2e6d76(0x178)]||_0x2e6d76(0x189)+(_0x4de4f5??_0x2e6d76(0x166))));const _0xd3140f=_0x23134b?.[_0x2e6d76(0x164)]??resolveGlobalSkillName(_0x53b4dc),_0x1337dc=_0xd3140f?resolveInstalledSkill(_0xd3140f,_0x23134b?.[_0x2e6d76(0x174)]):undefined,_0x4499b3=_0x2ada2c[_0x2e6d76(0x17c)](/Failed to install\s+(\d+)/i);if(_0x4499b3&&Number(_0x4499b3[0x1])>0x0){const _0x4679fa=_0x2e6d76(0x168)+_0x4499b3[0x1]+_0x2e6d76(0x160)+(_0x2ada2c?':\x0a'+_0x2ada2c:'');if(_0x1337dc?.[_0x2e6d76(0x15e)]===_0x2e6d76(0x167))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x4499b3[0x1]),'output':_0x2ada2c}};return _0x1b6915(failure('INSTALL_PARTIAL',0x0,_0x4679fa));}if(_0xd3140f&&_0x1337dc){if(_0x1337dc[_0x2e6d76(0x15e)]===_0x2e6d76(0x163))return _0x1b6915(failure(_0x2e6d76(0x184),0x0,_0x2e6d76(0x17a)+_0xd3140f+_0x2e6d76(0x16a)+_0x1337dc[_0x2e6d76(0x171)][_0x2e6d76(0x185)](',\x20')+')'));_0x1337dc[_0x2e6d76(0x15e)]===_0x2e6d76(0x17f)&&console[_0x2e6d76(0x15c)](_0x2e6d76(0x18b)+_0xd3140f+_0x2e6d76(0x180)+_0x1337dc[_0x2e6d76(0x183)]);}return _0x1b6915({'ok':!![],'status':0x0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a138_0x2e7e(_0x1ae74a,_0x1efb73){_0x1ae74a=_0x1ae74a-0x1e8;const _0x57812b=a138_0x5781();let _0x2e7e45=_0x57812b[_0x1ae74a];return _0x2e7e45;}function a138_0x5781(){const _0x5b453d=['901285HKMGtp','coverage','82428jMtTRh','474728aTGTgW','656916fRhzfF','2PqAoAD','.turbo','SKILL.md','build','422226KiKMrq','.git','1173102PFgzra','241664OOKtQp','.hg','lovrabet.skill.json','135gsZOOB','.DS_Store'];a138_0x5781=function(){return _0x5b453d;};return a138_0x5781();}const a138_0x113ea2=a138_0x2e7e;(function(_0x362276,_0x3a7850){const _0x58ac0a=a138_0x2e7e,_0x58e797=_0x362276();while(!![]){try{const _0x428362=parseInt(_0x58ac0a(0x1e9))/0x1+-parseInt(_0x58ac0a(0x1ec))/0x2*(-parseInt(_0x58ac0a(0x1f0))/0x3)+parseInt(_0x58ac0a(0x1ea))/0x4+parseInt(_0x58ac0a(0x1f8))/0x5+-parseInt(_0x58ac0a(0x1eb))/0x6+parseInt(_0x58ac0a(0x1f2))/0x7+parseInt(_0x58ac0a(0x1f3))/0x8*(-parseInt(_0x58ac0a(0x1f6))/0x9);if(_0x428362===_0x3a7850)break;else _0x58e797['push'](_0x58e797['shift']());}catch(_0x1a7a9a){_0x58e797['push'](_0x58e797['shift']());}}}(a138_0x5781,0x1f071));export const METADATA_FILE=a138_0x113ea2(0x1f5);export const SKILL_FILE=a138_0x113ea2(0x1ee);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a138_0x113ea2(0x1f7)]);export const IGNORED_DIR_NAMES=new Set([a138_0x113ea2(0x1f1),a138_0x113ea2(0x1f4),'.svn','node_modules','.next','dist',a138_0x113ea2(0x1ef),a138_0x113ea2(0x1e8),a138_0x113ea2(0x1ed),'.cache']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x459d85,_0x303d43){const _0x4b7f7a=a139_0x52d2,_0x41fec0=_0x459d85();while(!![]){try{const _0xb1623a=-parseInt(_0x4b7f7a(0x114))/0x1+parseInt(_0x4b7f7a(0x10e))/0x2+parseInt(_0x4b7f7a(0x119))/0x3*(-parseInt(_0x4b7f7a(0x117))/0x4)+-parseInt(_0x4b7f7a(0x11c))/0x5+parseInt(_0x4b7f7a(0x11b))/0x6*(parseInt(_0x4b7f7a(0x10f))/0x7)+parseInt(_0x4b7f7a(0x112))/0x8+-parseInt(_0x4b7f7a(0x116))/0x9;if(_0xb1623a===_0x303d43)break;else _0x41fec0['push'](_0x41fec0['shift']());}catch(_0x2342a){_0x41fec0['push'](_0x41fec0['shift']());}}}(a139_0x218b,0xecc2c));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x55b88e,_0x94fb98){const _0x14b249=a139_0x52d2,_0x1e2c44=normalizeSkillRelativePath(_0x94fb98),_0x4f68fc=realOrResolved(_0x55b88e),_0x2fe7c0=resolve(_0x4f68fc,..._0x1e2c44['split']('/'));if(!isPathInside(_0x2fe7c0,_0x4f68fc))throw CliErrors[_0x14b249(0x11a)](_0x14b249(0x10c)+_0x94fb98);return ensureNoSymlinkInManagedPath(_0x4f68fc,_0x1e2c44),_0x2fe7c0;}export function ensureNoSymlinkInManagedPath(_0xd9fd83,_0x1f72de){const _0x24fd53=a139_0x52d2;let _0x102372=_0xd9fd83;for(const _0x26d651 of _0x1f72de[_0x24fd53(0x118)]('/')){_0x102372=resolve(_0x102372,_0x26d651);const _0x4fe76b=lstatIfPresent(_0x102372);if(_0x4fe76b?.[_0x24fd53(0x113)]())throw CliErrors[_0x24fd53(0x11a)](_0x24fd53(0x111)+_0x1f72de);}}export function isDanglingSymlink(_0x144750){const _0x322d65=a139_0x52d2;try{return lstatSync(_0x144750)[_0x322d65(0x113)]();}catch{return![];}}function a139_0x218b(){const _0x5ebd95=['10945056CquSBA','isSymbolicLink','21935MasVuk','endsWith','9502236gzEAzn','4KGUBcq','split','4207803TgaVyu','validation','6DbNDIk','4507980luFRzQ','utf8','startsWith','Unsafe\x20Skill\x20file\x20path:\x20','stringify','3761426EQFpZq','7720041FKUTny','from','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'];a139_0x218b=function(){return _0x5ebd95;};return a139_0x218b();}export function resolveSymlinkTarget(_0x3954be){const _0x40d976=readlinkSync(_0x3954be);return isAbsolute(_0x40d976)?_0x40d976:resolve(dirname(_0x3954be),_0x40d976);}export function isPathInside(_0x3569c0,_0x33235a){const _0x48f2d8=a139_0x52d2,_0x496592=_0x3569c0[_0x48f2d8(0x115)](sep)?_0x3569c0:''+_0x3569c0+sep,_0x1a7b88=_0x33235a['endsWith'](sep)?_0x33235a:''+_0x33235a+sep;return _0x3569c0===_0x33235a||_0x496592[_0x48f2d8(0x10b)](_0x1a7b88);}export function realOrResolved(_0x3b7710){try{return realpathSync(_0x3b7710);}catch{return resolve(_0x3b7710);}}export function lstatIfPresent(_0x4a1d97){try{return lstatSync(_0x4a1d97);}catch{return undefined;}}function a139_0x52d2(_0x1c46fa,_0x94f621){_0x1c46fa=_0x1c46fa-0x10a;const _0x218b06=a139_0x218b();let _0x52d216=_0x218b06[_0x1c46fa];return _0x52d216;}export function writeTextAtomic(_0x5f3b52,_0x20d9ac,_0x2d3e21){const _0x100807=a139_0x52d2;writeBytesAtomic(_0x5f3b52,Buffer[_0x100807(0x110)](_0x20d9ac,_0x100807(0x10a)),_0x2d3e21);}export function writeBytesAtomic(_0x130c8f,_0x30c8c9,_0x32bb39){const _0x4d5c8d=_0x130c8f+'.tmp';try{writeFileSync(_0x4d5c8d,_0x30c8c9,{'mode':_0x32bb39}),renameSync(_0x4d5c8d,_0x130c8f);}catch(_0x5909bf){try{rmSync(_0x4d5c8d,{'force':!![]});}catch{}throw _0x5909bf;}}export function writeJsonAtomic(_0x3f7d91,_0x120388){const _0x22f048=a139_0x52d2;writeTextAtomic(_0x3f7d91,JSON[_0x22f048(0x10d)](_0x120388,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a140_0x443b(){const _0x442ad2=['10528299FWleiH','sha256','update','244892kcgHkS','44jCbdVp','hex','size','21RCeMQX','2473863CxvvfO','6IfqwaM','digest','3365905AwFtTQ','32DcSYVx','1792320iZHpyv','1IaxfrY','7727604lxZyEo','1287502LAoDFI'];a140_0x443b=function(){return _0x442ad2;};return a140_0x443b();}(function(_0xba4deb,_0x5a9786){const _0xc9b645=a140_0x4f8c,_0x4ab23c=_0xba4deb();while(!![]){try{const _0x22072b=parseInt(_0xc9b645(0x1c0))/0x1*(-parseInt(_0xc9b645(0x1c2))/0x2)+-parseInt(_0xc9b645(0x1b9))/0x3*(parseInt(_0xc9b645(0x1c6))/0x4)+parseInt(_0xc9b645(0x1bd))/0x5*(parseInt(_0xc9b645(0x1bb))/0x6)+-parseInt(_0xc9b645(0x1ba))/0x7*(parseInt(_0xc9b645(0x1be))/0x8)+parseInt(_0xc9b645(0x1c3))/0x9+parseInt(_0xc9b645(0x1bf))/0xa*(parseInt(_0xc9b645(0x1b6))/0xb)+parseInt(_0xc9b645(0x1c1))/0xc;if(_0x22072b===_0x5a9786)break;else _0x4ab23c['push'](_0x4ab23c['shift']());}catch(_0x561461){_0x4ab23c['push'](_0x4ab23c['shift']());}}}(a140_0x443b,0xaf473));function a140_0x4f8c(_0x44e35b,_0x2130b8){_0x44e35b=_0x44e35b-0x1b6;const _0x443b00=a140_0x443b();let _0x4f8c57=_0x443b00[_0x44e35b];return _0x4f8c57;}import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x32674d){const _0x4831a7=a140_0x4f8c;return createHash(_0x4831a7(0x1c4))[_0x4831a7(0x1c5)](_0x32674d)[_0x4831a7(0x1bc)](_0x4831a7(0x1b7));}export function fileHash(_0x530139){return bufferSha256(fileContent(_0x530139));}export function bufferSha256(_0xd67b45){const _0x4da699=a140_0x4f8c;return createHash(_0x4da699(0x1c4))[_0x4da699(0x1c5)](_0xd67b45)[_0x4da699(0x1bc)](_0x4da699(0x1b7));}export function fileTreeHash(_0x2fb4ff){const _0x2d8dea=a140_0x4f8c,_0x27c63e=createHash('sha256');for(const _0x399020 of normalizeManifestFiles(_0x2fb4ff)){_0x27c63e[_0x2d8dea(0x1c5)](_0x399020['path']),_0x27c63e['update']('\x00'),_0x27c63e[_0x2d8dea(0x1c5)](_0x399020[_0x2d8dea(0x1c4)]),_0x27c63e[_0x2d8dea(0x1c5)]('\x00'),_0x27c63e[_0x2d8dea(0x1c5)](String(_0x399020[_0x2d8dea(0x1b8)])),_0x27c63e['update']('\x00');}return _0x27c63e[_0x2d8dea(0x1bc)]('hex');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a141_0x5cfe47=a141_0x2e56;(function(_0x12dd4c,_0x24bad5){const _0x3501c2=a141_0x2e56,_0x66639=_0x12dd4c();while(!![]){try{const _0xb5b5db=parseInt(_0x3501c2(0x17e))/0x1+-parseInt(_0x3501c2(0x180))/0x2*(-parseInt(_0x3501c2(0x175))/0x3)+-parseInt(_0x3501c2(0x177))/0x4*(parseInt(_0x3501c2(0x181))/0x5)+parseInt(_0x3501c2(0x174))/0x6+parseInt(_0x3501c2(0x178))/0x7*(-parseInt(_0x3501c2(0x172))/0x8)+parseInt(_0x3501c2(0x176))/0x9*(parseInt(_0x3501c2(0x170))/0xa)+-parseInt(_0x3501c2(0x17a))/0xb;if(_0xb5b5db===_0x24bad5)break;else _0x66639['push'](_0x66639['shift']());}catch(_0x5a588b){_0x66639['push'](_0x66639['shift']());}}}(a141_0x11c3,0x90322));import{resolve}from'node:path';function a141_0x2e56(_0x26793b,_0x5142b7){_0x26793b=_0x26793b-0x170;const _0x11c315=a141_0x11c3();let _0x2e560c=_0x11c315[_0x26793b];return _0x2e560c;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x56af57,_0x3b921a=a141_0x5cfe47(0x179),_0x3de4b3={}){const _0x3b9440=a141_0x5cfe47,_0x4727a0=resolveSkillSyncPaths(_0x3de4b3),_0x7cf5e1=safePathSegment(_0x56af57,_0x3b9440(0x17f)),_0x47b956=_0x3b921a===_0x3b9440(0x17b)?[resolve(_0x3de4b3['cwd']??process['cwd'](),_0x3b9440(0x17c),_0x3b9440(0x17d))]:runtimeAgentSkillRoots(_0x4727a0);return Object[_0x3b9440(0x173)]({'scope':_0x3b921a,'appCode':_0x7cf5e1,'skillRoots':Object[_0x3b9440(0x173)](_0x47b956),'managedRoot':_0x4727a0[_0x3b9440(0x171)]});}function a141_0x11c3(){const _0xc473e2=['7BnMlID','global','20024719BhCTMb','project','.agents','skills','1086704MbdwWC','appCode','364WSfqGE','2095OFmFlW','11307770kXiwzr','managedRoot','685048vUJGiz','freeze','6407670CNDjhN','3768dBxDtW','9TNlKPO','9712VaFvsl'];a141_0x11c3=function(){return _0xc473e2;};return a141_0x11c3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x2e161c=a142_0x1005;(function(_0x3ae6b9,_0x38b550){const _0x162420=a142_0x1005,_0x1bb553=_0x3ae6b9();while(!![]){try{const _0x5cf624=-parseInt(_0x162420(0x182))/0x1+-parseInt(_0x162420(0x193))/0x2+-parseInt(_0x162420(0x1b1))/0x3*(-parseInt(_0x162420(0x184))/0x4)+-parseInt(_0x162420(0x18b))/0x5+parseInt(_0x162420(0x186))/0x6*(-parseInt(_0x162420(0x195))/0x7)+-parseInt(_0x162420(0x18a))/0x8+-parseInt(_0x162420(0x1aa))/0x9*(-parseInt(_0x162420(0x19d))/0xa);if(_0x5cf624===_0x38b550)break;else _0x1bb553['push'](_0x1bb553['shift']());}catch(_0x12569d){_0x1bb553['push'](_0x1bb553['shift']());}}}(a142_0x1aba,0x2f394));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a142_0x152fd2 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a142_0x152fd2,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a142_0x2e161c(0x1b5),a142_0x2e161c(0x17b)]);function a142_0x1005(_0x42da6d,_0x53fd4c){_0x42da6d=_0x42da6d-0x179;const _0x1aba01=a142_0x1aba();let _0x10051f=_0x1aba01[_0x42da6d];return _0x10051f;}export function linkEffectiveRuntimeSkills(_0x292411,_0x33014e){const _0x58c893=a142_0x2e161c,_0x37275f=new Map();for(const _0x3617cf of _0x292411){const _0x2b8938=_0x3617cf[_0x58c893(0x1b0)][_0x58c893(0x191)];if(!_0x2b8938)continue;const _0x3acde5=_0x37275f['get'](_0x2b8938);(!_0x3acde5||_0x3617cf[_0x58c893(0x1ae)]===_0x58c893(0x188))&&_0x37275f[_0x58c893(0x189)](_0x2b8938,_0x3617cf);}const _0x38a3b1=[];for(const _0x117869 of _0x37275f['values']()){const _0x2e37b3=requireSkillCode(_0x117869[_0x58c893(0x1b0)]),_0x36dcf7=readMetadataIfPresent(_0x117869[_0x58c893(0x1a4)]);if(_0x36dcf7?.[_0x58c893(0x1ab)]!==_0x33014e[_0x58c893(0x1ab)]||_0x36dcf7[_0x58c893(0x191)]!==_0x2e37b3)throw CliErrors[_0x58c893(0x19b)](_0x58c893(0x1b4)+_0x33014e['appCode']+':\x20'+_0x117869['metadataPath']);const _0x224821=runtimeSkillLinkName(_0x33014e,_0x2e37b3);for(const _0x2c9c90 of _0x33014e[_0x58c893(0x179)]){_0x38a3b1[_0x58c893(0x1a3)](ensureManagedSymlink(resolve(_0x2c9c90,_0x224821),_0x117869[_0x58c893(0x1a8)],_0x33014e,_0x2e37b3));}}return _0x38a3b1;}function a142_0x1aba(){const _0x7bd955=['84380Uawpuj','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','slice','activeSkillCodes','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','managedRoot','push','metadataPath','scopes','accessKey','external-symlink','dir','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','1422jXPOUA','appCode','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','metadata-mismatch','scope','env','skill','3YgXnMX','filter','length','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','runtime-observe','trim','skillRoots','has','secret-retriever','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','company','created','isSymbolicLink','linked-from-protected-root','name','374012pyHbNR','not-managed-symlink','298428soSGng','skipped','148206rPycQN','map','personal','set','2661224VkMGdr','939280EASwEe','pruneSkillCodes','protectedLinkRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','updated','startsWith','skillCode','project','145704qPZPwL','builtin','70qHqYWO','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','contentHash','unchanged','agentsSkillsDir','isDirectory','validation','removed'];a142_0x1aba=function(){return _0x7bd955;};return a142_0x1aba();}export function pruneStaleRuntimeSkillLinks(_0x259c83,_0xbee37,_0x5f2465){const _0x515dc8=a142_0x2e161c,_0x5ab605=new Set([..._0xbee37][_0x515dc8(0x187)](_0x15555c=>_0x15555c[_0x515dc8(0x1b6)]())[_0x515dc8(0x1b2)](Boolean)),_0x442a6b=_0x5f2465?new Set([..._0x5f2465][_0x515dc8(0x187)](_0x23c1e9=>_0x23c1e9['trim']())[_0x515dc8(0x1b2)](Boolean)):undefined,_0x1cba37=[];for(const _0x1b7317 of _0x259c83[_0x515dc8(0x179)]){for(const _0x556c0e of managedTargetSkillLinkPaths(_0x1b7317,_0x259c83)){const _0x2b4d6f=runtimeSkillCodeFromLink(_0x259c83,_0x556c0e);if(_0x442a6b&&!_0x442a6b['has'](_0x2b4d6f))continue;if(_0x5ab605[_0x515dc8(0x17a)](_0x2b4d6f))continue;_0x1cba37[_0x515dc8(0x1a3)](removeManagedSkillLink(_0x556c0e,_0x259c83,_0x2b4d6f));}}return _0x1cba37;}export function pruneStaleRuntimeSkillCache(_0x2f5980,_0x5aa2ef={}){const _0x1fbeb5=a142_0x2e161c,_0x2c70de=new Set([..._0x2f5980[_0x1fbeb5(0x1a0)]][_0x1fbeb5(0x187)](_0x1008a6=>_0x1008a6[_0x1fbeb5(0x1b6)]())['filter'](Boolean)),_0x40fe56=_0x2f5980[_0x1fbeb5(0x18c)]?new Set([..._0x2f5980[_0x1fbeb5(0x18c)]][_0x1fbeb5(0x187)](_0x18c4dc=>_0x18c4dc[_0x1fbeb5(0x1b6)]())[_0x1fbeb5(0x1b2)](Boolean)):undefined,_0x163e10=_0x2f5980[_0x1fbeb5(0x1a5)]??['personal',_0x1fbeb5(0x17d)],_0x3d430c=resolve(getRuntimeSkillCacheRoot(_0x2f5980[_0x1fbeb5(0x1af)],_0x2f5980[_0x1fbeb5(0x1a6)],_0x5aa2ef),safePathSegment(_0x2f5980['appCode'],_0x1fbeb5(0x1ab))),_0x1ce61c=[];for(const _0x5049d8 of _0x163e10){const _0x36df87=resolve(_0x3d430c,_0x5049d8);if(!existsSync(_0x36df87))continue;for(const _0x144fc6 of readdirSync(_0x36df87,{'withFileTypes':!![]})){if(!_0x144fc6['isDirectory']())continue;const _0x16119a=_0x144fc6[_0x1fbeb5(0x181)];if(_0x40fe56&&!_0x40fe56['has'](_0x16119a))continue;if(_0x2c70de[_0x1fbeb5(0x17a)](_0x16119a))continue;const _0x2799d1=resolve(_0x36df87,_0x16119a),_0x5a8d4b=readMetadataIfPresent(resolve(_0x2799d1,METADATA_FILE));if(_0x5a8d4b?.[_0x1fbeb5(0x1ab)]!==_0x2f5980['appCode']||_0x5a8d4b['scope']!==_0x5049d8||_0x5a8d4b[_0x1fbeb5(0x191)]!==_0x16119a){_0x1ce61c['push']({'path':_0x2799d1,'action':_0x1fbeb5(0x185),'reason':_0x1fbeb5(0x1ad)});continue;}if(isLinkedFromAnyRoot(_0x2799d1,_0x2f5980[_0x1fbeb5(0x18d)]??[])){_0x1ce61c[_0x1fbeb5(0x1a3)]({'path':_0x2799d1,'action':_0x1fbeb5(0x185),'reason':_0x1fbeb5(0x180)});continue;}removeSync(_0x2799d1),_0x1ce61c[_0x1fbeb5(0x1a3)]({'path':_0x2799d1,'action':_0x1fbeb5(0x19c)});}}return _0x1ce61c;}export function linkGlobalRuntimeSkills(_0x309c30,_0x40472e={}){const _0x6e8277=a142_0x2e161c,_0x465e8d=resolveSkillSyncPaths(_0x40472e),_0x253521=[];for(const _0x5023a7 of _0x309c30){if(_0x5023a7[_0x6e8277(0x1ae)]!=='builtin')throw CliErrors['validation'](_0x6e8277(0x17c)+_0x5023a7['scope']);const _0x1a6446=requireSkillCode(_0x5023a7[_0x6e8277(0x1b0)]),_0x50c29f=copyManagedSkillDirectory(_0x5023a7[_0x6e8277(0x1a8)],resolve(_0x465e8d[_0x6e8277(0x199)],_0x1a6446));_0x253521[_0x6e8277(0x1a3)]({..._0x50c29f,'contentHash':_0x5023a7[_0x6e8277(0x197)]});}return _0x253521;}function ensureManagedSymlink(_0x1360ac,_0x15b65e,_0x5a8fcb,_0x537455){const _0x44cf54=a142_0x2e161c;mkdirSync(dirname(_0x1360ac),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x1360ac)||isDanglingSymlink(_0x1360ac)){const _0x26965b=lstatSync(_0x1360ac);if(!_0x26965b[_0x44cf54(0x17f)]())throw CliErrors[_0x44cf54(0x19b)](_0x44cf54(0x196)+_0x1360ac);const _0x60e75f=resolveSymlinkTarget(_0x1360ac);if(!isPathInside(realOrResolved(_0x60e75f),realOrResolved(_0x5a8fcb[_0x44cf54(0x1a2)])))throw CliErrors[_0x44cf54(0x19b)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x1360ac);if(realOrResolved(_0x60e75f)===realOrResolved(_0x15b65e))return{'path':_0x1360ac,'target':_0x15b65e,'action':_0x44cf54(0x198)};const _0x206c28=readMetadataIfPresent(resolve(_0x60e75f,METADATA_FILE));if(_0x5a8fcb[_0x44cf54(0x1ae)]===_0x44cf54(0x192)&&(_0x206c28?.[_0x44cf54(0x1ab)]!==_0x5a8fcb[_0x44cf54(0x1ab)]||_0x206c28[_0x44cf54(0x191)]!==_0x537455))throw CliErrors[_0x44cf54(0x19b)](_0x44cf54(0x19e)+_0x1360ac);return unlinkSync(_0x1360ac),symlinkSync(_0x15b65e,_0x1360ac,_0x44cf54(0x1a8)),{'path':_0x1360ac,'target':_0x15b65e,'action':_0x44cf54(0x18f)};}return symlinkSync(_0x15b65e,_0x1360ac,'dir'),{'path':_0x1360ac,'target':_0x15b65e,'action':'created'};}function managedTargetSkillLinkPaths(_0x434ffa,_0x1040ce){const _0x17e52c=a142_0x2e161c;if(!existsSync(_0x434ffa))return[];const _0x25abb4=_0x1040ce[_0x17e52c(0x1ab)]+'--';return readdirSync(_0x434ffa,{'withFileTypes':!![]})[_0x17e52c(0x1b2)](_0x12bc9a=>_0x1040ce[_0x17e52c(0x1ae)]===_0x17e52c(0x192)||_0x12bc9a[_0x17e52c(0x181)][_0x17e52c(0x190)](_0x25abb4))[_0x17e52c(0x187)](_0x1c5c68=>resolve(_0x434ffa,_0x1c5c68['name']));}function removeManagedSkillLink(_0x3da645,_0x4662d7,_0x735770){const _0x416536=a142_0x2e161c,_0x19a2ec=lstatIfPresent(_0x3da645);if(!_0x19a2ec?.[_0x416536(0x17f)]())return{'path':_0x3da645,'action':'skipped','reason':_0x416536(0x183)};const _0x24a4b8=resolveSymlinkTarget(_0x3da645);if(!isPathInside(realOrResolved(_0x24a4b8),realOrResolved(_0x4662d7['managedRoot'])))return{'path':_0x3da645,'action':_0x416536(0x185),'reason':_0x416536(0x1a7)};const _0x48cb55=readMetadataIfPresent(resolve(_0x24a4b8,METADATA_FILE));if(_0x4662d7['scope']===_0x416536(0x192)&&(_0x48cb55?.['appCode']!==_0x4662d7[_0x416536(0x1ab)]||_0x48cb55[_0x416536(0x191)]!==_0x735770))return{'path':_0x3da645,'action':_0x416536(0x185),'reason':_0x416536(0x1ad)};return unlinkSync(_0x3da645),{'path':_0x3da645,'action':'removed'};}function isLinkedFromAnyRoot(_0x52aadf,_0x1e995f){const _0x3e145f=a142_0x2e161c,_0x3dc2aa=realOrResolved(_0x52aadf);for(const _0xea5972 of _0x1e995f){if(!existsSync(_0xea5972))continue;for(const _0x467542 of readdirSync(_0xea5972,{'withFileTypes':!![]})){if(!_0x467542[_0x3e145f(0x17f)]())continue;const _0xc38391=resolve(_0xea5972,_0x467542['name']);if(realOrResolved(resolveSymlinkTarget(_0xc38391))===_0x3dc2aa)return!![];}}return![];}function runtimeSkillLinkName(_0x130328,_0x52eff3){const _0x562c89=a142_0x2e161c,_0x3db72b=safePathSegment(_0x52eff3,'skillCode');if(_0x130328['scope']===_0x562c89(0x192)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x3db72b))throw CliErrors[_0x562c89(0x19b)](_0x562c89(0x1a9)+_0x3db72b);return _0x130328[_0x562c89(0x1ae)]===_0x562c89(0x192)?_0x3db72b:_0x130328[_0x562c89(0x1ab)]+'--'+_0x3db72b;}function runtimeSkillCodeFromLink(_0x2bbba7,_0x34cf80){const _0x2c2a69=a142_0x2e161c,_0x45e1aa=basename(_0x34cf80);return _0x2bbba7[_0x2c2a69(0x1ae)]===_0x2c2a69(0x192)?_0x45e1aa:_0x45e1aa[_0x2c2a69(0x19f)]((_0x2bbba7['appCode']+'--')[_0x2c2a69(0x1b3)]);}export function copyManagedSkillDirectory(_0x311dda,_0x5a64bb){const _0x1088c7=a142_0x2e161c,_0x37e442=resolve(_0x5a64bb,METADATA_FILE),_0x19fe72=existsSync(_0x5a64bb);if(_0x19fe72){const _0x64e1e2=lstatSync(_0x5a64bb);if(_0x64e1e2[_0x1088c7(0x17f)]())throw CliErrors['validation'](_0x1088c7(0x1ac)+_0x5a64bb);if(!_0x64e1e2[_0x1088c7(0x19a)]())throw CliErrors['validation'](_0x1088c7(0x1a1)+_0x5a64bb);const _0x29cdcc=readMetadataIfPresent(_0x37e442);if(_0x29cdcc?.[_0x1088c7(0x1ae)]!==_0x1088c7(0x194))throw CliErrors[_0x1088c7(0x19b)](_0x1088c7(0x18e)+_0x5a64bb);}ensureDirSync(dirname(_0x5a64bb));const _0x597e22=_0x19fe72?readMetadataIfPresent(_0x37e442)?.[_0x1088c7(0x197)]:undefined,_0x2ffd5f=readMetadataIfPresent(resolve(_0x311dda,METADATA_FILE))?.[_0x1088c7(0x197)];return _0x19fe72&&removeSync(_0x5a64bb),copySkillDirectory(_0x311dda,_0x5a64bb),{'path':_0x5a64bb,'target':_0x311dda,'action':!_0x19fe72?_0x1088c7(0x17e):_0x597e22===_0x2ffd5f?_0x1088c7(0x198):_0x1088c7(0x18f)};}function copySkillDirectory(_0x3ad0a7,_0x32d356){copySync(_0x3ad0a7,_0x32d356,{'dereference':![],'overwrite':!![],'filter'(_0x3a6f5c){const _0x4e63df=a142_0x1005;if(lstatSync(_0x3a6f5c)[_0x4e63df(0x17f)]())throw CliErrors[_0x4e63df(0x19b)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x3a6f5c);return!![];}});}
|
|
1
|
+
const a142_0x1635b4=a142_0x244c;(function(_0x1c0963,_0x1f3c7b){const _0x709521=a142_0x244c,_0xef4a71=_0x1c0963();while(!![]){try{const _0x1d321d=-parseInt(_0x709521(0x1c4))/0x1+-parseInt(_0x709521(0x1c8))/0x2*(parseInt(_0x709521(0x1c9))/0x3)+-parseInt(_0x709521(0x1bb))/0x4*(-parseInt(_0x709521(0x1c2))/0x5)+parseInt(_0x709521(0x1b6))/0x6+-parseInt(_0x709521(0x1ea))/0x7+-parseInt(_0x709521(0x1d1))/0x8*(-parseInt(_0x709521(0x1f1))/0x9)+-parseInt(_0x709521(0x1d6))/0xa*(parseInt(_0x709521(0x1e0))/0xb);if(_0x1d321d===_0x1f3c7b)break;else _0xef4a71['push'](_0xef4a71['shift']());}catch(_0x49b223){_0xef4a71['push'](_0xef4a71['shift']());}}}(a142_0x53b1,0xa4ee8));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a142_0x4be12c from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a142_0x4be12c,RESERVED_PROJECT_SKILL_CODES=new Set([a142_0x1635b4(0x1ee),a142_0x1635b4(0x1e6),a142_0x1635b4(0x1eb)]);export function linkEffectiveRuntimeSkills(_0xac8b53,_0x3ecc43){const _0x1688d9=a142_0x1635b4,_0x38e03c=new Map();for(const _0x144ce6 of _0xac8b53){const _0x585f69=_0x144ce6[_0x1688d9(0x1bd)][_0x1688d9(0x1bf)];if(!_0x585f69)continue;const _0x4f136d=_0x38e03c[_0x1688d9(0x1d9)](_0x585f69);(!_0x4f136d||_0x144ce6[_0x1688d9(0x1e5)]==='personal')&&_0x38e03c[_0x1688d9(0x1d7)](_0x585f69,_0x144ce6);}const _0x2d12e0=[];for(const _0x141377 of _0x38e03c[_0x1688d9(0x1be)]()){const _0x773345=requireSkillCode(_0x141377['skill']),_0x36e391=readMetadataIfPresent(_0x141377[_0x1688d9(0x1d4)]);if(_0x36e391?.[_0x1688d9(0x1e2)]!==_0x3ecc43['appCode']||_0x36e391[_0x1688d9(0x1bf)]!==_0x773345)throw CliErrors[_0x1688d9(0x1e1)](_0x1688d9(0x1dd)+_0x3ecc43[_0x1688d9(0x1e2)]+':\x20'+_0x141377[_0x1688d9(0x1d4)]);const _0x58d92a=runtimeSkillLinkName(_0x3ecc43,_0x773345);for(const _0x322b97 of _0x3ecc43['skillRoots']){_0x2d12e0[_0x1688d9(0x1dc)](ensureManagedSymlink(resolve(_0x322b97,_0x58d92a),_0x141377[_0x1688d9(0x1c1)],_0x3ecc43,_0x773345));}}return _0x2d12e0;}export function pruneStaleRuntimeSkillLinks(_0x18b48c,_0x1e107d,_0x568ffd){const _0x465939=a142_0x1635b4,_0x368118=new Set([..._0x1e107d][_0x465939(0x1ed)](_0x83cca0=>_0x83cca0['trim']())[_0x465939(0x1b4)](Boolean)),_0x1d468b=_0x568ffd?new Set([..._0x568ffd][_0x465939(0x1ed)](_0x20914e=>_0x20914e[_0x465939(0x1c7)]())['filter'](Boolean)):undefined,_0x173ca6=[];for(const _0x218b8a of _0x18b48c[_0x465939(0x1cd)]){for(const _0x23c0ca of managedTargetSkillLinkPaths(_0x218b8a,_0x18b48c)){const _0x278dde=runtimeSkillCodeFromLink(_0x18b48c,_0x23c0ca);if(_0x1d468b&&!_0x1d468b['has'](_0x278dde))continue;if(_0x368118[_0x465939(0x1f2)](_0x278dde))continue;_0x173ca6['push'](removeManagedSkillLink(_0x23c0ca,_0x18b48c,_0x278dde));}}return _0x173ca6;}export function pruneStaleRuntimeSkillCache(_0xa7125a,_0x555991={}){const _0x513d8f=a142_0x1635b4,_0x222af7=new Set([..._0xa7125a[_0x513d8f(0x1d5)]][_0x513d8f(0x1ed)](_0x5e06e9=>_0x5e06e9[_0x513d8f(0x1c7)]())[_0x513d8f(0x1b4)](Boolean)),_0x23d65e=_0xa7125a[_0x513d8f(0x1ba)]?new Set([..._0xa7125a[_0x513d8f(0x1ba)]]['map'](_0x6e47d5=>_0x6e47d5[_0x513d8f(0x1c7)]())[_0x513d8f(0x1b4)](Boolean)):undefined,_0x153eb1=_0xa7125a[_0x513d8f(0x1c5)]??[_0x513d8f(0x1c0),_0x513d8f(0x1da)],_0x25c469=resolve(getRuntimeSkillCacheRoot(_0xa7125a[_0x513d8f(0x1c3)],_0xa7125a[_0x513d8f(0x1c6)],_0x555991),safePathSegment(_0xa7125a[_0x513d8f(0x1e2)],_0x513d8f(0x1e2))),_0x6cc1fe=[];for(const _0x4d67a2 of _0x153eb1){const _0x29e9d8=resolve(_0x25c469,_0x4d67a2);if(!existsSync(_0x29e9d8))continue;for(const _0x855b38 of readdirSync(_0x29e9d8,{'withFileTypes':!![]})){if(!_0x855b38['isDirectory']())continue;const _0xa7516=_0x855b38[_0x513d8f(0x1ce)];if(_0x23d65e&&!_0x23d65e[_0x513d8f(0x1f2)](_0xa7516))continue;if(_0x222af7[_0x513d8f(0x1f2)](_0xa7516))continue;const _0x1b55c5=resolve(_0x29e9d8,_0xa7516),_0x5ee1e1=readMetadataIfPresent(resolve(_0x1b55c5,METADATA_FILE));if(_0x5ee1e1?.[_0x513d8f(0x1e2)]!==_0xa7125a['appCode']||_0x5ee1e1[_0x513d8f(0x1e5)]!==_0x4d67a2||_0x5ee1e1[_0x513d8f(0x1bf)]!==_0xa7516){_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1cb),'reason':_0x513d8f(0x1e7)});continue;}if(isLinkedFromAnyRoot(_0x1b55c5,_0xa7125a[_0x513d8f(0x1ef)]??[])){_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1cb),'reason':_0x513d8f(0x1b7)});continue;}removeSync(_0x1b55c5),_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1ec)});}}return _0x6cc1fe;}export function linkGlobalRuntimeSkills(_0x392e85,_0x2bf7eb={}){const _0x1671d5=a142_0x1635b4,_0x5c7fc7=resolveSkillSyncPaths(_0x2bf7eb),_0x4cd1f8=[];for(const _0x30a189 of _0x392e85){if(_0x30a189[_0x1671d5(0x1e5)]!==_0x1671d5(0x1d3))throw CliErrors[_0x1671d5(0x1e1)](_0x1671d5(0x1e9)+_0x30a189[_0x1671d5(0x1e5)]);const _0x3f7b23=requireSkillCode(_0x30a189[_0x1671d5(0x1bd)]),_0x29303f=copyManagedSkillDirectory(_0x30a189[_0x1671d5(0x1c1)],resolve(_0x5c7fc7[_0x1671d5(0x1de)],_0x3f7b23));_0x4cd1f8['push']({..._0x29303f,'contentHash':_0x30a189[_0x1671d5(0x1cc)]});}return _0x4cd1f8;}function ensureManagedSymlink(_0xd6b231,_0x18f420,_0x123d32,_0x5cf4b5){const _0x27610c=a142_0x1635b4;mkdirSync(dirname(_0xd6b231),{'recursive':!![],'mode':0x1c0});if(existsSync(_0xd6b231)||isDanglingSymlink(_0xd6b231)){const _0x5a8766=lstatSync(_0xd6b231);if(!_0x5a8766[_0x27610c(0x1e4)]())throw CliErrors[_0x27610c(0x1e1)](_0x27610c(0x1bc)+_0xd6b231);const _0xc45789=resolveSymlinkTarget(_0xd6b231);if(!isPathInside(realOrResolved(_0xc45789),realOrResolved(_0x123d32[_0x27610c(0x1f0)])))throw CliErrors[_0x27610c(0x1e1)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0xd6b231);if(realOrResolved(_0xc45789)===realOrResolved(_0x18f420))return{'path':_0xd6b231,'target':_0x18f420,'action':_0x27610c(0x1e3)};const _0x25c0d8=readMetadataIfPresent(resolve(_0xc45789,METADATA_FILE));if(_0x123d32[_0x27610c(0x1e5)]==='project'&&(_0x25c0d8?.[_0x27610c(0x1e2)]!==_0x123d32[_0x27610c(0x1e2)]||_0x25c0d8[_0x27610c(0x1bf)]!==_0x5cf4b5))throw CliErrors['validation'](_0x27610c(0x1df)+_0xd6b231);return unlinkSync(_0xd6b231),symlinkSync(_0x18f420,_0xd6b231,_0x27610c(0x1c1)),{'path':_0xd6b231,'target':_0x18f420,'action':'updated'};}return symlinkSync(_0x18f420,_0xd6b231,_0x27610c(0x1c1)),{'path':_0xd6b231,'target':_0x18f420,'action':_0x27610c(0x1b5)};}function managedTargetSkillLinkPaths(_0x2f8d42,_0x2a9c02){const _0x12707e=a142_0x1635b4;if(!existsSync(_0x2f8d42))return[];const _0x43c9c2=_0x2a9c02[_0x12707e(0x1e2)]+'--';return readdirSync(_0x2f8d42,{'withFileTypes':!![]})['filter'](_0xbe8e17=>_0x2a9c02[_0x12707e(0x1e5)]===_0x12707e(0x1e8)||_0xbe8e17[_0x12707e(0x1ce)][_0x12707e(0x1d2)](_0x43c9c2))[_0x12707e(0x1ed)](_0x4914f0=>resolve(_0x2f8d42,_0x4914f0[_0x12707e(0x1ce)]));}function removeManagedSkillLink(_0x27970f,_0x3080af,_0x223fb1){const _0x1436de=a142_0x1635b4,_0x234559=lstatIfPresent(_0x27970f);if(!_0x234559?.[_0x1436de(0x1e4)]())return{'path':_0x27970f,'action':'skipped','reason':'not-managed-symlink'};const _0x40ee16=resolveSymlinkTarget(_0x27970f);if(!isPathInside(realOrResolved(_0x40ee16),realOrResolved(_0x3080af[_0x1436de(0x1f0)])))return{'path':_0x27970f,'action':_0x1436de(0x1cb),'reason':'external-symlink'};const _0x4e47c2=readMetadataIfPresent(resolve(_0x40ee16,METADATA_FILE));if(_0x3080af[_0x1436de(0x1e5)]===_0x1436de(0x1e8)&&(_0x4e47c2?.[_0x1436de(0x1e2)]!==_0x3080af['appCode']||_0x4e47c2[_0x1436de(0x1bf)]!==_0x223fb1))return{'path':_0x27970f,'action':_0x1436de(0x1cb),'reason':'metadata-mismatch'};return unlinkSync(_0x27970f),{'path':_0x27970f,'action':_0x1436de(0x1ec)};}function isLinkedFromAnyRoot(_0x30cc4c,_0x33c9ef){const _0xa975e1=a142_0x1635b4,_0x42d5e5=realOrResolved(_0x30cc4c);for(const _0xb55839 of _0x33c9ef){if(!existsSync(_0xb55839))continue;for(const _0x123c32 of readdirSync(_0xb55839,{'withFileTypes':!![]})){if(!_0x123c32[_0xa975e1(0x1e4)]())continue;const _0x23e9f6=resolve(_0xb55839,_0x123c32[_0xa975e1(0x1ce)]);if(realOrResolved(resolveSymlinkTarget(_0x23e9f6))===_0x42d5e5)return!![];}}return![];}function runtimeSkillLinkName(_0x2ea6fc,_0x32fa42){const _0x2041d8=a142_0x1635b4,_0x1efb8a=safePathSegment(_0x32fa42,_0x2041d8(0x1bf));if(_0x2ea6fc[_0x2041d8(0x1e5)]===_0x2041d8(0x1e8)&&RESERVED_PROJECT_SKILL_CODES[_0x2041d8(0x1f2)](_0x1efb8a))throw CliErrors[_0x2041d8(0x1e1)](_0x2041d8(0x1b8)+_0x1efb8a);return _0x2ea6fc[_0x2041d8(0x1e5)]===_0x2041d8(0x1e8)?_0x1efb8a:_0x2ea6fc[_0x2041d8(0x1e2)]+'--'+_0x1efb8a;}function a142_0x53b1(){const _0x444abf=['builtin','metadataPath','activeSkillCodes','850530fBWNCX','set','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','get','company','updated','push','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','agentsSkillsDir','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','33eWELgE','validation','appCode','unchanged','isSymbolicLink','scope','runtime-observe','metadata-mismatch','project','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','3159618iLCRUX','secret-retriever','removed','map','lovrabet','protectedLinkRoots','managedRoot','12105630XwHXAi','has','length','filter','created','1624812fntMHO','linked-from-protected-root','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','pruneSkillCodes','1781908QdyytH','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','skill','values','skillCode','personal','dir','10BZWxcn','env','432213WbRXGb','scopes','accessKey','trim','120Usqice','34626HQvJSv','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','skipped','contentHash','skillRoots','name','slice','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','8ImJuqn','startsWith'];a142_0x53b1=function(){return _0x444abf;};return a142_0x53b1();}function a142_0x244c(_0xf22f1a,_0x5eebb0){_0xf22f1a=_0xf22f1a-0x1b4;const _0x53b1c2=a142_0x53b1();let _0x244c38=_0x53b1c2[_0xf22f1a];return _0x244c38;}function runtimeSkillCodeFromLink(_0x1ce9e6,_0x54b371){const _0x5320e4=a142_0x1635b4,_0x4aa568=basename(_0x54b371);return _0x1ce9e6['scope']===_0x5320e4(0x1e8)?_0x4aa568:_0x4aa568[_0x5320e4(0x1cf)]((_0x1ce9e6['appCode']+'--')[_0x5320e4(0x1f3)]);}export function copyManagedSkillDirectory(_0x2d1a52,_0x49fe5b){const _0x559def=a142_0x1635b4,_0x584bd=resolve(_0x49fe5b,METADATA_FILE),_0x2994ad=existsSync(_0x49fe5b);if(_0x2994ad){const _0x5e5baa=lstatSync(_0x49fe5b);if(_0x5e5baa[_0x559def(0x1e4)]())throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1b9)+_0x49fe5b);if(!_0x5e5baa['isDirectory']())throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1d8)+_0x49fe5b);const _0x32aafa=readMetadataIfPresent(_0x584bd);if(_0x32aafa?.[_0x559def(0x1e5)]!==_0x559def(0x1d3))throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1ca)+_0x49fe5b);}ensureDirSync(dirname(_0x49fe5b));const _0x4ff9f7=_0x2994ad?readMetadataIfPresent(_0x584bd)?.[_0x559def(0x1cc)]:undefined,_0x384997=readMetadataIfPresent(resolve(_0x2d1a52,METADATA_FILE))?.['contentHash'];return _0x2994ad&&removeSync(_0x49fe5b),copySkillDirectory(_0x2d1a52,_0x49fe5b),{'path':_0x49fe5b,'target':_0x2d1a52,'action':!_0x2994ad?_0x559def(0x1b5):_0x4ff9f7===_0x384997?'unchanged':_0x559def(0x1db)};}function copySkillDirectory(_0x3a223b,_0x2b3048){copySync(_0x3a223b,_0x2b3048,{'dereference':![],'overwrite':!![],'filter'(_0x4ddc88){const _0x2fe5c0=a142_0x244c;if(lstatSync(_0x4ddc88)['isSymbolicLink']())throw CliErrors[_0x2fe5c0(0x1e1)](_0x2fe5c0(0x1d0)+_0x4ddc88);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x293377,_0x4c3678){const _0x11e593=a143_0x53e7,_0xfd5cb6=_0x293377();while(!![]){try{const _0xdd5029=-parseInt(_0x11e593(0x168))/0x1+parseInt(_0x11e593(0x177))/0x2+parseInt(_0x11e593(0x192))/0x3*(parseInt(_0x11e593(0x167))/0x4)+parseInt(_0x11e593(0x193))/0x5*(-parseInt(_0x11e593(0x17e))/0x6)+-parseInt(_0x11e593(0x179))/0x7+-parseInt(_0x11e593(0x187))/0x8+-parseInt(_0x11e593(0x183))/0x9*(-parseInt(_0x11e593(0x18f))/0xa);if(_0xdd5029===_0x4c3678)break;else _0xfd5cb6['push'](_0xfd5cb6['shift']());}catch(_0x2bc6e3){_0xfd5cb6['push'](_0xfd5cb6['shift']());}}}(a143_0x1d74,0x6644f));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a143_0x53e7(_0x3c82a0,_0x6f2a54){_0x3c82a0=_0x3c82a0-0x166;const _0x1d74bc=a143_0x1d74();let _0x53e7f4=_0x1d74bc[_0x3c82a0];return _0x53e7f4;}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0xbc6329,_0x34e833,_0x4ffac8={}){const _0x71b5e8=a143_0x53e7,_0x174f01=safePathSegment(_0xbc6329[_0x71b5e8(0x16c)],_0x71b5e8(0x16c));if(_0x34e833[_0x71b5e8(0x16c)]!==_0x174f01)throw CliErrors[_0x71b5e8(0x16e)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x34e833['appCode']+_0x71b5e8(0x18e)+_0x174f01);const _0x554648=normalizeRuntimeSkillScopes(_0xbc6329[_0x71b5e8(0x180)]),_0x2b5bb1=new Set(_0x554648),_0x79484=_0xbc6329['code']?.[_0x71b5e8(0x185)](),_0x2e4d5c=new Map(),_0x3fa83c=resolve(getRuntimeSkillCacheRoot(_0xbc6329[_0x71b5e8(0x17d)],_0xbc6329[_0x71b5e8(0x170)],_0x4ffac8),_0x174f01);for(const _0x3b799f of _0x554648){for(const _0x535b67 of localSkillEntryDirs(resolve(_0x3fa83c,_0x3b799f))){collectLocalRuntimeSkill(_0x2e4d5c,_0x535b67,{'appCode':_0x174f01,'scopes':_0x2b5bb1,'code':_0x79484,'source':'cache'});}}for(const _0x47bf5a of _0x34e833[_0x71b5e8(0x18a)]){for(const _0x209104 of localSkillLinkCandidates(_0x47bf5a,_0x34e833,_0x2b5bb1)){collectLocalRuntimeSkill(_0x2e4d5c,_0x209104,{'appCode':_0x174f01,'scopes':_0x2b5bb1,'code':_0x79484,'source':_0x71b5e8(0x16b),'linkedPath':_0x209104});}}return Array[_0x71b5e8(0x190)](_0x2e4d5c['values']())[_0x71b5e8(0x188)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x4df0ab){const _0x262c36=a143_0x53e7;if(!existsSync(_0x4df0ab))return[];return readdirSync(_0x4df0ab,{'withFileTypes':!![]})[_0x262c36(0x173)](_0x3aa690=>_0x3aa690['isDirectory']()||_0x3aa690[_0x262c36(0x182)]())[_0x262c36(0x18c)](_0x4e0308=>resolve(_0x4df0ab,_0x4e0308[_0x262c36(0x176)]));}function localSkillLinkCandidates(_0x145d17,_0x50ab79,_0x24c31e){const _0x17d7b6=a143_0x53e7;if(!existsSync(_0x145d17))return[];const _0x3e0d61=_0x50ab79['appCode']+'--';return readdirSync(_0x145d17,{'withFileTypes':!![]})[_0x17d7b6(0x173)](_0x1cbb5b=>_0x1cbb5b[_0x17d7b6(0x16d)]()||_0x1cbb5b[_0x17d7b6(0x182)]())[_0x17d7b6(0x173)](_0x5229bf=>_0x50ab79[_0x17d7b6(0x186)]===_0x17d7b6(0x184)||_0x5229bf[_0x17d7b6(0x176)]['startsWith'](_0x3e0d61)||_0x24c31e['has'](_0x17d7b6(0x17c)))[_0x17d7b6(0x18c)](_0x20a924=>resolve(_0x145d17,_0x20a924['name']));}function collectLocalRuntimeSkill(_0x42df6e,_0x228106,_0x329291){const _0x3e231f=a143_0x53e7,_0x25298a=resolve(_0x228106,METADATA_FILE),_0xd826a4=readMetadataIfPresent(_0x25298a);if(!_0xd826a4)return;if(_0xd826a4[_0x3e231f(0x16c)]!==_0x329291[_0x3e231f(0x16c)])return;if(!isRuntimeSkillScope(_0xd826a4[_0x3e231f(0x186)])||!_0x329291[_0x3e231f(0x180)][_0x3e231f(0x16a)](_0xd826a4[_0x3e231f(0x186)]))return;const _0x3fc067=_0xd826a4[_0x3e231f(0x189)]?.[_0x3e231f(0x185)]();if(!_0x3fc067)return;if(_0x329291[_0x3e231f(0x17a)]&&_0x3fc067!==_0x329291[_0x3e231f(0x17a)])return;const _0x343c6f=_0xd826a4[_0x3e231f(0x186)]+':'+_0x3fc067,_0x4bb65f=_0x329291['linkedPath']?[_0x329291[_0x3e231f(0x174)]]:[],_0x3114d7=_0x42df6e[_0x3e231f(0x17b)](_0x343c6f);if(_0x3114d7){_0x329291[_0x3e231f(0x18d)]==='cache'&&(_0x3114d7[_0x3e231f(0x191)]=_0x228106,_0x3114d7[_0x3e231f(0x194)]=_0x228106,_0x3114d7[_0x3e231f(0x17f)]=resolve(_0x228106,SKILL_FILE),_0x3114d7[_0x3e231f(0x166)]=_0x25298a);for(const _0x10c9db of _0x4bb65f){!_0x3114d7[_0x3e231f(0x175)][_0x3e231f(0x181)](_0x10c9db)&&_0x3114d7[_0x3e231f(0x175)]['push'](_0x10c9db);}_0x3114d7[_0x3e231f(0x175)][_0x3e231f(0x188)]();return;}_0x42df6e[_0x3e231f(0x16f)](_0x343c6f,{..._0xd826a4,'tags':Array[_0x3e231f(0x18b)](_0xd826a4[_0x3e231f(0x172)])?_0xd826a4['tags']:[],'scope':_0xd826a4['scope'],'source':_0x3e231f(0x169),'dir':_0x228106,'cacheDir':_0x329291[_0x3e231f(0x18d)]===_0x3e231f(0x178)?_0x228106:undefined,'skillMdPath':resolve(_0x228106,SKILL_FILE),'metadataPath':_0x25298a,'linkedPaths':_0x4bb65f});}function compareLocalRuntimeSkills(_0x196cba,_0x24df15){const _0xc42090=a143_0x53e7,_0x33b982={'personal':0x0,'company':0x1,'builtin':0x2};return _0x33b982[_0x196cba[_0xc42090(0x186)]]-_0x33b982[_0x24df15[_0xc42090(0x186)]]||_0x196cba[_0xc42090(0x189)][_0xc42090(0x171)](_0x24df15[_0xc42090(0x189)])||_0x196cba[_0xc42090(0x191)][_0xc42090(0x171)](_0x24df15[_0xc42090(0x191)]);}function a143_0x1d74(){const _0x505f76=['appCode','isDirectory','validation','set','accessKey','localeCompare','tags','filter','linkedPath','linkedPaths','name','1435330JwbIfU','cache','3880128gIOaVv','code','get','builtin','env','30CxAGfO','skillMdPath','scopes','includes','isSymbolicLink','10343007HopoWH','project','trim','scope','4059568mEQIAX','sort','skillCode','skillRoots','isArray','map','source','\x20!=\x20','10bOzyNr','from','dir','119904FgfWWm','596110gTAqtu','cacheDir','metadataPath','64vaKwuB','429621PnzVIE','local','has','link'];a143_0x1d74=function(){return _0x505f76;};return a143_0x1d74();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x41f3f7,_0x173e6f){const _0x233e9a=a144_0x486a,_0x56ee5b=_0x41f3f7();while(!![]){try{const _0x58bd21=-parseInt(_0x233e9a(0x197))/0x1+parseInt(_0x233e9a(0x1a5))/0x2+parseInt(_0x233e9a(0x194))/0x3+parseInt(_0x233e9a(0x1ac))/0x4*(-parseInt(_0x233e9a(0x1a2))/0x5)+parseInt(_0x233e9a(0x190))/0x6*(parseInt(_0x233e9a(0x196))/0x7)+parseInt(_0x233e9a(0x19e))/0x8*(-parseInt(_0x233e9a(0x1b4))/0x9)+parseInt(_0x233e9a(0x1b5))/0xa;if(_0x58bd21===_0x173e6f)break;else _0x56ee5b['push'](_0x56ee5b['shift']());}catch(_0x57b91e){_0x56ee5b['push'](_0x56ee5b['shift']());}}}(a144_0x167c,0x89741));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';function a144_0x486a(_0x3ba00b,_0x3cf7bf){_0x3ba00b=_0x3ba00b-0x18a;const _0x167c25=a144_0x167c();let _0x486a3c=_0x167c25[_0x3ba00b];return _0x486a3c;}import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x9bee79){const _0xc57a2c=a144_0x486a;return _0x9bee79[_0xc57a2c(0x1a0)]??Buffer['from'](_0x9bee79['content']??'',_0xc57a2c(0x18a));}export function fileText(_0x1f0a9c){const _0x479711=a144_0x486a;return fileContent(_0x1f0a9c)['toString'](_0x479711(0x18a));}export function normalizeLocalFiles(_0x3b480a){const _0x15ad34=a144_0x486a;if(!Array[_0x15ad34(0x191)](_0x3b480a)||_0x3b480a[_0x15ad34(0x19b)]===0x0)return[];const _0x16a004=new Map();for(const _0x2625f9 of _0x3b480a){if(!_0x2625f9||typeof _0x2625f9!==_0x15ad34(0x18b)||typeof _0x2625f9['path']!=='string')throw CliErrors[_0x15ad34(0x19c)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x50f1eb=normalizeSkillRelativePath(_0x2625f9[_0x15ad34(0x1ad)]);if(_0x16a004[_0x15ad34(0x199)](_0x50f1eb))throw CliErrors[_0x15ad34(0x19c)](_0x15ad34(0x1ae)+_0x50f1eb);if(_0x2625f9[_0x15ad34(0x1a0)]!==undefined&&!Buffer[_0x15ad34(0x1a6)](_0x2625f9[_0x15ad34(0x1a0)]))throw CliErrors[_0x15ad34(0x19c)](_0x15ad34(0x1a7)+_0x50f1eb);if(_0x2625f9['bytes']===undefined&&typeof _0x2625f9[_0x15ad34(0x1b2)]!==_0x15ad34(0x1b8))throw CliErrors[_0x15ad34(0x19c)](_0x15ad34(0x1ab)+_0x50f1eb);const _0x543686=fileContent(_0x2625f9);_0x16a004[_0x15ad34(0x1b6)](_0x50f1eb,{'path':_0x50f1eb,'bytes':_0x543686});}return Array['from'](_0x16a004[_0x15ad34(0x18e)]())[_0x15ad34(0x1a1)](compareSkillFiles);}export function normalizeManifestFiles(_0xa9bbb6){const _0x355688=a144_0x486a;if(!Array[_0x355688(0x191)](_0xa9bbb6)||_0xa9bbb6[_0x355688(0x19b)]===0x0)return[];const _0x259c0b=new Map();for(const _0x4fe7fc of _0xa9bbb6){if(!_0x4fe7fc||typeof _0x4fe7fc!==_0x355688(0x18b)||typeof _0x4fe7fc[_0x355688(0x1ad)]!==_0x355688(0x1b8))throw CliErrors[_0x355688(0x19c)](_0x355688(0x1b0));const _0x3061b2=normalizeSkillRelativePath(_0x4fe7fc[_0x355688(0x1ad)]);if(_0x259c0b[_0x355688(0x199)](_0x3061b2))throw CliErrors[_0x355688(0x19c)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x3061b2);if(!isSha256Hex(_0x4fe7fc[_0x355688(0x1b1)]))throw CliErrors[_0x355688(0x19c)](_0x355688(0x193)+_0x3061b2);if(!Number[_0x355688(0x195)](_0x4fe7fc[_0x355688(0x18d)])||_0x4fe7fc[_0x355688(0x18d)]<0x0)throw CliErrors[_0x355688(0x19c)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x3061b2);_0x259c0b[_0x355688(0x1b6)](_0x3061b2,{'path':_0x3061b2,'sha256':_0x4fe7fc[_0x355688(0x1b1)]['toLowerCase'](),'size':_0x4fe7fc[_0x355688(0x18d)]});}return Array['from'](_0x259c0b[_0x355688(0x18e)]())[_0x355688(0x1a1)](compareSkillFiles);}function a144_0x167c(){const _0x521477=['Duplicate\x20Skill\x20file\x20path:\x20','split','Skill\x20file\x20path\x20must\x20be\x20text.','sha256','content','name','207XqLouZ','19819330zkSGPc','set','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','string','utf8','object','test','size','values','excludedFilePaths','12MXXVUh','isArray','isDirectory','Skill\x20file\x20sha256\x20is\x20invalid:\x20','1600788TsCaHU','isSafeInteger','814114GcTfIC','881962HLNlDP','compare','has','from','length','validation','isFile','390088lqqLlZ','isSymbolicLink','bytes','sort','1892810hXGzsZ','Unsafe\x20Skill\x20file\x20path:\x20','localeCompare','1150930sjSzux','isBuffer','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','add','replace','startsWith','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','8ARpmep','path'];a144_0x167c=function(){return _0x521477;};return a144_0x167c();}export function scanSkillDirectory(_0x25f63a,_0x11de37={}){const _0x4bea2a=a144_0x486a,_0x28fbb5=realpathSync(_0x25f63a),_0x15dd71=canonicalExcludedFilePaths(_0x11de37[_0x4bea2a(0x18f)]),_0x52afc5=[];function _0x53fc5c(_0x5e8232){const _0x32d5d6=_0x4bea2a,_0x398e4d=readdirSync(_0x5e8232,{'withFileTypes':!![]})[_0x32d5d6(0x1a1)]((_0xa31336,_0x4aff97)=>_0xa31336[_0x32d5d6(0x1b3)][_0x32d5d6(0x1a4)](_0x4aff97[_0x32d5d6(0x1b3)]));for(const _0x322aaa of _0x398e4d){if(_0x322aaa[_0x32d5d6(0x192)]()&&IGNORED_DIR_NAMES['has'](_0x322aaa[_0x32d5d6(0x1b3)]))continue;if(IGNORED_FILE_NAMES[_0x32d5d6(0x199)](_0x322aaa[_0x32d5d6(0x1b3)]))continue;const _0x4b3de2=resolve(_0x5e8232,_0x322aaa[_0x32d5d6(0x1b3)]);if(isExcludedFilePath(_0x4b3de2,_0x15dd71))continue;if(_0x322aaa[_0x32d5d6(0x19f)]())throw CliErrors[_0x32d5d6(0x19c)](_0x32d5d6(0x1b7)+_0x4b3de2);const _0x11f6fd=toPosixPath(relative(_0x28fbb5,_0x4b3de2));if(_0x322aaa[_0x32d5d6(0x192)]()){_0x53fc5c(_0x4b3de2);continue;}if(!_0x322aaa[_0x32d5d6(0x19d)]())continue;validateSkillRelativePath(_0x11f6fd);const _0x9e7366=readFileSync(_0x4b3de2);_0x52afc5['push']({'path':_0x11f6fd,'bytes':_0x9e7366});}}return _0x53fc5c(_0x28fbb5),normalizeLocalFiles(_0x52afc5);}function canonicalExcludedFilePaths(_0x591db7){const _0x5a7af7=a144_0x486a,_0x581323=new Set();for(const _0x3a47ff of _0x591db7??[]){const _0x129ea4=resolve(_0x3a47ff);_0x581323[_0x5a7af7(0x1a8)](_0x129ea4);try{_0x581323[_0x5a7af7(0x1a8)](realpathSync(_0x129ea4));}catch{}}return _0x581323;}function isExcludedFilePath(_0x160653,_0x56950c){const _0x13077a=a144_0x486a;if(_0x56950c[_0x13077a(0x199)](_0x160653))return!![];if(_0x56950c[_0x13077a(0x18d)]===0x0)return![];try{return _0x56950c[_0x13077a(0x199)](realpathSync(_0x160653));}catch{return![];}}export function compareSkillFiles(_0x4bd500,_0x41a1d8){const _0x39330a=a144_0x486a;if(_0x4bd500[_0x39330a(0x1ad)]===SKILL_FILE)return _0x41a1d8['path']===SKILL_FILE?0x0:-0x1;if(_0x41a1d8['path']===SKILL_FILE)return 0x1;return Buffer[_0x39330a(0x198)](Buffer['from'](_0x4bd500[_0x39330a(0x1ad)],'utf8'),Buffer[_0x39330a(0x19a)](_0x41a1d8[_0x39330a(0x1ad)],_0x39330a(0x18a)));}export function normalizeSkillRelativePath(_0x2b13a6){const _0x4c1a86=toPosixPath(_0x2b13a6['trim']());return validateSkillRelativePath(_0x4c1a86),_0x4c1a86;}export function validateSkillRelativePath(_0x5e3522){const _0x45203c=a144_0x486a;if(!_0x5e3522||_0x5e3522[_0x45203c(0x1aa)]('/')||_0x5e3522['includes']('//'))throw CliErrors[_0x45203c(0x19c)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x5e3522);for(const _0x22fee0 of _0x5e3522[_0x45203c(0x1af)]('/')){if(!_0x22fee0||_0x22fee0==='.'||_0x22fee0==='..')throw CliErrors[_0x45203c(0x19c)](_0x45203c(0x1a3)+_0x5e3522);}}export function toPosixPath(_0x23cfb6){const _0x431b90=a144_0x486a;return _0x23cfb6[_0x431b90(0x1a9)](/\\/g,'/');}export function isSha256Hex(_0x3eafa1){const _0x6df33e=a144_0x486a;return typeof _0x3eafa1==='string'&&/^[a-fA-F0-9]{64}$/[_0x6df33e(0x18c)](_0x3eafa1);}
|