@lovrabet/lovrabet-cli 2.2.7 → 2.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.d.ts +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 +12 -0
- package/lib/commands/config/init.js +1 -0
- package/lib/commands/config/shared.d.ts +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 +11 -0
- package/lib/config/domain-config.js +1 -0
- package/lib/config/schema.d.ts +7 -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.d.ts +4 -0
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +10 -3
- 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.d.ts +52 -14
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.d.ts +15 -0
- package/lib/constant/region.js +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.d.ts +2 -0
- package/lib/constant/url.js +1 -1
- package/lib/context.d.ts +2 -6
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.d.ts +2 -0
- 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.d.ts +3 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.d.ts +15 -0
- package/lib/utils/access-key-redaction.js +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.d.ts +12 -0
- package/lib/utils/cli-version-check.js +1 -0
- package/lib/utils/cli-version-policy.d.ts +12 -0
- package/lib/utils/cli-version-policy.js +1 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.d.ts +2 -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 +3 -1
- package/skills/lovrabet/SKILL.md +11 -12
- package/skills/lovrabet/guides/troubleshooting.md +12 -8
- package/skills/lovrabet/references/lovrabet-app.md +1 -1
- package/skills/lovrabet/references/lovrabet-auth.md +7 -25
- package/skills/lovrabet/references/lovrabet-config-commands.md +42 -5
- package/skills/lovrabet/references/lovrabet-config.md +25 -5
- package/skills/lovrabet.manifest.json +3 -3
package/lib/runtime/event.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a127_0x3a21(_0x9ba658,_0x54c2b2){_0x9ba658=_0x9ba658-0x165;const _0x2ade17=a127_0x2ade();let _0x3a2121=_0x2ade17[_0x9ba658];return _0x3a2121;}(function(_0x39fd52,_0x4061ee){const _0x4ed4f6=a127_0x3a21,_0x1736d4=_0x39fd52();while(!![]){try{const _0x3d76a1=parseInt(_0x4ed4f6(0x172))/0x1+parseInt(_0x4ed4f6(0x165))/0x2+parseInt(_0x4ed4f6(0x173))/0x3+-parseInt(_0x4ed4f6(0x174))/0x4*(parseInt(_0x4ed4f6(0x16a))/0x5)+-parseInt(_0x4ed4f6(0x171))/0x6+parseInt(_0x4ed4f6(0x168))/0x7*(parseInt(_0x4ed4f6(0x16b))/0x8)+-parseInt(_0x4ed4f6(0x16e))/0x9;if(_0x3d76a1===_0x4061ee)break;else _0x1736d4['push'](_0x1736d4['shift']());}catch(_0x38ccd3){_0x1736d4['push'](_0x1736d4['shift']());}}}(a127_0x2ade,0x19a15));export function canonicalLovrabetOperation(_0x386cc5){const _0x51c4d9=a127_0x3a21;return[_0x386cc5['service'],..._0x386cc5[_0x51c4d9(0x16c)][_0x51c4d9(0x166)]()[_0x51c4d9(0x169)](/\s+/)]['filter'](Boolean)[_0x51c4d9(0x170)]('.');}function a127_0x2ade(){const _0x2bce3d=['170420JzwthU','trim','risk','4200lpWUHK','split','252275OTuVJp','320lDiHxw','command','write','37764UXjNjx','lovrabet.write.completed','join','131328VSdvyL','45958rdKtQv','79056vfbmaY','4Hcsvvg','writeEventSubject','high-risk-write'];a127_0x2ade=function(){return _0x2bce3d;};return a127_0x2ade();}export function createLovrabetWriteMetadata(_0x5ac502,_0x2d6675,_0x20cf5f,_0x12fa64){const _0x51b46f=a127_0x3a21;if(_0x12fa64||_0x20cf5f['ok']!==!![]||_0x5ac502['risk']!==_0x51b46f(0x16d)&&_0x5ac502[_0x51b46f(0x167)]!==_0x51b46f(0x176))return undefined;const _0x1b5611=_0x5ac502[_0x51b46f(0x175)]?.(_0x20cf5f),_0x3f4617={'type':_0x51b46f(0x16f),'operation':_0x2d6675,'risk':_0x5ac502[_0x51b46f(0x167)],..._0x1b5611?{'subject':_0x1b5611}:{}};return{'lovrabet':{'schemaVersion':0x1,'event':_0x3f4617}};}
|
package/lib/runtime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x25567f,_0x203715){const _0x4295e9=a128_0x13d5,_0x22d7ff=_0x25567f();while(!![]){try{const _0x3835bb=-parseInt(_0x4295e9(0x191))/0x1*(parseInt(_0x4295e9(0x1a0))/0x2)+-parseInt(_0x4295e9(0x1a2))/0x3+-parseInt(_0x4295e9(0x192))/0x4+parseInt(_0x4295e9(0x199))/0x5*(-parseInt(_0x4295e9(0x1a1))/0x6)+-parseInt(_0x4295e9(0x190))/0x7+parseInt(_0x4295e9(0x18c))/0x8+-parseInt(_0x4295e9(0x19d))/0x9*(-parseInt(_0x4295e9(0x180))/0xa);if(_0x3835bb===_0x203715)break;else _0x22d7ff['push'](_0x22d7ff['shift']());}catch(_0x10ac7f){_0x22d7ff['push'](_0x22d7ff['shift']());}}}(a128_0x3e48,0xe68f6));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:_0x3a5052,command:_0x4f3802,risk:_0x1a1d67,dryRun:_0x3d2ba6}){const _0x273e22=a128_0x13d5;return JSON[_0x273e22(0x195)]({'ok':_0x3a5052['ok'],'command':_0x4f3802,'risk':_0x1a1d67,..._0x3d2ba6?{'dryRun':!![]}:{},..._0x3a5052[_0x273e22(0x18a)]!==undefined?{'data':_0x3a5052['data']}:{},..._0x3a5052[_0x273e22(0x19e)]?{'message':_0x3a5052['message']}:{}});}};export async function invokeLovrabet(_0xe0469d,_0x6a89f1){const _0x30ca8d=a128_0x13d5;throwIfAborted(_0x6a89f1[_0x30ca8d(0x184)]);const _0x57dcbe=await resolveLovrabetInvocation(_0xe0469d),_0x3f6872=canonicalLovrabetOperation(_0x57dcbe['definition']);return await confirmWriteBeforeQueue(_0x57dcbe[_0x30ca8d(0x182)],_0x57dcbe[_0x30ca8d(0x187)],_0x3f6872,_0x6a89f1),runSerialized(async()=>{const _0x2aa5c1=_0x30ca8d;throwIfAborted(_0x6a89f1[_0x2aa5c1(0x184)]);const _0x2e1df5={},_0x4b4f63=buildConfigFromFlags(_0x57dcbe[_0x2aa5c1(0x187)]);await initGlobalEnvironment(_0x4b4f63);const _0x4a3a8c=createPipelineEnv(_0x4b4f63,{..._0x57dcbe[_0x2aa5c1(0x187)],'yes':_0x57dcbe[_0x2aa5c1(0x182)][_0x2aa5c1(0x189)]==='high-risk-write'?!![]:_0x57dcbe[_0x2aa5c1(0x187)][_0x2aa5c1(0x194)],'nonInteractive':!![]});_0x4a3a8c[_0x2aa5c1(0x196)]=_0x57dcbe[_0x2aa5c1(0x196)],_0x4a3a8c[_0x2aa5c1(0x183)]=!![],_0x4a3a8c[_0x2aa5c1(0x188)]=_0x2aa5c1(0x186);const _0xda5f4=withAbortSignal(_0x57dcbe['definition'],_0x6a89f1['signal']),_0x46f9bf=createLovrabetRunnerAdapter({'formatOutput'(_0x181164,_0x4c406a){const _0x3ef6a5=_0x2aa5c1;_0x2e1df5[_0x3ef6a5(0x18b)]=_0x181164,_0x2e1df5['command']=_0x4c406a[_0x3ef6a5(0x19c)],_0x2e1df5[_0x3ef6a5(0x189)]=_0x4c406a['risk'],_0x2e1df5['format']=_0x4c406a[_0x3ef6a5(0x19a)],_0x2e1df5[_0x3ef6a5(0x181)]=_0x4c406a[_0x3ef6a5(0x181)]===!![];},async 'confirmHighRisk'(){const _0x3d7875=_0x2aa5c1;throw new Error(_0x3d7875(0x197));}});try{await runCommand(_0xda5f4,_0x4a3a8c,_0x46f9bf);if(!_0x2e1df5[_0x2aa5c1(0x18b)]||!_0x2e1df5['command']||!_0x2e1df5['risk']||!_0x2e1df5[_0x2aa5c1(0x19a)])throw new Error(_0x2aa5c1(0x193));const _0x144b71=_0x6a89f1[_0x2aa5c1(0x19f)]??defaultPresentation,_0x835989=_0x2e1df5['dryRun']===!![],_0x341f3c={'result':_0x2e1df5['result'],'command':_0x2e1df5['command'],'operation':_0x3f6872,'risk':_0x2e1df5[_0x2aa5c1(0x189)],'format':_0x2e1df5['format'],'dryRun':_0x835989},_0x44eddd=createLovrabetWriteMetadata(_0x57dcbe[_0x2aa5c1(0x182)],_0x3f6872,_0x2e1df5['result'],_0x835989);let _0x1e6d8d;try{_0x1e6d8d=await _0x144b71[_0x2aa5c1(0x18d)](_0x341f3c);}catch(_0x12dc9c){if(!_0x44eddd||_0x144b71===defaultPresentation)throw _0x12dc9c;_0x1e6d8d=await defaultPresentation[_0x2aa5c1(0x18d)](_0x341f3c);}return{'operation':_0x3f6872,'risk':_0x2e1df5[_0x2aa5c1(0x189)],'mode':_0x835989?_0x2aa5c1(0x198):_0x2aa5c1(0x1a4),'result':_0x2e1df5[_0x2aa5c1(0x18b)],'output':_0x1e6d8d,..._0x44eddd?{'metadata':_0x44eddd}:{}};}finally{await finalizeLovrabetRuntimeState();}});}async function confirmWriteBeforeQueue(_0x5f4c56,_0x55df9e,_0x103340,_0x48a42f){const _0x321651=a128_0x13d5;if(_0x55df9e[_0x321651(0x181)]===!![]||_0x5f4c56['risk']!==_0x321651(0x185)&&_0x5f4c56[_0x321651(0x189)]!==_0x321651(0x186))return;await _0x48a42f[_0x321651(0x18e)]['confirm'](buildLovrabetConfirmationRequest(_0x5f4c56,_0x103340,_0x48a42f['signal']));}function a128_0x13d5(_0x16d5c7,_0x39ccc5){_0x16d5c7=_0x16d5c7-0x180;const _0x3e481c=a128_0x3e48();let _0x13d589=_0x3e481c[_0x16d5c7];return _0x13d589;}function withAbortSignal(_0x2caa89,_0x545f6e){return{..._0x2caa89,async 'execute'(_0x2d8276){return throwIfAborted(_0x545f6e),_0x2caa89['execute'](_0x2d8276);}};}function throwIfAborted(_0x2f0a83){const _0x40f123=a128_0x13d5;if(_0x2f0a83?.[_0x40f123(0x1a3)])throw _0x2f0a83['reason']instanceof Error?_0x2f0a83[_0x40f123(0x19b)]:new DOMException('Lovrabet\x20invocation\x20aborted.',_0x40f123(0x18f));}function a128_0x3e48(){const _0x19a014=['dry-run','2346620WhyjcV','format','reason','command','25409493MHpAsZ','message','presentation','2738XMecWP','12cdoYhZ','4270554zEJekH','aborted','execute','20vDCWTd','dryRun','definition','isNonInteractive','signal','write','high-risk-write','rawFlags','riskLevel','risk','data','result','6593640JsaQBb','present','confirmation','AbortError','11397190JevOzX','659NimXRk','2535512KFLlyv','Lovrabet\x20invocation\x20completed\x20without\x20a\x20captured\x20command\x20result.','yes','stringify','args','Embedded\x20Lovrabet\x20confirmation\x20must\x20run\x20inside\x20execute.'];a128_0x3e48=function(){return _0x19a014;};return a128_0x3e48();}
|
package/lib/runtime/queue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129_0x5249bf=a129_0x52d9;function a129_0x50cb(){const _0x58f60b=['566460zBpWRB','688012jPGooZ','88284XhTwhY','9ETkGma','10lWymNA','1471673uLDScm','782408BoGzJd','12413736IPEQpL','resolve','catch','649894viKJRN'];a129_0x50cb=function(){return _0x58f60b;};return a129_0x50cb();}(function(_0x41fbe5,_0x5ed70d){const _0x424176=a129_0x52d9,_0x348115=_0x41fbe5();while(!![]){try{const _0x37bf5a=-parseInt(_0x424176(0x120))/0x1+-parseInt(_0x424176(0x124))/0x2+-parseInt(_0x424176(0x125))/0x3+parseInt(_0x424176(0x126))/0x4*(parseInt(_0x424176(0x11e))/0x5)+parseInt(_0x424176(0x11c))/0x6+-parseInt(_0x424176(0x11f))/0x7+-parseInt(_0x424176(0x121))/0x8*(-parseInt(_0x424176(0x11d))/0x9);if(_0x37bf5a===_0x5ed70d)break;else _0x348115['push'](_0x348115['shift']());}catch(_0x968dea){_0x348115['push'](_0x348115['shift']());}}}(a129_0x50cb,0x62a37));let tail=Promise[a129_0x5249bf(0x122)]();function a129_0x52d9(_0x2f22ba,_0x137a12){_0x2f22ba=_0x2f22ba-0x11c;const _0x50cb19=a129_0x50cb();let _0x52d9ad=_0x50cb19[_0x2f22ba];return _0x52d9ad;}export async function runSerialized(_0xf15c77){const _0xb6790a=a129_0x5249bf,_0x2f0ed9=tail;let _0xedcf23;tail=new Promise(_0x4324cb=>{_0xedcf23=_0x4324cb;}),await _0x2f0ed9[_0xb6790a(0x123)](()=>undefined);try{return await _0xf15c77();}finally{_0xedcf23();}}
|
package/lib/runtime/resolve.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b267b,_0x48bd61){const _0x148289=a130_0x4d68,_0x26c5a9=_0x2b267b();while(!![]){try{const _0x47adc9=parseInt(_0x148289(0x112))/0x1*(parseInt(_0x148289(0x101))/0x2)+-parseInt(_0x148289(0xff))/0x3+parseInt(_0x148289(0x109))/0x4+-parseInt(_0x148289(0x106))/0x5*(-parseInt(_0x148289(0x10b))/0x6)+-parseInt(_0x148289(0xfc))/0x7+-parseInt(_0x148289(0x100))/0x8*(-parseInt(_0x148289(0x10c))/0x9)+-parseInt(_0x148289(0x102))/0xa*(parseInt(_0x148289(0x110))/0xb);if(_0x47adc9===_0x48bd61)break;else _0x26c5a9['push'](_0x26c5a9['shift']());}catch(_0x3ebec5){_0x26c5a9['push'](_0x26c5a9['shift']());}}}(a130_0x3880,0x3a5a1));function a130_0x3880(){const _0x4d1464=['args','1575460xjCUnJ','definition','15702QiRFVU','3663OrsMVu','unknownCommand','hint','slice','55cGnsYx','input','70215sRHwzz','Lovrabet\x20argv\x20must\x20include\x20a\x20service\x20and\x20command.','defaultCommand','flags','2525166NkpThn','assign','flatMap','537759ZDSEOE','6872eOotli','2nLyRhR','388660OAZryF','join','Lovrabet\x20argv\x20must\x20include\x20a\x20command\x20for\x20service\x20\x22','validation','305tOcTCO','../commands/registry.js'];a130_0x3880=function(){return _0x4d1464;};return a130_0x3880();}import a130_0x1833ac from'meow';import{findDefinition,getServiceEntry,isKnownService,resolveRemovedCommand}from'../commands/registry.js';import{resolveDynamicServiceCommand}from'../commands/service/dynamic.js';import{buildMeowFlags}from'../constant/cli.js';import{CliErrors}from'../errors.js';export async function resolveLovrabetInvocation(_0x42fb85){const _0x267ec1=a130_0x4d68,_0x44dd1d=a130_0x1833ac('',{'importMeta':import.meta,'argv':_0x42fb85,'flags':buildMeowFlags(),'autoHelp':![],'autoVersion':![]}),_0x15bcdb=[..._0x44dd1d[_0x267ec1(0x111)]],_0x52607=_0x44dd1d['flags'];await correctFlags(_0x52607);const _0x3d654e=_0x15bcdb[0x0];if(!_0x3d654e)throw CliErrors[_0x267ec1(0x105)](_0x267ec1(0x113));const _0x3a76c5=resolveRemovedCommand(_0x3d654e,_0x15bcdb[0x1]);if(_0x3a76c5)throw CliErrors[_0x267ec1(0x105)](_0x3a76c5['message'],_0x3a76c5[_0x267ec1(0x10e)]);if(!isKnownService(_0x3d654e)){const _0x4c4f93=resolveDynamicServiceCommand(_0x15bcdb,_0x52607);if(!_0x4c4f93)throw CliErrors[_0x267ec1(0x10d)](_0x15bcdb[_0x267ec1(0x103)]('\x20'));return Object[_0x267ec1(0xfd)](_0x52607,_0x4c4f93['flags']),{'definition':_0x4c4f93[_0x267ec1(0x10a)],'rawFlags':_0x52607,'args':_0x4c4f93[_0x267ec1(0x108)]};}const _0x1aaba7=getServiceEntry(_0x3d654e),_0x58ffbd=_0x15bcdb[0x1]||_0x1aaba7[_0x267ec1(0x114)];if(!_0x58ffbd)throw CliErrors[_0x267ec1(0x105)](_0x267ec1(0x104)+_0x3d654e+'\x22.');const _0x1064f7=findDefinition(_0x3d654e,_0x58ffbd);if(!_0x1064f7)throw CliErrors[_0x267ec1(0x10d)](_0x3d654e+'\x20'+_0x58ffbd);return{'definition':_0x1064f7,'rawFlags':_0x52607,'args':_0x15bcdb[_0x267ec1(0x10f)](0x2)};}function a130_0x4d68(_0x15a800,_0x188569){_0x15a800=_0x15a800-0xfb;const _0x38800c=a130_0x3880();let _0x4d68b8=_0x38800c[_0x15a800];return _0x4d68b8;}async function correctFlags(_0x24fef7){const _0x4431a6=a130_0x4d68;try{const {correctFlags:_0x2f14dd}=await import('../framework/preparse.js'),{getAllDefinitions:_0x1a415e}=await import(_0x4431a6(0x107)),_0x5294e0=_0x1a415e()[_0x4431a6(0xfe)](_0x13da62=>_0x13da62[_0x4431a6(0xfb)]??[]),_0x326ef1=_0x2f14dd(_0x24fef7,_0x5294e0);Object['assign'](_0x24fef7,_0x326ef1[_0x4431a6(0xfb)]);}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x3c6e06=a132_0x28d2;(function(_0x4d94d5,_0x2d6ba5){const _0xb92a6c=a132_0x28d2,_0x497403=_0x4d94d5();while(!![]){try{const _0x269c63=-parseInt(_0xb92a6c(0x90))/0x1+parseInt(_0xb92a6c(0xa0))/0x2+parseInt(_0xb92a6c(0x7f))/0x3*(-parseInt(_0xb92a6c(0x98))/0x4)+-parseInt(_0xb92a6c(0x9a))/0x5+parseInt(_0xb92a6c(0xa9))/0x6*(-parseInt(_0xb92a6c(0xac))/0x7)+-parseInt(_0xb92a6c(0x9e))/0x8+parseInt(_0xb92a6c(0xb0))/0x9;if(_0x269c63===_0x2d6ba5)break;else _0x497403['push'](_0x497403['shift']());}catch(_0x1420f4){_0x497403['push'](_0x497403['shift']());}}}(a132_0x3c46,0xd3df3));import{createHash}from'node:crypto';function a132_0x28d2(_0x2a6c17,_0x10809d){_0x2a6c17=_0x2a6c17-0x75;const _0x3c4671=a132_0x3c46();let _0x28d21a=_0x3c4671[_0x2a6c17];return _0x28d21a;}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=a132_0x3c6e06(0x95),SKILL_NAME=a132_0x3c6e06(0xa2);function frontmatterValue(_0x37ed56,_0x343581){const _0x112d3a=a132_0x3c6e06;return _0x37ed56[_0x112d3a(0x88)](new RegExp('^'+_0x343581+_0x112d3a(0xaf),'m'))?.[0x1]?.['trim']()??'';}function a132_0x3c46(){const _0x4fcfc4=['digest','join','packageRoot','match','message','missing','state','includes','lovrabet.manifest.json','INSTALL_FAILED','root','357785LMcMON','home','installedPath','isSymbolicLink','skillVersion','lovrabet\x20cli-skill\x20install','manifest','startsWith','20396wiJjXm','name','2265325VURueg','isDirectory','sha256','update','830368qKsSDs','files','1339518drsRgF','split','lovrabet','reason','isFile','length','unknown','present','content_mismatch','4434rHUCXc','sort','VERIFY_FAILED','15953tiMSJS','parse','Unsupported\x20Skill\x20entry:\x20',':\x5cs*(.+)$','29118681IITWsD','unverifiable','packageVersion','utf8','Symbolic\x20link\x20is\x20not\x20allowed:\x20','current','version','Installed\x20Skill\x20state\x20is\x20','stdio','flatMap','path','258uNhpaQ','absent','pipe','version_mismatch','SOURCE_INVALID','SKILL.md'];a132_0x3c46=function(){return _0x4fcfc4;};return a132_0x3c46();}function listFiles(_0x58e1af,_0x3c1502=_0x58e1af){const _0x1813ae=a132_0x3c6e06;return readdirSync(_0x3c1502,{'withFileTypes':!![]})[_0x1813ae(0x7d)](_0x3c3c7c=>{const _0x10c185=_0x1813ae,_0x1093a4=join(_0x3c1502,_0x3c3c7c['name']),_0x8bc285=lstatSync(_0x1093a4);if(_0x8bc285[_0x10c185(0x93)]())throw new Error(_0x10c185(0x78)+_0x1093a4);if(_0x8bc285[_0x10c185(0x9b)]())return listFiles(_0x58e1af,_0x1093a4);if(!_0x8bc285[_0x10c185(0xa4)]())throw new Error(_0x10c185(0xae)+_0x1093a4);return[relative(_0x58e1af,_0x1093a4)[_0x10c185(0xa1)](sep)[_0x10c185(0x86)]('/')];})[_0x1813ae(0xaa)]((_0x541b77,_0x29ae4d)=>_0x541b77<_0x29ae4d?-0x1:_0x541b77>_0x29ae4d?0x1:0x0);}function digestFiles(_0x3ad41d,_0x23a590){const _0x1867ca=a132_0x3c6e06,_0x67cca5=createHash(_0x1867ca(0x9c));for(const _0x12c286 of _0x23a590){if(_0x12c286[_0x1867ca(0x97)]('/')||_0x12c286[_0x1867ca(0xa1)]('/')[_0x1867ca(0x8c)]('..')||_0x12c286['includes']('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x12c286);_0x67cca5['update'](_0x12c286),_0x67cca5[_0x1867ca(0x9d)]('\x00'),_0x67cca5[_0x1867ca(0x9d)](readFileSync(join(_0x3ad41d,..._0x12c286[_0x1867ca(0xa1)]('/')))),_0x67cca5[_0x1867ca(0x9d)]('\x00');}return _0x67cca5[_0x1867ca(0x85)]('hex');}function sameFiles(_0x2e8445,_0x5dcde3){const _0x63b5f=a132_0x3c6e06;return _0x2e8445[_0x63b5f(0xa5)]===_0x5dcde3[_0x63b5f(0xa5)]&&_0x2e8445['every']((_0xd7c6b8,_0x2905fc)=>_0xd7c6b8===_0x5dcde3[_0x2905fc]);}function readSource(_0x55e985){const _0x53d087=a132_0x3c6e06,_0xb5805f=JSON[_0x53d087(0xad)](readFileSync(join(_0x55e985,'package.json'),_0x53d087(0x77))),_0x1afb39=JSON[_0x53d087(0xad)](readFileSync(join(_0x55e985,'skills',_0x53d087(0x8d)),_0x53d087(0x77))),_0x3b90a9=join(_0x55e985,'skills',SKILL_NAME),_0x43e780=frontmatterValue(readFileSync(join(_0x3b90a9,_0x53d087(0x84)),_0x53d087(0x77)),'version'),_0x3af159=listFiles(_0x3b90a9);if(_0x1afb39['schemaVersion']!==0x1||_0x1afb39[_0x53d087(0x99)]!==SKILL_NAME||!_0xb5805f[_0x53d087(0x7a)]||_0x1afb39[_0x53d087(0x76)]!==_0xb5805f[_0x53d087(0x7a)]||_0x1afb39['skillVersion']!==_0xb5805f['version']||_0x43e780!==_0xb5805f[_0x53d087(0x7a)]||!sameFiles(_0x3af159,_0x1afb39['files'])||digestFiles(_0x3b90a9,_0x3af159)!==_0x1afb39[_0x53d087(0x85)])throw new Error('Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest');return{'packageVersion':_0xb5805f['version'],'skillVersion':_0x43e780,'root':_0x3b90a9,'manifest':_0x1afb39};}function installedSkillPath(_0x257bfc){const _0x58646=a132_0x3c6e06,_0x5c22bd=resolveInstalledSkill(SKILL_NAME,{'home':_0x257bfc});if(_0x5c22bd['state']===_0x58646(0xa7))return{'state':_0x58646(0xa7),'path':dirname(_0x5c22bd[_0x58646(0x7e)])};if(_0x5c22bd[_0x58646(0x8b)]===_0x58646(0x80))return{'state':_0x58646(0x8a)};return{'state':_0x58646(0x75),'reason':_0x5c22bd[_0x58646(0xa3)]};}export function inspectInstalledBuiltinSkillVersion(_0x183bb8,_0x527919={}){const _0x181180=a132_0x3c6e06,_0x1f8241=installedSkillPath(_0x527919[_0x181180(0x91)]??homedir());if(_0x1f8241[_0x181180(0x8b)]===_0x181180(0x8a))return{'state':'missing','expectedVersion':_0x183bb8,'repairCommand':REPAIR_COMMAND};if(_0x1f8241[_0x181180(0x8b)]===_0x181180(0x75))return{'state':_0x181180(0x75),'expectedVersion':_0x183bb8,'reason':_0x1f8241[_0x181180(0xa3)],'repairCommand':REPAIR_COMMAND};try{const _0xdae02d=frontmatterValue(readFileSync(join(_0x1f8241[_0x181180(0x7e)],_0x181180(0x84)),'utf8'),_0x181180(0x7a));return{'state':_0xdae02d===_0x183bb8?_0x181180(0x79):_0x181180(0x82),'expectedVersion':_0x183bb8,'skillVersion':_0xdae02d,'installedPath':_0x1f8241['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x5b861e){return{'state':_0x181180(0x75),'expectedVersion':_0x183bb8,'installedPath':_0x1f8241[_0x181180(0x7e)],'reason':_0x5b861e instanceof Error?_0x5b861e[_0x181180(0x89)]:String(_0x5b861e),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x1e3887={}){const _0x4d57c6=a132_0x3c6e06,_0x4928bc=_0x1e3887['packageRoot']??DEFAULT_PACKAGE_ROOT;let _0x2f958b;try{_0x2f958b=readSource(_0x4928bc);}catch(_0x4fb3dd){return{'state':_0x4d57c6(0x75),'packageVersion':_0x4d57c6(0xa6),'reason':_0x4fb3dd instanceof Error?_0x4fb3dd[_0x4d57c6(0x89)]:String(_0x4fb3dd),'repairCommand':REPAIR_COMMAND};}const _0x5a7aa0=installedSkillPath(_0x1e3887[_0x4d57c6(0x91)]??homedir());if(_0x5a7aa0['state']===_0x4d57c6(0x8a))return{'state':_0x4d57c6(0x8a),'packageVersion':_0x2f958b[_0x4d57c6(0x76)],'repairCommand':REPAIR_COMMAND};if(_0x5a7aa0[_0x4d57c6(0x8b)]===_0x4d57c6(0x75))return{'state':_0x4d57c6(0x75),'packageVersion':_0x2f958b[_0x4d57c6(0x76)],'reason':_0x5a7aa0[_0x4d57c6(0xa3)],'repairCommand':REPAIR_COMMAND};try{const _0x4262a2=frontmatterValue(readFileSync(join(_0x5a7aa0[_0x4d57c6(0x7e)],_0x4d57c6(0x84)),'utf8'),_0x4d57c6(0x7a));if(_0x4262a2!==_0x2f958b[_0x4d57c6(0x94)])return{'state':_0x4d57c6(0x82),'packageVersion':_0x2f958b[_0x4d57c6(0x76)],'skillVersion':_0x4262a2,'installedPath':_0x5a7aa0[_0x4d57c6(0x7e)],'repairCommand':REPAIR_COMMAND};const _0x1242dd=listFiles(_0x5a7aa0[_0x4d57c6(0x7e)]),_0x350fec=digestFiles(_0x5a7aa0[_0x4d57c6(0x7e)],_0x1242dd);return{'state':sameFiles(_0x1242dd,_0x2f958b['manifest'][_0x4d57c6(0x9f)])&&_0x350fec===_0x2f958b[_0x4d57c6(0x96)][_0x4d57c6(0x85)]?_0x4d57c6(0x79):_0x4d57c6(0xa8),'packageVersion':_0x2f958b[_0x4d57c6(0x76)],'skillVersion':_0x4262a2,'installedPath':_0x5a7aa0['path'],'digest':_0x350fec,'repairCommand':REPAIR_COMMAND};}catch(_0x1b2fe7){return{'state':_0x4d57c6(0x75),'packageVersion':_0x2f958b['packageVersion'],'installedPath':_0x5a7aa0[_0x4d57c6(0x7e)],'reason':_0x1b2fe7 instanceof Error?_0x1b2fe7[_0x4d57c6(0x89)]:String(_0x1b2fe7),'repairCommand':REPAIR_COMMAND};}}function failure(_0x5c7d5c,_0x39550d,_0x5563d2,_0x3b16f5){const _0x396fa4=a132_0x3c6e06;return{'ok':![],'code':_0x5c7d5c,'packageVersion':_0x39550d[_0x396fa4(0x76)],'skillVersion':_0x39550d[_0x396fa4(0x94)],'installedPath':_0x3b16f5,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x5563d2 instanceof Error?_0x5563d2[_0x396fa4(0x89)]:String(_0x5563d2)};}export function installBuiltinSkill(_0x3d1f87={}){const _0x25744d=a132_0x3c6e06,_0x366444=_0x3d1f87[_0x25744d(0x87)]??DEFAULT_PACKAGE_ROOT,_0x56b591=_0x3d1f87[_0x25744d(0x91)]??homedir();let _0xc9fbc9;try{_0xc9fbc9=readSource(_0x366444);}catch(_0x5f3481){return failure(_0x25744d(0x83),{'packageVersion':'unknown','skillVersion':_0x25744d(0xa6)},_0x5f3481);}const _0xe0f604=inspectBuiltinSkill({'packageRoot':_0x366444,'home':_0x56b591}),_0x157d39=runNpxSkillsAddGlobal(_0x366444,_0xc9fbc9[_0x25744d(0x8f)],{'stdio':_0x3d1f87[_0x25744d(0x7c)]??_0x25744d(0x81),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x56b591}});if(_0x157d39['skipped'])return{'ok':!![],'packageVersion':_0xc9fbc9['packageVersion'],'skillVersion':_0xc9fbc9['skillVersion'],'installedPath':_0xe0f604[_0x25744d(0x92)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x157d39['ok'])return failure(_0x25744d(0x8e),_0xc9fbc9,_0x157d39['error']??'skills@latest\x20exited\x20'+_0x157d39['status']);const _0x5c68d8=inspectBuiltinSkill({'packageRoot':_0x366444,'home':_0x56b591});if(_0x5c68d8[_0x25744d(0x8b)]!==_0x25744d(0x79))return failure(_0x25744d(0xab),_0xc9fbc9,_0x5c68d8[_0x25744d(0xa3)]??_0x25744d(0x7b)+_0x5c68d8[_0x25744d(0x8b)],_0x5c68d8['installedPath']);return{'ok':!![],'packageVersion':_0xc9fbc9[_0x25744d(0x76)],'skillVersion':_0xc9fbc9[_0x25744d(0x94)],'installedPath':_0x5c68d8[_0x25744d(0x92)],'changed':_0xe0f604[_0x25744d(0x8b)]!=='current','repairCommand':REPAIR_COMMAND};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x648311=a133_0x4072;(function(_0xecf86e,_0x2826d4){const _0x1a5486=a133_0x4072,_0x1bb339=_0xecf86e();while(!![]){try{const _0x82bba6=parseInt(_0x1a5486(0x156))/0x1+-parseInt(_0x1a5486(0x13b))/0x2+parseInt(_0x1a5486(0x150))/0x3*(parseInt(_0x1a5486(0x151))/0x4)+parseInt(_0x1a5486(0x12b))/0x5*(parseInt(_0x1a5486(0x132))/0x6)+parseInt(_0x1a5486(0x140))/0x7*(-parseInt(_0x1a5486(0x13e))/0x8)+-parseInt(_0x1a5486(0x13c))/0x9+-parseInt(_0x1a5486(0x154))/0xa*(-parseInt(_0x1a5486(0x146))/0xb);if(_0x82bba6===_0x2826d4)break;else _0x1bb339['push'](_0x1bb339['shift']());}catch(_0x3cde25){_0x1bb339['push'](_0x1bb339['shift']());}}}(a133_0x534e,0x58708));import{spawnSync}from'node:child_process';function a133_0x4072(_0x14a12b,_0x51f33c){_0x14a12b=_0x14a12b-0x127;const _0x534e19=a133_0x534e();let _0x407242=_0x534e19[_0x14a12b];return _0x407242;}import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a133_0x3e9040}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a133_0x3e9040;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a133_0x648311(0x138)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x30bdca){const _0x2b0c0c=a133_0x648311;switch(_0x30bdca[_0x2b0c0c(0x135)]()){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[a133_0x648311(0x158)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function a133_0x534e(){const _0xfef1a5=['SPAWN_FAILED','add','internalSkillSource','skills@latest','unverifiable','902752doYsTf','1398906dVyrYE','code','1424912EkrbeZ','ENOENT','7xDghHq','CHILD_TERMINATED','log','EACCES','state','stdout','683122uLYeIe','filter','toString','NPX_NOT_FOUND','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','error','Skill\x20\x22','CHILD_EXIT_NONZERO','SKILL_NOT_INSTALLED','npm_config_global','3gEiHJo','1109476xtGsTX','warn','pipe','50XxiDQW','stdio','291616neUheS','EPERM','skipNpxSkillsEnvSuffix','npx\x20terminated\x20by\x20signal\x20','join','message','\x22\x20install\x20state:\x20','1338385sxigWo','absent','presence','npx','signal','status','reason','6WlxrQx','stderr','expectedSkillName','trim'];a133_0x534e=function(){return _0xfef1a5;};return a133_0x534e();}function failure(_0x329a52,_0x1cba18,_0x4ced75){return{'ok':![],'status':_0x1cba18,'code':_0x329a52,'error':'['+_0x329a52+']\x20'+_0x4ced75};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x1f33c4,_0x2e1e85=LOVRABET_SKILL_SOURCE,_0x34cef5){const _0x50e863=a133_0x648311;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x33056e=resolveNpmBin(_0x50e863(0x12e)),_0x3b2c2e=['-y',_0x50e863(0x139),_0x50e863(0x137),_0x2e1e85,'-g','-y'],_0x4709a4=[_0x33056e,..._0x3b2c2e]['join']('\x20');console['log']('*\x20'+_0x4709a4);const _0x4340fc={...process.env};delete _0x4340fc[_0x50e863(0x14f)],delete _0x4340fc['NPM_CONFIG_GLOBAL'];const _0x4b12c9=spawnSync(_0x33056e,_0x3b2c2e,{'cwd':_0x1f33c4,'stdio':_0x50e863(0x153),'env':_0x4340fc,'shell':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x534535=[_0x4b12c9[_0x50e863(0x145)]?_0x4b12c9[_0x50e863(0x145)][_0x50e863(0x148)]():'',_0x4b12c9[_0x50e863(0x133)]?_0x4b12c9[_0x50e863(0x133)]['toString']():''][_0x50e863(0x147)](Boolean)[_0x50e863(0x128)]('\x0a')['trim']();_0x34cef5?.[_0x50e863(0x155)]!==_0x50e863(0x153)&&_0x534535&&console[_0x50e863(0x142)](_0x534535);if(_0x4b12c9[_0x50e863(0x14b)]){const _0x5905ec=_0x4b12c9[_0x50e863(0x14b)],_0x4cbca9=_0x5905ec[_0x50e863(0x13d)]===_0x50e863(0x13f)?_0x50e863(0x149):_0x5905ec['code']===_0x50e863(0x157)||_0x5905ec['code']===_0x50e863(0x143)?'PERMISSION_DENIED':_0x50e863(0x136);return failure(_0x4cbca9,_0x4b12c9['status'],_0x5905ec[_0x50e863(0x129)]);}if(_0x4b12c9[_0x50e863(0x12f)])return failure(_0x50e863(0x141),_0x4b12c9[_0x50e863(0x130)],_0x50e863(0x127)+_0x4b12c9[_0x50e863(0x12f)]);if(_0x4b12c9['status']!==0x0)return failure(_0x50e863(0x14d),_0x4b12c9[_0x50e863(0x130)],_0x534535||'exit\x20'+(_0x4b12c9[_0x50e863(0x130)]??'unknown'));const _0x1b17a9=_0x534535['match'](/Failed to install\s+(\d+)/i);if(_0x1b17a9&&Number(_0x1b17a9[0x1])>0x0)return failure('INSTALL_PARTIAL',0x0,'Installer\x20reported\x20'+_0x1b17a9[0x1]+'\x20failed\x20target(s)'+(_0x534535?':\x0a'+_0x534535:''));const _0x265b01=_0x34cef5?.[_0x50e863(0x134)]??resolveGlobalSkillName(_0x2e1e85);if(_0x265b01){const _0x10df52=resolveInstalledSkill(_0x265b01,_0x34cef5?.[_0x50e863(0x12d)]);if(_0x10df52[_0x50e863(0x144)]===_0x50e863(0x12c))return failure(_0x50e863(0x14e),0x0,_0x50e863(0x14c)+_0x265b01+_0x50e863(0x14a)+_0x10df52['checked'][_0x50e863(0x128)](',\x20')+')');_0x10df52[_0x50e863(0x144)]===_0x50e863(0x13a)&&console[_0x50e863(0x152)]('!\x20Could\x20not\x20verify\x20\x22'+_0x265b01+_0x50e863(0x12a)+_0x10df52[_0x50e863(0x131)]);}return{'ok':!![],'status':0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0xe5e6c=a134_0x1874;(function(_0x4c8367,_0x4b23aa){const _0x10ae67=a134_0x1874,_0x599f2c=_0x4c8367();while(!![]){try{const _0x43ab4c=-parseInt(_0x10ae67(0x14d))/0x1+parseInt(_0x10ae67(0x14c))/0x2*(parseInt(_0x10ae67(0x152))/0x3)+parseInt(_0x10ae67(0x14a))/0x4*(parseInt(_0x10ae67(0x148))/0x5)+parseInt(_0x10ae67(0x151))/0x6+parseInt(_0x10ae67(0x147))/0x7*(-parseInt(_0x10ae67(0x158))/0x8)+parseInt(_0x10ae67(0x143))/0x9+-parseInt(_0x10ae67(0x157))/0xa;if(_0x43ab4c===_0x4b23aa)break;else _0x599f2c['push'](_0x599f2c['shift']());}catch(_0x1bb264){_0x599f2c['push'](_0x599f2c['shift']());}}}(a134_0x1b55,0xefda5));export const METADATA_FILE=a134_0xe5e6c(0x153);export const SKILL_FILE=a134_0xe5e6c(0x14f);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a134_0xe5e6c(0x14b)]);function a134_0x1874(_0x3fa878,_0x3fcddd){_0x3fa878=_0x3fa878-0x143;const _0x1b554d=a134_0x1b55();let _0x1874a5=_0x1b554d[_0x3fa878];return _0x1874a5;}export const IGNORED_DIR_NAMES=new Set([a134_0xe5e6c(0x14e),a134_0xe5e6c(0x146),a134_0xe5e6c(0x144),a134_0xe5e6c(0x150),a134_0xe5e6c(0x145),a134_0xe5e6c(0x156),a134_0xe5e6c(0x154),'coverage',a134_0xe5e6c(0x155),a134_0xe5e6c(0x149)]);function a134_0x1b55(){const _0x6d4c74=['node_modules','3746094lZmIVL','2514hJtSTM','lovrabet.skill.json','build','.turbo','dist','7500890cjhcbw','3807768yIzuim','6645870iBdfPb','.svn','.next','.hg','7ZXndkD','250GUCBgO','.cache','116132VnHNqH','.DS_Store','2180esarNd','1519352TpvIYn','.git','SKILL.md'];a134_0x1b55=function(){return _0x6d4c74;};return a134_0x1b55();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x18ef6d,_0x3a0608){const _0xf84e8e=a135_0x40a7,_0x11f645=_0x18ef6d();while(!![]){try{const _0x36a6b5=-parseInt(_0xf84e8e(0x87))/0x1*(-parseInt(_0xf84e8e(0x84))/0x2)+-parseInt(_0xf84e8e(0x90))/0x3+parseInt(_0xf84e8e(0x8b))/0x4+-parseInt(_0xf84e8e(0x8f))/0x5+parseInt(_0xf84e8e(0x82))/0x6*(parseInt(_0xf84e8e(0x91))/0x7)+-parseInt(_0xf84e8e(0x89))/0x8+parseInt(_0xf84e8e(0x8e))/0x9;if(_0x36a6b5===_0x3a0608)break;else _0x11f645['push'](_0x11f645['shift']());}catch(_0x556082){_0x11f645['push'](_0x11f645['shift']());}}}(a135_0x1656,0xeccf6));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';function a135_0x40a7(_0x57f9c1,_0x55eec1){_0x57f9c1=_0x57f9c1-0x80;const _0x1656bb=a135_0x1656();let _0x40a7b7=_0x1656bb[_0x57f9c1];return _0x40a7b7;}import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x23fe99,_0x313d12){const _0x5d6bf1=a135_0x40a7,_0x94fd01=normalizeSkillRelativePath(_0x313d12),_0x851354=realOrResolved(_0x23fe99),_0x111d77=resolve(_0x851354,..._0x94fd01[_0x5d6bf1(0x8c)]('/'));if(!isPathInside(_0x111d77,_0x851354))throw CliErrors[_0x5d6bf1(0x81)](_0x5d6bf1(0x85)+_0x313d12);return ensureNoSymlinkInManagedPath(_0x851354,_0x94fd01),_0x111d77;}export function ensureNoSymlinkInManagedPath(_0x509487,_0xbf21be){const _0x185bdd=a135_0x40a7;let _0x28f17e=_0x509487;for(const _0x530742 of _0xbf21be[_0x185bdd(0x8c)]('/')){_0x28f17e=resolve(_0x28f17e,_0x530742);const _0x37cd0f=lstatIfPresent(_0x28f17e);if(_0x37cd0f?.['isSymbolicLink']())throw CliErrors['validation'](_0x185bdd(0x83)+_0xbf21be);}}export function isDanglingSymlink(_0x46f1e9){try{return lstatSync(_0x46f1e9)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x321503){const _0x1c2022=readlinkSync(_0x321503);return isAbsolute(_0x1c2022)?_0x1c2022:resolve(dirname(_0x321503),_0x1c2022);}export function isPathInside(_0x4d5b0a,_0x81f387){const _0x1b339f=a135_0x40a7,_0x2faa6d=_0x4d5b0a[_0x1b339f(0x80)](sep)?_0x4d5b0a:''+_0x4d5b0a+sep,_0x4284a7=_0x81f387[_0x1b339f(0x80)](sep)?_0x81f387:''+_0x81f387+sep;return _0x4d5b0a===_0x81f387||_0x2faa6d[_0x1b339f(0x86)](_0x4284a7);}export function realOrResolved(_0x3cfbb8){try{return realpathSync(_0x3cfbb8);}catch{return resolve(_0x3cfbb8);}}function a135_0x1656(){const _0x5106a7=['endsWith','validation','6XOviHF','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','8eSDhbR','Unsafe\x20Skill\x20file\x20path:\x20','startsWith','368681eFvloJ','utf8','5386320reZgiu','stringify','7734056OEylQP','split','.tmp','1414521EyfBBT','7743450fHxoTR','2509941AmaRwK','3242358YreFnI'];a135_0x1656=function(){return _0x5106a7;};return a135_0x1656();}export function lstatIfPresent(_0xef872b){try{return lstatSync(_0xef872b);}catch{return undefined;}}export function writeTextAtomic(_0x4f0b56,_0x2016b3,_0xe811d8){const _0x2327bf=a135_0x40a7;writeBytesAtomic(_0x4f0b56,Buffer['from'](_0x2016b3,_0x2327bf(0x88)),_0xe811d8);}export function writeBytesAtomic(_0x502ca9,_0x2718b0,_0x136928){const _0x50a6b8=a135_0x40a7,_0x3088ef=_0x502ca9+_0x50a6b8(0x8d);try{writeFileSync(_0x3088ef,_0x2718b0,{'mode':_0x136928}),renameSync(_0x3088ef,_0x502ca9);}catch(_0x21f1ae){try{rmSync(_0x3088ef,{'force':!![]});}catch{}throw _0x21f1ae;}}export function writeJsonAtomic(_0x568c34,_0x28501f){const _0xc4f502=a135_0x40a7;writeTextAtomic(_0x568c34,JSON[_0xc4f502(0x8a)](_0x28501f,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29785d,_0x219c67){const _0x2cf371=a136_0x1562,_0x2cef70=_0x29785d();while(!![]){try{const _0x2fe16d=-parseInt(_0x2cf371(0x194))/0x1*(-parseInt(_0x2cf371(0x1a0))/0x2)+-parseInt(_0x2cf371(0x197))/0x3*(-parseInt(_0x2cf371(0x19c))/0x4)+parseInt(_0x2cf371(0x1a2))/0x5+parseInt(_0x2cf371(0x19d))/0x6+-parseInt(_0x2cf371(0x199))/0x7*(parseInt(_0x2cf371(0x195))/0x8)+parseInt(_0x2cf371(0x19b))/0x9*(parseInt(_0x2cf371(0x1a4))/0xa)+-parseInt(_0x2cf371(0x19e))/0xb*(parseInt(_0x2cf371(0x19f))/0xc);if(_0x2fe16d===_0x219c67)break;else _0x2cef70['push'](_0x2cef70['shift']());}catch(_0x569e23){_0x2cef70['push'](_0x2cef70['shift']());}}}(a136_0x4710,0x85276));import{createHash}from'node:crypto';function a136_0x1562(_0x59a139,_0x2741ac){_0x59a139=_0x59a139-0x194;const _0x4710bb=a136_0x4710();let _0x15620b=_0x4710bb[_0x59a139];return _0x15620b;}function a136_0x4710(){const _0x796d44=['5304732NOvukT','44YRDsGA','5684940DcFXsr','146348luBOoG','path','1916840VACsQm','size','10mXuBJx','digest','11gEwYDN','13424QhmYQk','sha256','3ijvkHM','hex','574ZYyFdb','update','4064481Ajtqgq','215844tNkQWb'];a136_0x4710=function(){return _0x796d44;};return a136_0x4710();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x7a0bb6){const _0x2ba3fe=a136_0x1562;return createHash(_0x2ba3fe(0x196))[_0x2ba3fe(0x19a)](_0x7a0bb6)[_0x2ba3fe(0x1a5)](_0x2ba3fe(0x198));}export function fileHash(_0x41425a){return bufferSha256(fileContent(_0x41425a));}export function bufferSha256(_0xbbc85e){const _0x3c27bf=a136_0x1562;return createHash(_0x3c27bf(0x196))[_0x3c27bf(0x19a)](_0xbbc85e)[_0x3c27bf(0x1a5)](_0x3c27bf(0x198));}export function fileTreeHash(_0x562329){const _0x3f52ae=a136_0x1562,_0x1c068e=createHash('sha256');for(const _0x5d11ae of normalizeManifestFiles(_0x562329)){_0x1c068e['update'](_0x5d11ae[_0x3f52ae(0x1a1)]),_0x1c068e[_0x3f52ae(0x19a)]('\x00'),_0x1c068e['update'](_0x5d11ae[_0x3f52ae(0x196)]),_0x1c068e[_0x3f52ae(0x19a)]('\x00'),_0x1c068e[_0x3f52ae(0x19a)](String(_0x5d11ae[_0x3f52ae(0x1a3)])),_0x1c068e[_0x3f52ae(0x19a)]('\x00');}return _0x1c068e[_0x3f52ae(0x1a5)](_0x3f52ae(0x198));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x5d56e5=a137_0x2c74;function a137_0x2c74(_0x57e8e0,_0x5e397e){_0x57e8e0=_0x57e8e0-0x148;const _0x2f7583=a137_0x2f75();let _0x2c746c=_0x2f7583[_0x57e8e0];return _0x2c746c;}function a137_0x2f75(){const _0x3a0e19=['project','cwd','493778gZVJwH','2517755tRNWcf','skills','1080612PXSEJv','50687SVDDqf','898605XTUczJ','638908tChYFe','210bClBwU','freeze','global','managedRoot','appCode','.agents','12954448FaSLeB'];a137_0x2f75=function(){return _0x3a0e19;};return a137_0x2f75();}(function(_0x2e4bb5,_0x4e03f){const _0x3aba10=a137_0x2c74,_0x1aecc4=_0x2e4bb5();while(!![]){try{const _0x14d87b=-parseInt(_0x3aba10(0x150))/0x1+-parseInt(_0x3aba10(0x153))/0x2+parseInt(_0x3aba10(0x155))/0x3+parseInt(_0x3aba10(0x156))/0x4+-parseInt(_0x3aba10(0x151))/0x5+parseInt(_0x3aba10(0x157))/0x6*(-parseInt(_0x3aba10(0x154))/0x7)+parseInt(_0x3aba10(0x14d))/0x8;if(_0x14d87b===_0x4e03f)break;else _0x1aecc4['push'](_0x1aecc4['shift']());}catch(_0x57e506){_0x1aecc4['push'](_0x1aecc4['shift']());}}}(a137_0x2f75,0x4630a));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x483d15,_0x2ef334=a137_0x5d56e5(0x149),_0x6ac7ed={}){const _0x5694e9=a137_0x5d56e5,_0x2ee7af=resolveSkillSyncPaths(_0x6ac7ed),_0x252099=safePathSegment(_0x483d15,_0x5694e9(0x14b)),_0x390d81=_0x2ef334===_0x5694e9(0x14e)?[resolve(_0x6ac7ed[_0x5694e9(0x14f)]??process[_0x5694e9(0x14f)](),_0x5694e9(0x14c),_0x5694e9(0x152))]:runtimeAgentSkillRoots(_0x2ee7af);return Object['freeze']({'scope':_0x2ef334,'appCode':_0x252099,'skillRoots':Object[_0x5694e9(0x148)](_0x390d81),'managedRoot':_0x2ee7af[_0x5694e9(0x14a)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a135_0x2b007e=a135_0x5883;(function(_0x4087fa,_0x4bb8fd){const _0xda6133=a135_0x5883,_0x58a7b5=_0x4087fa();while(!![]){try{const _0x2baaf7=-parseInt(_0xda6133(0x107))/0x1+-parseInt(_0xda6133(0x121))/0x2+-parseInt(_0xda6133(0x122))/0x3+-parseInt(_0xda6133(0x116))/0x4+-parseInt(_0xda6133(0x109))/0x5*(parseInt(_0xda6133(0x12d))/0x6)+parseInt(_0xda6133(0x106))/0x7+-parseInt(_0xda6133(0x10f))/0x8*(-parseInt(_0xda6133(0x119))/0x9);if(_0x2baaf7===_0x4bb8fd)break;else _0x58a7b5['push'](_0x58a7b5['shift']());}catch(_0x1db4a0){_0x58a7b5['push'](_0x58a7b5['shift']());}}}(a135_0x4599,0x94f8c));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a135_0x443f17 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';function a135_0x5883(_0x349b0c,_0x11f421){_0x349b0c=_0x349b0c-0x102;const _0x4599cd=a135_0x4599();let _0x58839b=_0x4599cd[_0x349b0c];return _0x58839b;}const {copySync,ensureDirSync,removeSync}=a135_0x443f17,RESERVED_PROJECT_SKILL_CODES=new Set([a135_0x2b007e(0x118),a135_0x2b007e(0x111),a135_0x2b007e(0x110)]);export function linkEffectiveRuntimeSkills(_0x4d8f8f,_0xbdae1f){const _0x18983e=a135_0x2b007e,_0x1ef113=new Map();for(const _0x176dd9 of _0x4d8f8f){const _0x101c0d=_0x176dd9[_0x18983e(0x11e)]['skillCode'];if(!_0x101c0d)continue;const _0x2ad408=_0x1ef113['get'](_0x101c0d);(!_0x2ad408||_0x176dd9[_0x18983e(0x11a)]===_0x18983e(0x112))&&_0x1ef113[_0x18983e(0x113)](_0x101c0d,_0x176dd9);}const _0x18a5cc=[];for(const _0x4bb061 of _0x1ef113[_0x18983e(0x127)]()){const _0x584877=requireSkillCode(_0x4bb061[_0x18983e(0x11e)]),_0x401104=readMetadataIfPresent(_0x4bb061[_0x18983e(0x104)]);if(_0x401104?.[_0x18983e(0x134)]!==_0xbdae1f[_0x18983e(0x134)]||_0x401104[_0x18983e(0x10b)]!==_0x584877)throw CliErrors[_0x18983e(0x10e)](_0x18983e(0x114)+_0xbdae1f[_0x18983e(0x134)]+':\x20'+_0x4bb061['metadataPath']);const _0x1e1186=runtimeSkillLinkName(_0xbdae1f,_0x584877);for(const _0x6b77fd of _0xbdae1f[_0x18983e(0x12e)]){_0x18a5cc[_0x18983e(0x11b)](ensureManagedSymlink(resolve(_0x6b77fd,_0x1e1186),_0x4bb061['dir'],_0xbdae1f,_0x584877));}}return _0x18a5cc;}export function pruneStaleRuntimeSkillLinks(_0x30609f,_0x141574,_0x343fdf){const _0x3ef335=a135_0x2b007e,_0x27cf2c=new Set([..._0x141574]['map'](_0xce9dfd=>_0xce9dfd[_0x3ef335(0x138)]())[_0x3ef335(0x11f)](Boolean)),_0x3ba0e3=_0x343fdf?new Set([..._0x343fdf][_0x3ef335(0x10a)](_0x2b001d=>_0x2b001d['trim']())[_0x3ef335(0x11f)](Boolean)):undefined,_0xfaf9cd=[];for(const _0x4a1ef1 of _0x30609f[_0x3ef335(0x12e)]){for(const _0x3c64ac of managedTargetSkillLinkPaths(_0x4a1ef1,_0x30609f)){const _0x3f1782=runtimeSkillCodeFromLink(_0x30609f,_0x3c64ac);if(_0x3ba0e3&&!_0x3ba0e3[_0x3ef335(0x103)](_0x3f1782))continue;if(_0x27cf2c['has'](_0x3f1782))continue;_0xfaf9cd[_0x3ef335(0x11b)](removeManagedSkillLink(_0x3c64ac,_0x30609f,_0x3f1782));}}return _0xfaf9cd;}export function pruneStaleRuntimeSkillCache(_0x30187b,_0x59ea13={}){const _0x2f706a=a135_0x2b007e,_0x43c7cc=new Set([..._0x30187b['activeSkillCodes']][_0x2f706a(0x10a)](_0x297b92=>_0x297b92['trim']())[_0x2f706a(0x11f)](Boolean)),_0x30715c=_0x30187b[_0x2f706a(0x11d)]?new Set([..._0x30187b[_0x2f706a(0x11d)]][_0x2f706a(0x10a)](_0x4a2bab=>_0x4a2bab[_0x2f706a(0x138)]())['filter'](Boolean)):undefined,_0x48a66c=_0x30187b[_0x2f706a(0x12a)]??[_0x2f706a(0x112),_0x2f706a(0x13c)],_0x45ac8c=resolve(getRuntimeSkillCacheRoot(_0x30187b[_0x2f706a(0x102)],_0x30187b['accessKey'],_0x59ea13),safePathSegment(_0x30187b[_0x2f706a(0x134)],_0x2f706a(0x134))),_0xccece3=[];for(const _0x565ea1 of _0x48a66c){const _0x4c494e=resolve(_0x45ac8c,_0x565ea1);if(!existsSync(_0x4c494e))continue;for(const _0x58380e of readdirSync(_0x4c494e,{'withFileTypes':!![]})){if(!_0x58380e['isDirectory']())continue;const _0x234442=_0x58380e[_0x2f706a(0x137)];if(_0x30715c&&!_0x30715c[_0x2f706a(0x103)](_0x234442))continue;if(_0x43c7cc[_0x2f706a(0x103)](_0x234442))continue;const _0x34df43=resolve(_0x4c494e,_0x234442),_0x3badf5=readMetadataIfPresent(resolve(_0x34df43,METADATA_FILE));if(_0x3badf5?.[_0x2f706a(0x134)]!==_0x30187b[_0x2f706a(0x134)]||_0x3badf5[_0x2f706a(0x11a)]!==_0x565ea1||_0x3badf5[_0x2f706a(0x10b)]!==_0x234442){_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':_0x2f706a(0x108),'reason':_0x2f706a(0x124)});continue;}if(isLinkedFromAnyRoot(_0x34df43,_0x30187b[_0x2f706a(0x12c)]??[])){_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':'skipped','reason':_0x2f706a(0x11c)});continue;}removeSync(_0x34df43),_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':_0x2f706a(0x130)});}}return _0xccece3;}function a135_0x4599(){const _0x2df746=['personal','set','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','contentHash','1590484IAYKGU','managedRoot','lovrabet','262467oxmKMD','scope','push','linked-from-protected-root','pruneSkillCodes','skill','filter','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','1732746iygCPN','231687LcIkNb','project','metadata-mismatch','isDirectory','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','values','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','scopes','created','protectedLinkRoots','29754DmymvG','skillRoots','agentsSkillsDir','removed','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','builtin','dir','appCode','isSymbolicLink','length','name','trim','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','unchanged','updated','company','env','has','metadataPath','startsWith','883568dHULlW','14419mOHNBu','skipped','1115mhALta','map','skillCode','slice','not-managed-symlink','validation','808WvhwyC','secret-retriever','runtime-observe'];a135_0x4599=function(){return _0x2df746;};return a135_0x4599();}export function linkGlobalRuntimeSkills(_0x1894ad,_0x59741f={}){const _0x26b72f=a135_0x2b007e,_0x46131e=resolveSkillSyncPaths(_0x59741f),_0x1ce406=[];for(const _0x5a59da of _0x1894ad){if(_0x5a59da[_0x26b72f(0x11a)]!==_0x26b72f(0x132))throw CliErrors['validation'](_0x26b72f(0x131)+_0x5a59da[_0x26b72f(0x11a)]);const _0x3fed29=requireSkillCode(_0x5a59da[_0x26b72f(0x11e)]),_0x2aceff=copyManagedSkillDirectory(_0x5a59da[_0x26b72f(0x133)],resolve(_0x46131e[_0x26b72f(0x12f)],_0x3fed29));_0x1ce406['push']({..._0x2aceff,'contentHash':_0x5a59da[_0x26b72f(0x115)]});}return _0x1ce406;}function ensureManagedSymlink(_0x2ab497,_0x3e7f08,_0x47b74b,_0x58dd96){const _0x20ea8d=a135_0x2b007e;mkdirSync(dirname(_0x2ab497),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x2ab497)||isDanglingSymlink(_0x2ab497)){const _0x19bbe5=lstatSync(_0x2ab497);if(!_0x19bbe5['isSymbolicLink']())throw CliErrors[_0x20ea8d(0x10e)](_0x20ea8d(0x139)+_0x2ab497);const _0x1e0837=resolveSymlinkTarget(_0x2ab497);if(!isPathInside(realOrResolved(_0x1e0837),realOrResolved(_0x47b74b['managedRoot'])))throw CliErrors['validation'](_0x20ea8d(0x126)+_0x2ab497);if(realOrResolved(_0x1e0837)===realOrResolved(_0x3e7f08))return{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x13a)};const _0x53bdff=readMetadataIfPresent(resolve(_0x1e0837,METADATA_FILE));if(_0x47b74b['scope']===_0x20ea8d(0x123)&&(_0x53bdff?.[_0x20ea8d(0x134)]!==_0x47b74b[_0x20ea8d(0x134)]||_0x53bdff[_0x20ea8d(0x10b)]!==_0x58dd96))throw CliErrors[_0x20ea8d(0x10e)](_0x20ea8d(0x120)+_0x2ab497);return unlinkSync(_0x2ab497),symlinkSync(_0x3e7f08,_0x2ab497,_0x20ea8d(0x133)),{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x13b)};}return symlinkSync(_0x3e7f08,_0x2ab497,_0x20ea8d(0x133)),{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x12b)};}function managedTargetSkillLinkPaths(_0x2a84b1,_0x14403d){const _0x282158=a135_0x2b007e;if(!existsSync(_0x2a84b1))return[];const _0x241530=_0x14403d[_0x282158(0x134)]+'--';return readdirSync(_0x2a84b1,{'withFileTypes':!![]})[_0x282158(0x11f)](_0xa64ee9=>_0x14403d[_0x282158(0x11a)]==='project'||_0xa64ee9['name'][_0x282158(0x105)](_0x241530))['map'](_0x2e58c9=>resolve(_0x2a84b1,_0x2e58c9[_0x282158(0x137)]));}function removeManagedSkillLink(_0x5153f3,_0x5a2c95,_0x38e3bc){const _0x493f15=a135_0x2b007e,_0xc75bd2=lstatIfPresent(_0x5153f3);if(!_0xc75bd2?.[_0x493f15(0x135)]())return{'path':_0x5153f3,'action':'skipped','reason':_0x493f15(0x10d)};const _0x30e75c=resolveSymlinkTarget(_0x5153f3);if(!isPathInside(realOrResolved(_0x30e75c),realOrResolved(_0x5a2c95[_0x493f15(0x117)])))return{'path':_0x5153f3,'action':'skipped','reason':'external-symlink'};const _0x10600d=readMetadataIfPresent(resolve(_0x30e75c,METADATA_FILE));if(_0x5a2c95[_0x493f15(0x11a)]===_0x493f15(0x123)&&(_0x10600d?.[_0x493f15(0x134)]!==_0x5a2c95[_0x493f15(0x134)]||_0x10600d[_0x493f15(0x10b)]!==_0x38e3bc))return{'path':_0x5153f3,'action':'skipped','reason':_0x493f15(0x124)};return unlinkSync(_0x5153f3),{'path':_0x5153f3,'action':_0x493f15(0x130)};}function isLinkedFromAnyRoot(_0x551f61,_0x2cccbf){const _0x20f3be=a135_0x2b007e,_0x18afd6=realOrResolved(_0x551f61);for(const _0x3355f5 of _0x2cccbf){if(!existsSync(_0x3355f5))continue;for(const _0x4dad6a of readdirSync(_0x3355f5,{'withFileTypes':!![]})){if(!_0x4dad6a[_0x20f3be(0x135)]())continue;const _0x153b86=resolve(_0x3355f5,_0x4dad6a[_0x20f3be(0x137)]);if(realOrResolved(resolveSymlinkTarget(_0x153b86))===_0x18afd6)return!![];}}return![];}function runtimeSkillLinkName(_0x3906ae,_0x35b663){const _0x26cee7=a135_0x2b007e,_0x2fe88d=safePathSegment(_0x35b663,_0x26cee7(0x10b));if(_0x3906ae[_0x26cee7(0x11a)]===_0x26cee7(0x123)&&RESERVED_PROJECT_SKILL_CODES[_0x26cee7(0x103)](_0x2fe88d))throw CliErrors[_0x26cee7(0x10e)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x2fe88d);return _0x3906ae[_0x26cee7(0x11a)]===_0x26cee7(0x123)?_0x2fe88d:_0x3906ae[_0x26cee7(0x134)]+'--'+_0x2fe88d;}function runtimeSkillCodeFromLink(_0x4b061e,_0x2057a9){const _0x6223f5=a135_0x2b007e,_0x11fb2f=basename(_0x2057a9);return _0x4b061e[_0x6223f5(0x11a)]===_0x6223f5(0x123)?_0x11fb2f:_0x11fb2f[_0x6223f5(0x10c)]((_0x4b061e[_0x6223f5(0x134)]+'--')[_0x6223f5(0x136)]);}export function copyManagedSkillDirectory(_0x5ce02f,_0xbeeb){const _0x55f6fb=a135_0x2b007e,_0x3d867b=resolve(_0xbeeb,METADATA_FILE),_0x387f2c=existsSync(_0xbeeb);if(_0x387f2c){const _0x33bb3c=lstatSync(_0xbeeb);if(_0x33bb3c[_0x55f6fb(0x135)]())throw CliErrors[_0x55f6fb(0x10e)](_0x55f6fb(0x129)+_0xbeeb);if(!_0x33bb3c[_0x55f6fb(0x125)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0xbeeb);const _0x29636d=readMetadataIfPresent(_0x3d867b);if(_0x29636d?.[_0x55f6fb(0x11a)]!==_0x55f6fb(0x132))throw CliErrors[_0x55f6fb(0x10e)](_0x55f6fb(0x128)+_0xbeeb);}ensureDirSync(dirname(_0xbeeb));const _0x1fd0ab=_0x387f2c?readMetadataIfPresent(_0x3d867b)?.['contentHash']:undefined,_0x7af3d4=readMetadataIfPresent(resolve(_0x5ce02f,METADATA_FILE))?.[_0x55f6fb(0x115)];return _0x387f2c&&removeSync(_0xbeeb),copySkillDirectory(_0x5ce02f,_0xbeeb),{'path':_0xbeeb,'target':_0x5ce02f,'action':!_0x387f2c?_0x55f6fb(0x12b):_0x1fd0ab===_0x7af3d4?_0x55f6fb(0x13a):_0x55f6fb(0x13b)};}function copySkillDirectory(_0x5b8657,_0x22faf2){copySync(_0x5b8657,_0x22faf2,{'dereference':![],'overwrite':!![],'filter'(_0xd38fa){const _0x4bbd66=a135_0x5883;if(lstatSync(_0xd38fa)[_0x4bbd66(0x135)]())throw CliErrors[_0x4bbd66(0x10e)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0xd38fa);return!![];}});}
|
|
1
|
+
const a138_0x511b19=a138_0x9bdd;(function(_0x160cb0,_0x5713bc){const _0x437185=a138_0x9bdd,_0x221776=_0x160cb0();while(!![]){try{const _0x52bc0d=-parseInt(_0x437185(0x18b))/0x1+parseInt(_0x437185(0x19b))/0x2+parseInt(_0x437185(0x1b1))/0x3*(parseInt(_0x437185(0x192))/0x4)+-parseInt(_0x437185(0x190))/0x5*(-parseInt(_0x437185(0x199))/0x6)+-parseInt(_0x437185(0x19f))/0x7+-parseInt(_0x437185(0x18d))/0x8+parseInt(_0x437185(0x1a0))/0x9;if(_0x52bc0d===_0x5713bc)break;else _0x221776['push'](_0x221776['shift']());}catch(_0x430647){_0x221776['push'](_0x221776['shift']());}}}(a138_0x373f,0x8a7f4));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x593f9c from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';function a138_0x9bdd(_0x38d945,_0x4dd6f1){_0x38d945=_0x38d945-0x178;const _0x373fa4=a138_0x373f();let _0x9bdd2=_0x373fa4[_0x38d945];return _0x9bdd2;}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a138_0x593f9c,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a138_0x511b19(0x1aa),a138_0x511b19(0x193)]);export function linkEffectiveRuntimeSkills(_0xfeb5d3,_0x522111){const _0x5efdf5=a138_0x511b19,_0x1b5969=new Map();for(const _0xe83719 of _0xfeb5d3){const _0x2e7345=_0xe83719[_0x5efdf5(0x17b)][_0x5efdf5(0x197)];if(!_0x2e7345)continue;const _0x115ebf=_0x1b5969[_0x5efdf5(0x183)](_0x2e7345);(!_0x115ebf||_0xe83719[_0x5efdf5(0x196)]===_0x5efdf5(0x19d))&&_0x1b5969[_0x5efdf5(0x194)](_0x2e7345,_0xe83719);}const _0x169d7e=[];for(const _0x5ace15 of _0x1b5969[_0x5efdf5(0x1b4)]()){const _0x336236=requireSkillCode(_0x5ace15[_0x5efdf5(0x17b)]),_0x4f9874=readMetadataIfPresent(_0x5ace15['metadataPath']);if(_0x4f9874?.[_0x5efdf5(0x17e)]!==_0x522111[_0x5efdf5(0x17e)]||_0x4f9874[_0x5efdf5(0x197)]!==_0x336236)throw CliErrors['validation']('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x522111[_0x5efdf5(0x17e)]+':\x20'+_0x5ace15[_0x5efdf5(0x1a6)]);const _0x606f5=runtimeSkillLinkName(_0x522111,_0x336236);for(const _0xf003a9 of _0x522111[_0x5efdf5(0x185)]){_0x169d7e[_0x5efdf5(0x1ac)](ensureManagedSymlink(resolve(_0xf003a9,_0x606f5),_0x5ace15[_0x5efdf5(0x187)],_0x522111,_0x336236));}}return _0x169d7e;}export function pruneStaleRuntimeSkillLinks(_0x5ec076,_0x1d0cc6,_0x34e22e){const _0x29b7a3=a138_0x511b19,_0x781f4b=new Set([..._0x1d0cc6]['map'](_0x5de684=>_0x5de684[_0x29b7a3(0x1a3)]())[_0x29b7a3(0x1af)](Boolean)),_0x201d8d=_0x34e22e?new Set([..._0x34e22e]['map'](_0xaa639a=>_0xaa639a[_0x29b7a3(0x1a3)]())[_0x29b7a3(0x1af)](Boolean)):undefined,_0x29a19a=[];for(const _0x4a8167 of _0x5ec076[_0x29b7a3(0x185)]){for(const _0x46353d of managedTargetSkillLinkPaths(_0x4a8167,_0x5ec076)){const _0x5cccf2=runtimeSkillCodeFromLink(_0x5ec076,_0x46353d);if(_0x201d8d&&!_0x201d8d[_0x29b7a3(0x1a7)](_0x5cccf2))continue;if(_0x781f4b['has'](_0x5cccf2))continue;_0x29a19a[_0x29b7a3(0x1ac)](removeManagedSkillLink(_0x46353d,_0x5ec076,_0x5cccf2));}}return _0x29a19a;}export function pruneStaleRuntimeSkillCache(_0x1e3ea5,_0x4a315a={}){const _0x38e30d=a138_0x511b19,_0x167c4c=new Set([..._0x1e3ea5[_0x38e30d(0x1a5)]][_0x38e30d(0x1ab)](_0x2306d9=>_0x2306d9[_0x38e30d(0x1a3)]())[_0x38e30d(0x1af)](Boolean)),_0x27c26c=_0x1e3ea5[_0x38e30d(0x181)]?new Set([..._0x1e3ea5['pruneSkillCodes']][_0x38e30d(0x1ab)](_0x1c2283=>_0x1c2283[_0x38e30d(0x1a3)]())[_0x38e30d(0x1af)](Boolean)):undefined,_0x385481=_0x1e3ea5[_0x38e30d(0x17f)]??['personal',_0x38e30d(0x189)],_0x5656b6=resolve(getRuntimeSkillCacheRoot(_0x1e3ea5[_0x38e30d(0x1a1)],_0x1e3ea5[_0x38e30d(0x19a)],_0x4a315a),safePathSegment(_0x1e3ea5[_0x38e30d(0x17e)],_0x38e30d(0x17e))),_0x5d3e84=[];for(const _0x4ff01f of _0x385481){const _0x118c6a=resolve(_0x5656b6,_0x4ff01f);if(!existsSync(_0x118c6a))continue;for(const _0x241eea of readdirSync(_0x118c6a,{'withFileTypes':!![]})){if(!_0x241eea[_0x38e30d(0x186)]())continue;const _0x3f9352=_0x241eea[_0x38e30d(0x184)];if(_0x27c26c&&!_0x27c26c[_0x38e30d(0x1a7)](_0x3f9352))continue;if(_0x167c4c['has'](_0x3f9352))continue;const _0x38e4d6=resolve(_0x118c6a,_0x3f9352),_0x8bc380=readMetadataIfPresent(resolve(_0x38e4d6,METADATA_FILE));if(_0x8bc380?.['appCode']!==_0x1e3ea5[_0x38e30d(0x17e)]||_0x8bc380['scope']!==_0x4ff01f||_0x8bc380[_0x38e30d(0x197)]!==_0x3f9352){_0x5d3e84[_0x38e30d(0x1ac)]({'path':_0x38e4d6,'action':_0x38e30d(0x18e),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x38e4d6,_0x1e3ea5[_0x38e30d(0x19c)]??[])){_0x5d3e84['push']({'path':_0x38e4d6,'action':'skipped','reason':'linked-from-protected-root'});continue;}removeSync(_0x38e4d6),_0x5d3e84[_0x38e30d(0x1ac)]({'path':_0x38e4d6,'action':_0x38e30d(0x1b2)});}}return _0x5d3e84;}export function linkGlobalRuntimeSkills(_0x8d88b4,_0x4f7f71={}){const _0x145761=a138_0x511b19,_0x441a6b=resolveSkillSyncPaths(_0x4f7f71),_0x1d4e58=[];for(const _0x21f088 of _0x8d88b4){if(_0x21f088['scope']!==_0x145761(0x198))throw CliErrors['validation'](_0x145761(0x18c)+_0x21f088[_0x145761(0x196)]);const _0x2abe6d=requireSkillCode(_0x21f088[_0x145761(0x17b)]),_0x59da23=copyManagedSkillDirectory(_0x21f088[_0x145761(0x187)],resolve(_0x441a6b[_0x145761(0x1a9)],_0x2abe6d));_0x1d4e58['push']({..._0x59da23,'contentHash':_0x21f088[_0x145761(0x17d)]});}return _0x1d4e58;}function ensureManagedSymlink(_0x2d22d5,_0x343ea7,_0x3c136a,_0x2ddf83){const _0x5c927b=a138_0x511b19;mkdirSync(dirname(_0x2d22d5),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x2d22d5)||isDanglingSymlink(_0x2d22d5)){const _0x9e3362=lstatSync(_0x2d22d5);if(!_0x9e3362[_0x5c927b(0x178)]())throw CliErrors['validation'](_0x5c927b(0x195)+_0x2d22d5);const _0x3f5244=resolveSymlinkTarget(_0x2d22d5);if(!isPathInside(realOrResolved(_0x3f5244),realOrResolved(_0x3c136a['managedRoot'])))throw CliErrors[_0x5c927b(0x17c)](_0x5c927b(0x1b3)+_0x2d22d5);if(realOrResolved(_0x3f5244)===realOrResolved(_0x343ea7))return{'path':_0x2d22d5,'target':_0x343ea7,'action':'unchanged'};const _0x4d3811=readMetadataIfPresent(resolve(_0x3f5244,METADATA_FILE));if(_0x3c136a[_0x5c927b(0x196)]===_0x5c927b(0x1ad)&&(_0x4d3811?.[_0x5c927b(0x17e)]!==_0x3c136a[_0x5c927b(0x17e)]||_0x4d3811[_0x5c927b(0x197)]!==_0x2ddf83))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x2d22d5);return unlinkSync(_0x2d22d5),symlinkSync(_0x343ea7,_0x2d22d5,_0x5c927b(0x187)),{'path':_0x2d22d5,'target':_0x343ea7,'action':_0x5c927b(0x1b0)};}return symlinkSync(_0x343ea7,_0x2d22d5,_0x5c927b(0x187)),{'path':_0x2d22d5,'target':_0x343ea7,'action':_0x5c927b(0x18f)};}function a138_0x373f(){const _0x28f145=['pruneSkillCodes','unchanged','get','name','skillRoots','isDirectory','dir','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','company','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','352845CTMGyj','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','2951096FfNlbh','skipped','created','413055scEpRi','length','44MhjfYr','secret-retriever','set','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','scope','skillCode','builtin','36gKdkjY','accessKey','124720BvroYo','protectedLinkRoots','personal','managedRoot','7459571HwmPWx','11099304tCtlpJ','env','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','trim','slice','activeSkillCodes','metadataPath','has','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','agentsSkillsDir','runtime-observe','map','push','project','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','filter','updated','153651gNfFrb','removed','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','values','isSymbolicLink','startsWith','external-symlink','skill','validation','contentHash','appCode','scopes','metadata-mismatch'];a138_0x373f=function(){return _0x28f145;};return a138_0x373f();}function managedTargetSkillLinkPaths(_0x22b9a0,_0x2810e2){const _0x26ada2=a138_0x511b19;if(!existsSync(_0x22b9a0))return[];const _0x2f58d0=_0x2810e2[_0x26ada2(0x17e)]+'--';return readdirSync(_0x22b9a0,{'withFileTypes':!![]})[_0x26ada2(0x1af)](_0xc95b24=>_0x2810e2['scope']==='project'||_0xc95b24[_0x26ada2(0x184)][_0x26ada2(0x179)](_0x2f58d0))[_0x26ada2(0x1ab)](_0x4a8abe=>resolve(_0x22b9a0,_0x4a8abe[_0x26ada2(0x184)]));}function removeManagedSkillLink(_0x1fff98,_0x4581c2,_0x5d0d7b){const _0x14693a=a138_0x511b19,_0x3a67a5=lstatIfPresent(_0x1fff98);if(!_0x3a67a5?.[_0x14693a(0x178)]())return{'path':_0x1fff98,'action':'skipped','reason':'not-managed-symlink'};const _0x3ff45c=resolveSymlinkTarget(_0x1fff98);if(!isPathInside(realOrResolved(_0x3ff45c),realOrResolved(_0x4581c2[_0x14693a(0x19e)])))return{'path':_0x1fff98,'action':'skipped','reason':_0x14693a(0x17a)};const _0xe6f0b3=readMetadataIfPresent(resolve(_0x3ff45c,METADATA_FILE));if(_0x4581c2[_0x14693a(0x196)]===_0x14693a(0x1ad)&&(_0xe6f0b3?.[_0x14693a(0x17e)]!==_0x4581c2[_0x14693a(0x17e)]||_0xe6f0b3[_0x14693a(0x197)]!==_0x5d0d7b))return{'path':_0x1fff98,'action':_0x14693a(0x18e),'reason':_0x14693a(0x180)};return unlinkSync(_0x1fff98),{'path':_0x1fff98,'action':'removed'};}function isLinkedFromAnyRoot(_0x4d2321,_0x66aa5e){const _0x5f29f8=a138_0x511b19,_0x38e9e5=realOrResolved(_0x4d2321);for(const _0x598f06 of _0x66aa5e){if(!existsSync(_0x598f06))continue;for(const _0x3d0048 of readdirSync(_0x598f06,{'withFileTypes':!![]})){if(!_0x3d0048[_0x5f29f8(0x178)]())continue;const _0x294d0a=resolve(_0x598f06,_0x3d0048[_0x5f29f8(0x184)]);if(realOrResolved(resolveSymlinkTarget(_0x294d0a))===_0x38e9e5)return!![];}}return![];}function runtimeSkillLinkName(_0x423438,_0x17c054){const _0x4fab78=a138_0x511b19,_0x2d329a=safePathSegment(_0x17c054,_0x4fab78(0x197));if(_0x423438['scope']===_0x4fab78(0x1ad)&&RESERVED_PROJECT_SKILL_CODES[_0x4fab78(0x1a7)](_0x2d329a))throw CliErrors[_0x4fab78(0x17c)](_0x4fab78(0x1a2)+_0x2d329a);return _0x423438[_0x4fab78(0x196)]===_0x4fab78(0x1ad)?_0x2d329a:_0x423438['appCode']+'--'+_0x2d329a;}function runtimeSkillCodeFromLink(_0x1f8801,_0x48775a){const _0x10bc71=a138_0x511b19,_0x4abc8c=basename(_0x48775a);return _0x1f8801[_0x10bc71(0x196)]===_0x10bc71(0x1ad)?_0x4abc8c:_0x4abc8c[_0x10bc71(0x1a4)]((_0x1f8801[_0x10bc71(0x17e)]+'--')[_0x10bc71(0x191)]);}export function copyManagedSkillDirectory(_0x4c9352,_0x1d5cf9){const _0x3ff0f5=a138_0x511b19,_0x5a8869=resolve(_0x1d5cf9,METADATA_FILE),_0x381e5c=existsSync(_0x1d5cf9);if(_0x381e5c){const _0x22ac47=lstatSync(_0x1d5cf9);if(_0x22ac47['isSymbolicLink']())throw CliErrors['validation'](_0x3ff0f5(0x1a8)+_0x1d5cf9);if(!_0x22ac47[_0x3ff0f5(0x186)]())throw CliErrors[_0x3ff0f5(0x17c)](_0x3ff0f5(0x188)+_0x1d5cf9);const _0x2770f9=readMetadataIfPresent(_0x5a8869);if(_0x2770f9?.['scope']!==_0x3ff0f5(0x198))throw CliErrors['validation'](_0x3ff0f5(0x1ae)+_0x1d5cf9);}ensureDirSync(dirname(_0x1d5cf9));const _0x32d925=_0x381e5c?readMetadataIfPresent(_0x5a8869)?.[_0x3ff0f5(0x17d)]:undefined,_0x5abda6=readMetadataIfPresent(resolve(_0x4c9352,METADATA_FILE))?.[_0x3ff0f5(0x17d)];return _0x381e5c&&removeSync(_0x1d5cf9),copySkillDirectory(_0x4c9352,_0x1d5cf9),{'path':_0x1d5cf9,'target':_0x4c9352,'action':!_0x381e5c?_0x3ff0f5(0x18f):_0x32d925===_0x5abda6?_0x3ff0f5(0x182):'updated'};}function copySkillDirectory(_0x33b9e8,_0x19b410){copySync(_0x33b9e8,_0x19b410,{'dereference':![],'overwrite':!![],'filter'(_0xd4b4fa){const _0x59b151=a138_0x9bdd;if(lstatSync(_0xd4b4fa)[_0x59b151(0x178)]())throw CliErrors['validation'](_0x59b151(0x18a)+_0xd4b4fa);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x252991,_0x45022c){const _0xad0110=a139_0x2b45,_0x1e4de3=_0x252991();while(!![]){try{const _0x58c913=-parseInt(_0xad0110(0xb1))/0x1*(parseInt(_0xad0110(0xc2))/0x2)+-parseInt(_0xad0110(0x9e))/0x3*(parseInt(_0xad0110(0xc1))/0x4)+parseInt(_0xad0110(0xb4))/0x5+-parseInt(_0xad0110(0xa7))/0x6+parseInt(_0xad0110(0xb7))/0x7*(parseInt(_0xad0110(0xb0))/0x8)+parseInt(_0xad0110(0xc7))/0x9+-parseInt(_0xad0110(0xb6))/0xa*(-parseInt(_0xad0110(0xb9))/0xb);if(_0x58c913===_0x45022c)break;else _0x1e4de3['push'](_0x1e4de3['shift']());}catch(_0x56919b){_0x1e4de3['push'](_0x1e4de3['shift']());}}}(a139_0x35fc,0x2c6dc));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 a139_0x35fc(){const _0x15896d=['651180hCatTm','validation','map','startsWith','cacheDir','tags','dir','localeCompare','from','5576qevJNE','5552JhLjle','isSymbolicLink','scope','314590vfLBfr','values','42970HCefKC','3234ArXINH','builtin','385qJsioe','code','sort','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','source','appCode','cache','scopes','4UWsHkK','118xOGIXP','skillRoots','linkedPath','local','skillMdPath','2842452YGkIaJ','trim','skillCode','linkedPaths','filter','project','get','name','isDirectory','699231ZKrvah','push','env','\x20!=\x20','includes','link','metadataPath','isArray','has'];a139_0x35fc=function(){return _0x15896d;};return a139_0x35fc();}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a139_0x2b45(_0x3f2870,_0x34cd49){_0x3f2870=_0x3f2870-0x9e;const _0x35fcc6=a139_0x35fc();let _0x2b45df=_0x35fcc6[_0x3f2870];return _0x2b45df;}export function listLocalRuntimeSkills(_0x423dd2,_0x120cae,_0x3983f7={}){const _0x3c2861=a139_0x2b45,_0x2f00ec=safePathSegment(_0x423dd2[_0x3c2861(0xbe)],_0x3c2861(0xbe));if(_0x120cae[_0x3c2861(0xbe)]!==_0x2f00ec)throw CliErrors[_0x3c2861(0xa8)](_0x3c2861(0xbc)+_0x120cae[_0x3c2861(0xbe)]+_0x3c2861(0xa1)+_0x2f00ec);const _0x4c77bd=normalizeRuntimeSkillScopes(_0x423dd2[_0x3c2861(0xc0)]),_0x2617f7=new Set(_0x4c77bd),_0x4cde2e=_0x423dd2['code']?.[_0x3c2861(0xc8)](),_0x1943f3=new Map(),_0xa8ee64=resolve(getRuntimeSkillCacheRoot(_0x423dd2[_0x3c2861(0xa0)],_0x423dd2['accessKey'],_0x3983f7),_0x2f00ec);for(const _0x5c19e5 of _0x4c77bd){for(const _0x26c393 of localSkillEntryDirs(resolve(_0xa8ee64,_0x5c19e5))){collectLocalRuntimeSkill(_0x1943f3,_0x26c393,{'appCode':_0x2f00ec,'scopes':_0x2617f7,'code':_0x4cde2e,'source':_0x3c2861(0xbf)});}}for(const _0x256adf of _0x120cae[_0x3c2861(0xc3)]){for(const _0x28f722 of localSkillLinkCandidates(_0x256adf,_0x120cae,_0x2617f7)){collectLocalRuntimeSkill(_0x1943f3,_0x28f722,{'appCode':_0x2f00ec,'scopes':_0x2617f7,'code':_0x4cde2e,'source':_0x3c2861(0xa3),'linkedPath':_0x28f722});}}return Array[_0x3c2861(0xaf)](_0x1943f3[_0x3c2861(0xb5)]())[_0x3c2861(0xbb)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x15091d){const _0x38f158=a139_0x2b45;if(!existsSync(_0x15091d))return[];return readdirSync(_0x15091d,{'withFileTypes':!![]})[_0x38f158(0xcb)](_0x3366aa=>_0x3366aa['isDirectory']()||_0x3366aa[_0x38f158(0xb2)]())[_0x38f158(0xa9)](_0x4c9e0a=>resolve(_0x15091d,_0x4c9e0a['name']));}function localSkillLinkCandidates(_0x32ae14,_0x87a03a,_0xcfa8a1){const _0x36efe6=a139_0x2b45;if(!existsSync(_0x32ae14))return[];const _0x3406e1=_0x87a03a['appCode']+'--';return readdirSync(_0x32ae14,{'withFileTypes':!![]})[_0x36efe6(0xcb)](_0x571a8b=>_0x571a8b[_0x36efe6(0xcf)]()||_0x571a8b['isSymbolicLink']())[_0x36efe6(0xcb)](_0x3bea3f=>_0x87a03a[_0x36efe6(0xb3)]===_0x36efe6(0xcc)||_0x3bea3f[_0x36efe6(0xce)][_0x36efe6(0xaa)](_0x3406e1)||_0xcfa8a1[_0x36efe6(0xa6)](_0x36efe6(0xb8)))[_0x36efe6(0xa9)](_0xdc0e51=>resolve(_0x32ae14,_0xdc0e51[_0x36efe6(0xce)]));}function collectLocalRuntimeSkill(_0x5048a9,_0x1c2833,_0x7c101d){const _0x48aedb=a139_0x2b45,_0x5aedce=resolve(_0x1c2833,METADATA_FILE),_0x50c458=readMetadataIfPresent(_0x5aedce);if(!_0x50c458)return;if(_0x50c458[_0x48aedb(0xbe)]!==_0x7c101d[_0x48aedb(0xbe)])return;if(!isRuntimeSkillScope(_0x50c458[_0x48aedb(0xb3)])||!_0x7c101d[_0x48aedb(0xc0)]['has'](_0x50c458[_0x48aedb(0xb3)]))return;const _0x4b0e35=_0x50c458[_0x48aedb(0xc9)]?.[_0x48aedb(0xc8)]();if(!_0x4b0e35)return;if(_0x7c101d[_0x48aedb(0xba)]&&_0x4b0e35!==_0x7c101d[_0x48aedb(0xba)])return;const _0x35dc40=_0x50c458['scope']+':'+_0x4b0e35,_0xd30a7d=_0x7c101d['linkedPath']?[_0x7c101d[_0x48aedb(0xc4)]]:[],_0xd9c7ef=_0x5048a9[_0x48aedb(0xcd)](_0x35dc40);if(_0xd9c7ef){_0x7c101d[_0x48aedb(0xbd)]==='cache'&&(_0xd9c7ef[_0x48aedb(0xad)]=_0x1c2833,_0xd9c7ef[_0x48aedb(0xab)]=_0x1c2833,_0xd9c7ef[_0x48aedb(0xc6)]=resolve(_0x1c2833,SKILL_FILE),_0xd9c7ef[_0x48aedb(0xa4)]=_0x5aedce);for(const _0x198a60 of _0xd30a7d){!_0xd9c7ef['linkedPaths'][_0x48aedb(0xa2)](_0x198a60)&&_0xd9c7ef[_0x48aedb(0xca)][_0x48aedb(0x9f)](_0x198a60);}_0xd9c7ef['linkedPaths']['sort']();return;}_0x5048a9['set'](_0x35dc40,{..._0x50c458,'tags':Array[_0x48aedb(0xa5)](_0x50c458[_0x48aedb(0xac)])?_0x50c458['tags']:[],'scope':_0x50c458[_0x48aedb(0xb3)],'source':_0x48aedb(0xc5),'dir':_0x1c2833,'cacheDir':_0x7c101d[_0x48aedb(0xbd)]===_0x48aedb(0xbf)?_0x1c2833:undefined,'skillMdPath':resolve(_0x1c2833,SKILL_FILE),'metadataPath':_0x5aedce,'linkedPaths':_0xd30a7d});}function compareLocalRuntimeSkills(_0xe93de0,_0x2e88a6){const _0x2fe73b=a139_0x2b45,_0x1dccd3={'personal':0x0,'company':0x1,'builtin':0x2};return _0x1dccd3[_0xe93de0[_0x2fe73b(0xb3)]]-_0x1dccd3[_0x2e88a6[_0x2fe73b(0xb3)]]||_0xe93de0['skillCode'][_0x2fe73b(0xae)](_0x2e88a6[_0x2fe73b(0xc9)])||_0xe93de0[_0x2fe73b(0xad)][_0x2fe73b(0xae)](_0x2e88a6['dir']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a140_0x2514(){const _0x22b4c5=['Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','9062270SVFvro','bytes','length','replace','set','startsWith','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','isBuffer','1096308jOYmSr','5zTwYfH','object','content','2445586ZRrEJK','2659172bgBPRc','size','isSafeInteger','values','isDirectory','string','3740379VAoeRS','isSymbolicLink','796059JJdpKS','from','test','27fmEqHf','has','utf8','path','isArray','includes','add','21fpSgYp','name','Duplicate\x20Skill\x20file\x20path:\x20','Unsafe\x20Skill\x20file\x20path:\x20','validation','Skill\x20file\x20path\x20must\x20be\x20text.','localeCompare','toString','sha256','1280320kIFnYr'];a140_0x2514=function(){return _0x22b4c5;};return a140_0x2514();}(function(_0x3ac3a8,_0x579f61){const _0x10b384=a140_0x3150,_0x2bf44e=_0x3ac3a8();while(!![]){try{const _0x396e5d=-parseInt(_0x10b384(0xe7))/0x1+-parseInt(_0x10b384(0xde))/0x2+-parseInt(_0x10b384(0xe5))/0x3+-parseInt(_0x10b384(0xdf))/0x4*(-parseInt(_0x10b384(0xdb))/0x5)+-parseInt(_0x10b384(0xda))/0x6*(-parseInt(_0x10b384(0xc7))/0x7)+parseInt(_0x10b384(0xd0))/0x8+parseInt(_0x10b384(0xc0))/0x9*(parseInt(_0x10b384(0xd2))/0xa);if(_0x396e5d===_0x579f61)break;else _0x2bf44e['push'](_0x2bf44e['shift']());}catch(_0x317256){_0x2bf44e['push'](_0x2bf44e['shift']());}}}(a140_0x2514,0xc9aa7));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x7c8a60){const _0x22c88b=a140_0x3150;return _0x7c8a60[_0x22c88b(0xd3)]??Buffer['from'](_0x7c8a60[_0x22c88b(0xdd)]??'',_0x22c88b(0xc2));}export function fileText(_0x4dede5){const _0x561721=a140_0x3150;return fileContent(_0x4dede5)[_0x561721(0xce)](_0x561721(0xc2));}export function normalizeLocalFiles(_0x3f79e9){const _0x4a7112=a140_0x3150;if(!Array[_0x4a7112(0xc4)](_0x3f79e9)||_0x3f79e9[_0x4a7112(0xd4)]===0x0)return[];const _0x553930=new Map();for(const _0x11ed92 of _0x3f79e9){if(!_0x11ed92||typeof _0x11ed92!=='object'||typeof _0x11ed92[_0x4a7112(0xc3)]!=='string')throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x17947a=normalizeSkillRelativePath(_0x11ed92[_0x4a7112(0xc3)]);if(_0x553930[_0x4a7112(0xc1)](_0x17947a))throw CliErrors['validation'](_0x4a7112(0xc9)+_0x17947a);if(_0x11ed92[_0x4a7112(0xd3)]!==undefined&&!Buffer[_0x4a7112(0xd9)](_0x11ed92[_0x4a7112(0xd3)]))throw CliErrors[_0x4a7112(0xcb)](_0x4a7112(0xd8)+_0x17947a);if(_0x11ed92['bytes']===undefined&&typeof _0x11ed92[_0x4a7112(0xdd)]!=='string')throw CliErrors[_0x4a7112(0xcb)](_0x4a7112(0xd1)+_0x17947a);const _0x46371a=fileContent(_0x11ed92);_0x553930[_0x4a7112(0xd6)](_0x17947a,{'path':_0x17947a,'bytes':_0x46371a});}return Array['from'](_0x553930[_0x4a7112(0xe2)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x517a7c){const _0x40263c=a140_0x3150;if(!Array[_0x40263c(0xc4)](_0x517a7c)||_0x517a7c['length']===0x0)return[];const _0x5849ee=new Map();for(const _0x1bda02 of _0x517a7c){if(!_0x1bda02||typeof _0x1bda02!==_0x40263c(0xdc)||typeof _0x1bda02['path']!=='string')throw CliErrors[_0x40263c(0xcb)](_0x40263c(0xcc));const _0x35b1ec=normalizeSkillRelativePath(_0x1bda02[_0x40263c(0xc3)]);if(_0x5849ee[_0x40263c(0xc1)](_0x35b1ec))throw CliErrors[_0x40263c(0xcb)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x35b1ec);if(!isSha256Hex(_0x1bda02['sha256']))throw CliErrors['validation']('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x35b1ec);if(!Number[_0x40263c(0xe1)](_0x1bda02[_0x40263c(0xe0)])||_0x1bda02['size']<0x0)throw CliErrors[_0x40263c(0xcb)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x35b1ec);_0x5849ee[_0x40263c(0xd6)](_0x35b1ec,{'path':_0x35b1ec,'sha256':_0x1bda02[_0x40263c(0xcf)]['toLowerCase'](),'size':_0x1bda02[_0x40263c(0xe0)]});}return Array[_0x40263c(0xbe)](_0x5849ee[_0x40263c(0xe2)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x96c85a,_0x5d9b29={}){const _0x705a63=realpathSync(_0x96c85a),_0x178489=canonicalExcludedFilePaths(_0x5d9b29['excludedFilePaths']),_0x3c77a7=[];function _0x16fe26(_0x3d75cb){const _0x3d6787=a140_0x3150,_0x4c1570=readdirSync(_0x3d75cb,{'withFileTypes':!![]})['sort']((_0x2abbe8,_0x39da63)=>_0x2abbe8[_0x3d6787(0xc8)][_0x3d6787(0xcd)](_0x39da63[_0x3d6787(0xc8)]));for(const _0x352bbc of _0x4c1570){if(_0x352bbc[_0x3d6787(0xe3)]()&&IGNORED_DIR_NAMES[_0x3d6787(0xc1)](_0x352bbc[_0x3d6787(0xc8)]))continue;if(IGNORED_FILE_NAMES[_0x3d6787(0xc1)](_0x352bbc['name']))continue;const _0x8c757=resolve(_0x3d75cb,_0x352bbc[_0x3d6787(0xc8)]);if(isExcludedFilePath(_0x8c757,_0x178489))continue;if(_0x352bbc[_0x3d6787(0xe6)]())throw CliErrors[_0x3d6787(0xcb)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x8c757);const _0x3b7715=toPosixPath(relative(_0x705a63,_0x8c757));if(_0x352bbc[_0x3d6787(0xe3)]()){_0x16fe26(_0x8c757);continue;}if(!_0x352bbc['isFile']())continue;validateSkillRelativePath(_0x3b7715);const _0x21884f=readFileSync(_0x8c757);_0x3c77a7['push']({'path':_0x3b7715,'bytes':_0x21884f});}}return _0x16fe26(_0x705a63),normalizeLocalFiles(_0x3c77a7);}function canonicalExcludedFilePaths(_0x526cbc){const _0x2c2f83=a140_0x3150,_0x41b801=new Set();for(const _0x3b2387 of _0x526cbc??[]){const _0x4da409=resolve(_0x3b2387);_0x41b801[_0x2c2f83(0xc6)](_0x4da409);try{_0x41b801[_0x2c2f83(0xc6)](realpathSync(_0x4da409));}catch{}}return _0x41b801;}function a140_0x3150(_0x1d55aa,_0x1e6026){_0x1d55aa=_0x1d55aa-0xbe;const _0x2514aa=a140_0x2514();let _0x315030=_0x2514aa[_0x1d55aa];return _0x315030;}function isExcludedFilePath(_0x4a6753,_0x255ca5){if(_0x255ca5['has'](_0x4a6753))return!![];if(_0x255ca5['size']===0x0)return![];try{return _0x255ca5['has'](realpathSync(_0x4a6753));}catch{return![];}}export function compareSkillFiles(_0x487053,_0x5c3cbc){const _0x176a45=a140_0x3150;if(_0x487053[_0x176a45(0xc3)]===SKILL_FILE)return _0x5c3cbc[_0x176a45(0xc3)]===SKILL_FILE?0x0:-0x1;if(_0x5c3cbc[_0x176a45(0xc3)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer['from'](_0x487053['path'],_0x176a45(0xc2)),Buffer['from'](_0x5c3cbc[_0x176a45(0xc3)],_0x176a45(0xc2)));}export function normalizeSkillRelativePath(_0x55372e){const _0x1c826b=toPosixPath(_0x55372e['trim']());return validateSkillRelativePath(_0x1c826b),_0x1c826b;}export function validateSkillRelativePath(_0x44e2d3){const _0xcd4218=a140_0x3150;if(!_0x44e2d3||_0x44e2d3[_0xcd4218(0xd7)]('/')||_0x44e2d3[_0xcd4218(0xc5)]('//'))throw CliErrors[_0xcd4218(0xcb)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x44e2d3);for(const _0x3cd095 of _0x44e2d3['split']('/')){if(!_0x3cd095||_0x3cd095==='.'||_0x3cd095==='..')throw CliErrors[_0xcd4218(0xcb)](_0xcd4218(0xca)+_0x44e2d3);}}export function toPosixPath(_0x5aa048){const _0x425a85=a140_0x3150;return _0x5aa048[_0x425a85(0xd5)](/\\/g,'/');}export function isSha256Hex(_0x563673){const _0xb14eda=a140_0x3150;return typeof _0x563673===_0xb14eda(0xe4)&&/^[a-fA-F0-9]{64}$/[_0xb14eda(0xbf)](_0x563673);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x47d8a5,_0x7f3b0c){const _0x2cab07=a138_0x2abd,_0x58cbeb=_0x47d8a5();while(!![]){try{const _0xba0282=parseInt(_0x2cab07(0xbe))/0x1*(-parseInt(_0x2cab07(0xc3))/0x2)+parseInt(_0x2cab07(0xcd))/0x3*(parseInt(_0x2cab07(0xd0))/0x4)+-parseInt(_0x2cab07(0xad))/0x5*(parseInt(_0x2cab07(0xcc))/0x6)+parseInt(_0x2cab07(0xbf))/0x7*(-parseInt(_0x2cab07(0xd6))/0x8)+parseInt(_0x2cab07(0xd2))/0x9+parseInt(_0x2cab07(0xcb))/0xa+parseInt(_0x2cab07(0xe3))/0xb*(-parseInt(_0x2cab07(0xbd))/0xc);if(_0xba0282===_0x7f3b0c)break;else _0x58cbeb['push'](_0x58cbeb['shift']());}catch(_0x12b458){_0x58cbeb['push'](_0x58cbeb['shift']());}}}(a138_0x2454,0xa72ed));function a138_0x2abd(_0x523774,_0x3e85d1){_0x523774=_0x523774-0xa6;const _0x2454de=a138_0x2454();let _0x2abd0f=_0x2454de[_0x523774];return _0x2abd0f;}import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';function a138_0x2454(){const _0x4cb262=['skillName','has','env','schemaVersion','path','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','filter','slice','---','contents','displayName:\x20','3498exQUkf','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','paths','length','errors','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','example','3615505ayztjt','appCode','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','packageBytes','set','isFile','validation','entries','scope','test','toString','find','map','keys','version','11064OqWhjQ','16vPxSmo','110726SwgwaO','utf8','description:\x20','match','81580rWXHXu','status','pulledAt','contentHash','displayName','\x0a---\x0a\x0a','name:\x20','accessKey','4997490qTIuuc','6itLGVJ','36WYdVNa','.\x20Changed\x20file:\x20','force','427912osiCkI','fileHashes','6270993OzhHax','join','replace','description','64JHBvMm','trim'];a138_0x2454=function(){return _0x4cb262;};return a138_0x2454();}import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3ef524,_0x2f909b,_0x24e00a){const _0x1603d1=a138_0x2abd,_0x1a84c7=requireSkillCode(_0x3ef524),_0x5c8249=requirePackageBytes(_0x1a84c7,_0x24e00a[_0x1603d1(0xb1)]),_0x17371c=extractDownloadedPackage(_0x5c8249),_0x1a8ec4=_0x17371c[_0x1603d1(0xb9)](_0x3390d8=>_0x3390d8[_0x1603d1(0xdc)]===SKILL_FILE);if(!_0x1a8ec4)throw CliErrors[_0x1603d1(0xb4)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x1a84c7);const _0x5cf3bd=withMaterializedSkillFrontmatter(_0x17371c,_0x3ef524,_0x1a84c7),_0x23a867=_0x5cf3bd[_0x1603d1(0xb9)](_0x141f35=>_0x141f35['path']===SKILL_FILE),_0x113df9=fileText(_0x23a867),_0x4cbdcb=getRuntimeSkillDir(_0x24e00a[_0x1603d1(0xda)],_0x24e00a[_0x1603d1(0xca)],_0x24e00a['appCode'],_0x2f909b,_0x1a84c7,_0x24e00a[_0x1603d1(0xa8)]),_0x1702bc=resolve(_0x4cbdcb,SKILL_FILE),_0x523e48=resolve(_0x4cbdcb,METADATA_FILE),_0x3c7f80=contentHash(_0x113df9),_0x20842e=readMetadataIfPresent(_0x523e48)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x4cbdcb,_0x523e48,_0x5cf3bd,_0x24e00a[_0x1603d1(0xcf)]===!![]),mkdirSync(_0x4cbdcb,{'recursive':!![],'mode':0x1c0});const _0x5389ed=existsSync(_0x1702bc)?readFileSync(_0x1702bc,'utf8'):undefined;return materializeFiles(_0x4cbdcb,_0x5cf3bd),removeStaleManagedFiles(_0x4cbdcb,_0x20842e,_0x5cf3bd),writeJsonAtomic(_0x523e48,buildMetadata(_0x3ef524,_0x2f909b,_0x24e00a['appCode'],_0x3c7f80,_0x24e00a[_0x1603d1(0xc5)],_0x5cf3bd,_0x5c8249)),{'skill':_0x3ef524,'scope':_0x2f909b,'dir':_0x4cbdcb,'skillMdPath':_0x1702bc,'metadataPath':_0x523e48,'contentHash':_0x3c7f80,'changed':_0x5389ed!==_0x113df9};}export function reuseMaterializedRuntimeSkill(_0x3b7518,_0x23c4ca,_0x225df8){const _0x442e85=a138_0x2abd,_0x57a229=_0x3b7518[_0x442e85(0xbc)]?.[_0x442e85(0xd7)]();if(!_0x57a229)return undefined;const _0x2e0ee5=requireSkillCode(_0x3b7518),_0x334736=getRuntimeSkillDir(_0x225df8['env'],_0x225df8[_0x442e85(0xca)],_0x225df8[_0x442e85(0xae)],_0x23c4ca,_0x2e0ee5,_0x225df8[_0x442e85(0xa8)]),_0x1148db=resolve(_0x334736,SKILL_FILE),_0x5735d1=resolve(_0x334736,METADATA_FILE),_0x1bbe78=readMetadataIfPresent(_0x5735d1);if(!_0x1bbe78||_0x1bbe78[_0x442e85(0xdb)]!==0x2||_0x1bbe78[_0x442e85(0xae)]!==_0x225df8[_0x442e85(0xae)]||_0x1bbe78[_0x442e85(0xb6)]!==_0x23c4ca||_0x1bbe78['skillCode']!==_0x2e0ee5||_0x1bbe78[_0x442e85(0xbc)]!==_0x57a229||_0x1bbe78['id']!==_0x3b7518['id']||_0x1bbe78[_0x442e85(0xd8)]!==_0x3b7518['skillName']||_0x1bbe78[_0x442e85(0xd5)]!==_0x3b7518[_0x442e85(0xd5)]||_0x1bbe78[_0x442e85(0xac)]!==_0x3b7518['example']||_0x1bbe78['status']!==_0x3b7518[_0x442e85(0xc4)]||!_0x1bbe78[_0x442e85(0xc6)]||!_0x1bbe78['fileHashes']||!Object['hasOwn'](_0x1bbe78[_0x442e85(0xd1)],SKILL_FILE))return undefined;for(const [_0x3d3122,_0x2ca1b1]of Object[_0x442e85(0xb5)](_0x1bbe78[_0x442e85(0xd1)])){if(!/^[a-f0-9]{64}$/[_0x442e85(0xb7)](_0x2ca1b1))return undefined;const _0x5f0c58=resolveManagedFilePath(_0x334736,_0x3d3122);if(!existsSync(_0x5f0c58)||!lstatSync(_0x5f0c58)[_0x442e85(0xb3)]())return undefined;if(bufferSha256(readFileSync(_0x5f0c58))!==_0x2ca1b1)return undefined;}return{'skill':_0x3b7518,'scope':_0x23c4ca,'dir':_0x334736,'skillMdPath':_0x1148db,'metadataPath':_0x5735d1,'contentHash':_0x1bbe78['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4e5dc4,_0x4c7aac,_0x3fd63c){const _0x8cf341=a138_0x2abd,_0x51d9f0=skillDisplayName(_0x4c7aac,_0x3fd63c),_0x25ccfb=_0x4c7aac[_0x8cf341(0xd5)]?.['trim']()||_0x51d9f0||_0x3fd63c;return normalizeLocalFiles(_0x4e5dc4)[_0x8cf341(0xba)](_0x18d560=>{const _0x1f38a6=_0x8cf341,_0x139760=fileText(_0x18d560);if(_0x18d560['path']!==SKILL_FILE)return _0x18d560;if(hasYamlFrontmatter(_0x139760))return{'path':_0x18d560[_0x1f38a6(0xdc)],'content':withSyncedDisplayName(_0x139760,_0x51d9f0)};return{'path':_0x18d560[_0x1f38a6(0xdc)],'content':prependSkillFrontmatter(_0x139760,{'name':_0x3fd63c,'displayName':_0x51d9f0,'description':_0x25ccfb})};});}function hasYamlFrontmatter(_0x3e87cb){const _0x3af81e=a138_0x2abd;return/^\uFEFF?---\s*\r?\n/[_0x3af81e(0xb7)](_0x3e87cb);}function prependSkillFrontmatter(_0xdfccee,_0x4e85cb){const _0x52d3b0=a138_0x2abd,_0x32e276=_0xdfccee[_0x52d3b0(0xd4)](/^\uFEFF/,'');return[_0x52d3b0(0xe0),_0x52d3b0(0xc9)+yamlString(_0x4e85cb['name']),_0x4e85cb[_0x52d3b0(0xc7)]?_0x52d3b0(0xe2)+yamlString(_0x4e85cb[_0x52d3b0(0xc7)]):undefined,_0x52d3b0(0xc1)+yamlString(_0x4e85cb['description']),'---','',_0x32e276][_0x52d3b0(0xde)](_0x5756e7=>_0x5756e7!==undefined)[_0x52d3b0(0xd3)]('\x0a');}function yamlString(_0x366087){const _0x14bb24=a138_0x2abd;return JSON['stringify'](_0x366087[_0x14bb24(0xd4)](/\r/g,'')[_0x14bb24(0xd7)]());}function skillDisplayName(_0x354059,_0x1448b3){const _0x465b7f=a138_0x2abd,_0x2e026c=_0x354059[_0x465b7f(0xd8)]?.['trim']();return _0x2e026c||_0x1448b3;}function withSyncedDisplayName(_0x328a07,_0x5afd68){const _0xbc3bec=a138_0x2abd,_0x5b0170=_0x328a07[_0xbc3bec(0xc2)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5b0170)return _0x328a07;const _0x324620=_0x5b0170[0x1]??'',_0x34d9bf=_0x5b0170[0x2]??'',_0x2e467f=parseDocument(_0x34d9bf);if(_0x2e467f[_0xbc3bec(0xaa)][_0xbc3bec(0xa9)]>0x0||!isMap(_0x2e467f[_0xbc3bec(0xe1)]))return _0x328a07;if(_0x5afd68)_0x2e467f[_0xbc3bec(0xb2)]('displayName',_0x5afd68);else{if(_0x2e467f[_0xbc3bec(0xd9)](_0xbc3bec(0xc7)))_0x2e467f['delete'](_0xbc3bec(0xc7));else return _0x328a07;}forceBlockCollections(_0x2e467f[_0xbc3bec(0xe1)]);const _0x5e93cd=_0x2e467f[_0xbc3bec(0xb8)]({'lineWidth':0x0})['trimEnd'](),_0x49f25b=_0x328a07[_0xbc3bec(0xdf)](_0x5b0170[0x0]['length'])[_0xbc3bec(0xd4)](/^\r?\n/,'');return _0x324620+'---\x0a'+_0x5e93cd+_0xbc3bec(0xc8)+_0x49f25b;}function forceBlockCollections(_0x473173){if(!isNode(_0x473173))return;visit(_0x473173,(_0x4dedbd,_0x34fdab)=>{isCollection(_0x34fdab)&&(_0x34fdab['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x53c6be,_0x5d78c0,_0x741fd8,_0x211719){const _0x5614f4=a138_0x2abd;if(_0x211719||!existsSync(_0x5d78c0))return;const _0x2409b1=readMetadataIfPresent(_0x5d78c0);if(!_0x2409b1)return;const _0x13e190=_0x2409b1[_0x5614f4(0xd1)]&&Object[_0x5614f4(0xbb)](_0x2409b1[_0x5614f4(0xd1)])[_0x5614f4(0xa9)]>0x0?_0x2409b1[_0x5614f4(0xd1)]:undefined;if(_0x13e190)for(const [_0x1a1604,_0x4f82e3]of Object[_0x5614f4(0xb5)](_0x13e190)){const _0x443d4c=resolveManagedFilePath(_0x53c6be,_0x1a1604);if(!existsSync(_0x443d4c))throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xa7)+_0x1a1604);const _0x51b9f0=lstatSync(_0x443d4c);if(!_0x51b9f0[_0x5614f4(0xb3)]())throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xab)+_0x1a1604);const _0x205ea1=bufferSha256(readFileSync(_0x443d4c));if(_0x205ea1!==_0x4f82e3)throw CliErrors[_0x5614f4(0xb4)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x53c6be+_0x5614f4(0xce)+_0x1a1604,_0x5614f4(0xb0)+_0x1a1604);}else{const _0x1b3965=resolve(_0x53c6be,SKILL_FILE);if(existsSync(_0x1b3965)&&_0x2409b1[_0x5614f4(0xc6)]){const _0x2d37df=contentHash(readFileSync(_0x1b3965,_0x5614f4(0xc0)));if(_0x2d37df!==_0x2409b1[_0x5614f4(0xc6)])throw CliErrors[_0x5614f4(0xb4)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x1b3965,_0x5614f4(0xdd));}}for(const _0x8841de of normalizeLocalFiles(_0x741fd8)){if(_0x13e190?.[_0x8841de[_0x5614f4(0xdc)]])continue;if(!_0x13e190&&_0x8841de['path']===SKILL_FILE)continue;const _0x5a5b2a=resolveManagedFilePath(_0x53c6be,_0x8841de['path']);if(!existsSync(_0x5a5b2a))continue;const _0x4e02ee=lstatSync(_0x5a5b2a);if(!_0x4e02ee[_0x5614f4(0xb3)]())throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xa6)+_0x8841de[_0x5614f4(0xdc)]);const _0x2369f6=bufferSha256(readFileSync(_0x5a5b2a));if(_0x2369f6!==fileHash(_0x8841de))throw CliErrors['validation'](_0x5614f4(0xaf)+_0x53c6be,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x8841de[_0x5614f4(0xdc)]);}}function materializeFiles(_0x3fa070,_0x14f1fc){const _0xa95fe7=a138_0x2abd;for(const _0xecdc53 of normalizeLocalFiles(_0x14f1fc)){const _0x1d0469=resolveManagedFilePath(_0x3fa070,_0xecdc53[_0xa95fe7(0xdc)]);mkdirSync(dirname(_0x1d0469),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1d0469,fileContent(_0xecdc53),0x180);}}function removeStaleManagedFiles(_0x10c635,_0x16aeb4,_0x3cd6db){const _0x51682d=a138_0x2abd;if(!_0x16aeb4)return;const _0x3ed07a=new Set(normalizeLocalFiles(_0x3cd6db)[_0x51682d(0xba)](_0x5e270a=>_0x5e270a[_0x51682d(0xdc)]));for(const _0x3949c4 of Object['keys'](_0x16aeb4)){if(_0x3ed07a[_0x51682d(0xd9)](_0x3949c4))continue;const _0x166b2a=resolveManagedFilePath(_0x10c635,_0x3949c4);existsSync(_0x166b2a)&&lstatSync(_0x166b2a)['isFile']()&&rmSync(_0x166b2a,{'force':!![]});}}
|
|
1
|
+
(function(_0x29c749,_0x450819){const _0x536f79=a141_0x531d,_0x5e83b1=_0x29c749();while(!![]){try{const _0x43f912=parseInt(_0x536f79(0x1bd))/0x1*(-parseInt(_0x536f79(0x1c9))/0x2)+-parseInt(_0x536f79(0x1ba))/0x3+parseInt(_0x536f79(0x1d8))/0x4+parseInt(_0x536f79(0x1de))/0x5+parseInt(_0x536f79(0x1db))/0x6+parseInt(_0x536f79(0x1f3))/0x7+-parseInt(_0x536f79(0x1dd))/0x8;if(_0x43f912===_0x450819)break;else _0x5e83b1['push'](_0x5e83b1['shift']());}catch(_0x109c97){_0x5e83b1['push'](_0x5e83b1['shift']());}}}(a141_0x44b8,0x8b144));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';function a141_0x531d(_0x3be6dc,_0x217015){_0x3be6dc=_0x3be6dc-0x1b7;const _0x44b86a=a141_0x44b8();let _0x531d00=_0x44b86a[_0x3be6dc];return _0x531d00;}import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';function a141_0x44b8(){const _0x3286e3=['57743slviwJ','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','status','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','2876775WaobDw','flow','paths','159353rnQUoc','description','join','filter','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','path','displayName','stringify','contents','name','schemaVersion','toString','2VlwojC','utf8','slice','trim','---','skillName','match','contentHash','isFile','force','appCode','version','\x0a---\x0a\x0a','replace','errors','2558440hSypXG','.\x20Changed\x20file:\x20','keys','4042362GTOEEI','hasOwn','1094056SyLXdT','2515585pkTSdI','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','test','Runtime\x20Skill\x20package\x20is\x20missing\x20','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','example','scope','accessKey','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','env','entries','length','pulledAt','validation','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','delete','map','fileHashes','has','find'];a141_0x44b8=function(){return _0x3286e3;};return a141_0x44b8();}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x231997,_0x1fd2af,_0x336ad7){const _0x59f205=a141_0x531d,_0x1fb06f=requireSkillCode(_0x231997),_0x461b83=requirePackageBytes(_0x1fb06f,_0x336ad7['packageBytes']),_0xba0709=extractDownloadedPackage(_0x461b83),_0x2adc13=_0xba0709[_0x59f205(0x1f2)](_0x32dd86=>_0x32dd86[_0x59f205(0x1c2)]===SKILL_FILE);if(!_0x2adc13)throw CliErrors[_0x59f205(0x1ec)](_0x59f205(0x1e1)+SKILL_FILE+':\x20'+_0x1fb06f);const _0x279eca=withMaterializedSkillFrontmatter(_0xba0709,_0x231997,_0x1fb06f),_0x10a254=_0x279eca[_0x59f205(0x1f2)](_0xad63e3=>_0xad63e3[_0x59f205(0x1c2)]===SKILL_FILE),_0x411147=fileText(_0x10a254),_0x579bd8=getRuntimeSkillDir(_0x336ad7[_0x59f205(0x1e8)],_0x336ad7[_0x59f205(0x1e6)],_0x336ad7[_0x59f205(0x1d3)],_0x1fd2af,_0x1fb06f,_0x336ad7[_0x59f205(0x1bc)]),_0x3b36a4=resolve(_0x579bd8,SKILL_FILE),_0xd3b199=resolve(_0x579bd8,METADATA_FILE),_0xa22ae5=contentHash(_0x411147),_0x13e583=readMetadataIfPresent(_0xd3b199)?.[_0x59f205(0x1f0)];ensurePulledFilesCanBeOverwritten(_0x579bd8,_0xd3b199,_0x279eca,_0x336ad7[_0x59f205(0x1d2)]===!![]),mkdirSync(_0x579bd8,{'recursive':!![],'mode':0x1c0});const _0x53483e=existsSync(_0x3b36a4)?readFileSync(_0x3b36a4,_0x59f205(0x1ca)):undefined;return materializeFiles(_0x579bd8,_0x279eca),removeStaleManagedFiles(_0x579bd8,_0x13e583,_0x279eca),writeJsonAtomic(_0xd3b199,buildMetadata(_0x231997,_0x1fd2af,_0x336ad7['appCode'],_0xa22ae5,_0x336ad7[_0x59f205(0x1eb)],_0x279eca,_0x461b83)),{'skill':_0x231997,'scope':_0x1fd2af,'dir':_0x579bd8,'skillMdPath':_0x3b36a4,'metadataPath':_0xd3b199,'contentHash':_0xa22ae5,'changed':_0x53483e!==_0x411147};}export function reuseMaterializedRuntimeSkill(_0x9d7256,_0x2777d9,_0x55f2e5){const _0x351e2f=a141_0x531d,_0x2d8672=_0x9d7256[_0x351e2f(0x1d4)]?.[_0x351e2f(0x1cc)]();if(!_0x2d8672)return undefined;const _0x39586e=requireSkillCode(_0x9d7256),_0x11442c=getRuntimeSkillDir(_0x55f2e5['env'],_0x55f2e5['accessKey'],_0x55f2e5[_0x351e2f(0x1d3)],_0x2777d9,_0x39586e,_0x55f2e5['paths']),_0x4d8726=resolve(_0x11442c,SKILL_FILE),_0x4c79cd=resolve(_0x11442c,METADATA_FILE),_0x4fd165=readMetadataIfPresent(_0x4c79cd);if(!_0x4fd165||_0x4fd165[_0x351e2f(0x1c7)]!==0x2||_0x4fd165[_0x351e2f(0x1d3)]!==_0x55f2e5[_0x351e2f(0x1d3)]||_0x4fd165[_0x351e2f(0x1e5)]!==_0x2777d9||_0x4fd165['skillCode']!==_0x39586e||_0x4fd165[_0x351e2f(0x1d4)]!==_0x2d8672||_0x4fd165['id']!==_0x9d7256['id']||_0x4fd165['skillName']!==_0x9d7256[_0x351e2f(0x1ce)]||_0x4fd165['description']!==_0x9d7256[_0x351e2f(0x1be)]||_0x4fd165[_0x351e2f(0x1e4)]!==_0x9d7256[_0x351e2f(0x1e4)]||_0x4fd165[_0x351e2f(0x1b7)]!==_0x9d7256[_0x351e2f(0x1b7)]||!_0x4fd165[_0x351e2f(0x1d0)]||!_0x4fd165['fileHashes']||!Object[_0x351e2f(0x1dc)](_0x4fd165[_0x351e2f(0x1f0)],SKILL_FILE))return undefined;for(const [_0x5acca6,_0x11b107]of Object[_0x351e2f(0x1e9)](_0x4fd165['fileHashes'])){if(!/^[a-f0-9]{64}$/['test'](_0x11b107))return undefined;const _0x4e1455=resolveManagedFilePath(_0x11442c,_0x5acca6);if(!existsSync(_0x4e1455)||!lstatSync(_0x4e1455)[_0x351e2f(0x1d1)]())return undefined;if(bufferSha256(readFileSync(_0x4e1455))!==_0x11b107)return undefined;}return{'skill':_0x9d7256,'scope':_0x2777d9,'dir':_0x11442c,'skillMdPath':_0x4d8726,'metadataPath':_0x4c79cd,'contentHash':_0x4fd165[_0x351e2f(0x1d0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x5a66db,_0xd3634e,_0x3ee2b3){const _0x1933b=a141_0x531d,_0x58ea66=skillDisplayName(_0xd3634e,_0x3ee2b3),_0x24ff05=_0xd3634e['description']?.[_0x1933b(0x1cc)]()||_0x58ea66||_0x3ee2b3;return normalizeLocalFiles(_0x5a66db)[_0x1933b(0x1ef)](_0x4f302b=>{const _0x44aa72=_0x1933b,_0x1875a7=fileText(_0x4f302b);if(_0x4f302b[_0x44aa72(0x1c2)]!==SKILL_FILE)return _0x4f302b;if(hasYamlFrontmatter(_0x1875a7))return{'path':_0x4f302b['path'],'content':withSyncedDisplayName(_0x1875a7,_0x58ea66)};return{'path':_0x4f302b[_0x44aa72(0x1c2)],'content':prependSkillFrontmatter(_0x1875a7,{'name':_0x3ee2b3,'displayName':_0x58ea66,'description':_0x24ff05})};});}function hasYamlFrontmatter(_0x56dbba){const _0x5d1ce9=a141_0x531d;return/^\uFEFF?---\s*\r?\n/[_0x5d1ce9(0x1e0)](_0x56dbba);}function prependSkillFrontmatter(_0xddab23,_0x311a16){const _0x3e3a9d=a141_0x531d,_0x5276a4=_0xddab23[_0x3e3a9d(0x1d6)](/^\uFEFF/,'');return[_0x3e3a9d(0x1cd),'name:\x20'+yamlString(_0x311a16[_0x3e3a9d(0x1c6)]),_0x311a16[_0x3e3a9d(0x1c3)]?'displayName:\x20'+yamlString(_0x311a16[_0x3e3a9d(0x1c3)]):undefined,'description:\x20'+yamlString(_0x311a16['description']),_0x3e3a9d(0x1cd),'',_0x5276a4][_0x3e3a9d(0x1c0)](_0x454737=>_0x454737!==undefined)[_0x3e3a9d(0x1bf)]('\x0a');}function yamlString(_0x4bd52f){const _0x4fe505=a141_0x531d;return JSON[_0x4fe505(0x1c4)](_0x4bd52f[_0x4fe505(0x1d6)](/\r/g,'')['trim']());}function skillDisplayName(_0x39c686,_0x34522c){const _0x3172c5=a141_0x531d,_0x2be58d=_0x39c686[_0x3172c5(0x1ce)]?.[_0x3172c5(0x1cc)]();return _0x2be58d||_0x34522c;}function withSyncedDisplayName(_0x557359,_0x1fe1f9){const _0x15442d=a141_0x531d,_0x2e389a=_0x557359[_0x15442d(0x1cf)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2e389a)return _0x557359;const _0x5763ed=_0x2e389a[0x1]??'',_0xb5cc84=_0x2e389a[0x2]??'',_0x3ec11e=parseDocument(_0xb5cc84);if(_0x3ec11e[_0x15442d(0x1d7)][_0x15442d(0x1ea)]>0x0||!isMap(_0x3ec11e['contents']))return _0x557359;if(_0x1fe1f9)_0x3ec11e['set'](_0x15442d(0x1c3),_0x1fe1f9);else{if(_0x3ec11e[_0x15442d(0x1f1)]('displayName'))_0x3ec11e[_0x15442d(0x1ee)]('displayName');else return _0x557359;}forceBlockCollections(_0x3ec11e[_0x15442d(0x1c5)]);const _0x57c2a3=_0x3ec11e[_0x15442d(0x1c8)]({'lineWidth':0x0})['trimEnd'](),_0x52dde3=_0x557359[_0x15442d(0x1cb)](_0x2e389a[0x0][_0x15442d(0x1ea)])['replace'](/^\r?\n/,'');return _0x5763ed+_0x15442d(0x1e2)+_0x57c2a3+_0x15442d(0x1d5)+_0x52dde3;}function forceBlockCollections(_0x5ba530){if(!isNode(_0x5ba530))return;visit(_0x5ba530,(_0x1dd3e5,_0x567279)=>{const _0x4441d4=a141_0x531d;isCollection(_0x567279)&&(_0x567279[_0x4441d4(0x1bb)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x156d87,_0x21ca33,_0x6d19d6,_0x274adf){const _0x4fc3d0=a141_0x531d;if(_0x274adf||!existsSync(_0x21ca33))return;const _0x46fbbd=readMetadataIfPresent(_0x21ca33);if(!_0x46fbbd)return;const _0x10b54d=_0x46fbbd[_0x4fc3d0(0x1f0)]&&Object[_0x4fc3d0(0x1da)](_0x46fbbd[_0x4fc3d0(0x1f0)])['length']>0x0?_0x46fbbd[_0x4fc3d0(0x1f0)]:undefined;if(_0x10b54d)for(const [_0x598fc2,_0x504c34]of Object[_0x4fc3d0(0x1e9)](_0x10b54d)){const _0x527fe1=resolveManagedFilePath(_0x156d87,_0x598fc2);if(!existsSync(_0x527fe1))throw CliErrors['validation'](_0x4fc3d0(0x1b8)+_0x156d87,_0x4fc3d0(0x1b9)+_0x598fc2);const _0x1fb9d5=lstatSync(_0x527fe1);if(!_0x1fb9d5['isFile']())throw CliErrors[_0x4fc3d0(0x1ec)](_0x4fc3d0(0x1b8)+_0x156d87,_0x4fc3d0(0x1df)+_0x598fc2);const _0x1f9115=bufferSha256(readFileSync(_0x527fe1));if(_0x1f9115!==_0x504c34)throw CliErrors['validation'](_0x4fc3d0(0x1b8)+_0x156d87+_0x4fc3d0(0x1d9)+_0x598fc2,_0x4fc3d0(0x1e3)+_0x598fc2);}else{const _0x225e4e=resolve(_0x156d87,SKILL_FILE);if(existsSync(_0x225e4e)&&_0x46fbbd['contentHash']){const _0x3f31e0=contentHash(readFileSync(_0x225e4e,_0x4fc3d0(0x1ca)));if(_0x3f31e0!==_0x46fbbd[_0x4fc3d0(0x1d0)])throw CliErrors[_0x4fc3d0(0x1ec)](_0x4fc3d0(0x1e7)+_0x225e4e,_0x4fc3d0(0x1c1));}}for(const _0xe5d2c5 of normalizeLocalFiles(_0x6d19d6)){if(_0x10b54d?.[_0xe5d2c5[_0x4fc3d0(0x1c2)]])continue;if(!_0x10b54d&&_0xe5d2c5['path']===SKILL_FILE)continue;const _0x48c553=resolveManagedFilePath(_0x156d87,_0xe5d2c5[_0x4fc3d0(0x1c2)]);if(!existsSync(_0x48c553))continue;const _0x572c5f=lstatSync(_0x48c553);if(!_0x572c5f[_0x4fc3d0(0x1d1)]())throw CliErrors['validation'](_0x4fc3d0(0x1b8)+_0x156d87,_0x4fc3d0(0x1f4)+_0xe5d2c5['path']);const _0x3124a2=bufferSha256(readFileSync(_0x48c553));if(_0x3124a2!==fileHash(_0xe5d2c5))throw CliErrors['validation'](_0x4fc3d0(0x1b8)+_0x156d87,_0x4fc3d0(0x1ed)+_0xe5d2c5[_0x4fc3d0(0x1c2)]);}}function materializeFiles(_0x33f782,_0x42dad2){const _0x247b1b=a141_0x531d;for(const _0x554809 of normalizeLocalFiles(_0x42dad2)){const _0xe7f4c4=resolveManagedFilePath(_0x33f782,_0x554809[_0x247b1b(0x1c2)]);mkdirSync(dirname(_0xe7f4c4),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0xe7f4c4,fileContent(_0x554809),0x180);}}function removeStaleManagedFiles(_0x1d46a7,_0x380829,_0x794816){const _0x788adc=a141_0x531d;if(!_0x380829)return;const _0xc49eb6=new Set(normalizeLocalFiles(_0x794816)['map'](_0x5f3b71=>_0x5f3b71[_0x788adc(0x1c2)]));for(const _0x4f9505 of Object['keys'](_0x380829)){if(_0xc49eb6[_0x788adc(0x1f1)](_0x4f9505))continue;const _0x575ca8=resolveManagedFilePath(_0x1d46a7,_0x4f9505);existsSync(_0x575ca8)&&lstatSync(_0x575ca8)[_0x788adc(0x1d1)]()&&rmSync(_0x575ca8,{'force':!![]});}}
|