@lovrabet/lovrabet-cli 2.1.23 → 2.2.1-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/README.md +13 -10
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.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.d.ts +2 -2
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +2 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.d.ts +2 -0
- package/lib/postinstall.js +1 -0
- 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.d.ts +37 -0
- package/lib/skills/builtin-skill.js +1 -0
- package/lib/skills/npx-skills-add.d.ts +3 -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/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +14 -3
- package/scripts/postinstall.mjs +24 -0
- package/skills/lovrabet/SKILL.md +704 -0
- package/skills/lovrabet/guides/app-resolution.md +165 -0
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +170 -0
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +132 -0
- package/skills/lovrabet/guides/troubleshooting.md +91 -0
- package/skills/lovrabet/references/dataset-discovery-workflow.md +160 -0
- package/skills/lovrabet/references/instant-api-workflow.md +259 -0
- package/skills/lovrabet/references/lovrabet-app-config.md +51 -0
- package/skills/lovrabet/references/lovrabet-app.md +113 -0
- package/skills/lovrabet/references/lovrabet-auth.md +136 -0
- package/skills/lovrabet/references/lovrabet-bff-workflow.md +139 -0
- package/skills/lovrabet/references/lovrabet-config-commands.md +104 -0
- package/skills/lovrabet/references/lovrabet-config.md +124 -0
- package/skills/lovrabet/references/lovrabet-doctor.md +26 -0
- package/skills/lovrabet/references/lovrabet-file-workflow.md +62 -0
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +78 -0
- package/skills/lovrabet/references/lovrabet-logs.md +19 -0
- package/skills/lovrabet/references/lovrabet-ocr-workflow.md +83 -0
- package/skills/lovrabet/references/lovrabet-output-format-jq.md +40 -0
- package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +108 -0
- package/skills/lovrabet/references/lovrabet-schedule-workflow.md +181 -0
- package/skills/lovrabet/references/lovrabet-service-tree.md +279 -0
- package/skills/lovrabet/references/lovrabet-skill-authoring.md +128 -0
- package/skills/lovrabet/references/lovrabet-skill-install.md +34 -0
- package/skills/lovrabet/references/lovrabet-skill-sync.md +146 -0
- package/skills/lovrabet/references/lovrabet-sql-workflow.md +111 -0
- package/skills/lovrabet/references/lovrabet-update.md +34 -0
- package/skills/lovrabet/references/lovrabet-workspace.md +82 -0
- package/skills/lovrabet.manifest.json +38 -0
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5c58fd,_0x36eef0){const _0x43b024=a94_0x4577,_0x4e025a=_0x5c58fd();while(!![]){try{const _0x5951e4=parseInt(_0x43b024(0x109))/0x1+parseInt(_0x43b024(0xec))/0x2+parseInt(_0x43b024(0xd0))/0x3*(-parseInt(_0x43b024(0xd7))/0x4)+-parseInt(_0x43b024(0xe5))/0x5*(-parseInt(_0x43b024(0xdf))/0x6)+-parseInt(_0x43b024(0xda))/0x7*(parseInt(_0x43b024(0xc9))/0x8)+-parseInt(_0x43b024(0xca))/0x9+parseInt(_0x43b024(0xd8))/0xa*(parseInt(_0x43b024(0xf0))/0xb);if(_0x5951e4===_0x36eef0)break;else _0x4e025a['push'](_0x4e025a['shift']());}catch(_0xfa6c51){_0x4e025a['push'](_0x4e025a['shift']());}}}(a94_0x1e2b,0x1c6a8));import{runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../constant/product.js';import{isNonInteractiveMode,readAppCodeFromConfig}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{getApiDomain}from'../constant/domain.js';import{buildConfirmationLines,reconstructCommandArgv}from'../framework/runner-confirmation.js';import{mapUserFacingExecuteError}from'../framework/runner-error.js';import{assertKnownCommandFlags}from'../framework/raw-flags.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';import{findAppByCode,findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../commands/app/eligibility.js';export function resolveAuthMode(_0x98a372){const _0x117dc3=a94_0x4577;return void _0x98a372,AUTH_MODE[_0x117dc3(0xe4)];}let sdkClientInitialized=![];export function createPipelineEnv(_0x37fb53,_0x2df8f0){const _0x162ba4=a94_0x4577,_0x2c0641=typeof _0x2df8f0['app']===_0x162ba4(0x107)&&_0x2df8f0[_0x162ba4(0xe3)][_0x162ba4(0xe2)]();return{'rawFlags':_0x2df8f0,'appCode':_0x37fb53['appCode']||productEnv(_0x162ba4(0xcd))||(_0x2c0641?undefined:readAppCodeFromConfig()),'appCodeSource':_0x37fb53[_0x162ba4(0xc8)],'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x2df8f0),'defaultFormat':_0x37fb53['format'],'defaultPageSize':_0x37fb53['pageSize'],'defaultVerbose':_0x37fb53[_0x162ba4(0x103)],'riskLevel':_0x37fb53[_0x162ba4(0xed)],'accessKey':_0x37fb53[_0x162ba4(0x104)],'env':_0x37fb53[_0x162ba4(0xd5)],'mergedCli':{'defaultApp':_0x37fb53[_0x162ba4(0xf1)],'currentApp':_0x37fb53['currentApp'],'appCode':_0x37fb53['appCode']}};}export function createLovrabetRunnerAdapter(_0x295cf3={}){const _0x5b1d58=a94_0x4577,_0x5bb302={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[_0x5b1d58(0xd4)](_0x2bce59=>PIPELINE_FLAG_NAMES[_0x5b1d58(0xfb)](_0x2bce59['name']))[_0x5b1d58(0x10a)](({name:_0x5a22b3,type:_0x1f2432,description:_0x11fb14})=>({'name':_0x5a22b3,'type':_0x1f2432,'description':_0x11fb14})),'formatOutput':_0x295cf3[_0x5b1d58(0xfa)]??formatOutput,'getCommandLabel'(_0x3e4f36){const _0x528de7=_0x5b1d58;return CLI_BIN_NAME+'\x20'+_0x3e4f36[_0x528de7(0x101)]+'\x20'+_0x3e4f36[_0x528de7(0xd6)];},'riskPolicy':{'onViolation'(_0x4e7ab7){const _0x2bc532=_0x5b1d58;console[_0x2bc532(0xdc)](_0x4e7ab7);},'createError'(_0x5e4a57){const _0x15ee93=_0x5b1d58;return CliErrors[_0x15ee93(0xcc)](_0x5e4a57);}},async 'prepare'(_0x229e45,_0x51db54){const _0x41b44a=_0x5b1d58,_0x144986=resolveAuthMode(_0x51db54);if(_0x229e45[_0x41b44a(0xf4)]!==![]){if(!_0x51db54[_0x41b44a(0x104)])throw CliErrors[_0x41b44a(0xf2)](_0x41b44a(0x102)+PRODUCT_CONFIG['newConfigFileName']+_0x41b44a(0xd9)+productEnvName('ACCESS_KEY')+'.');const {setActiveAK:_0x2b00c4}=await import(_0x41b44a(0xe1));_0x2b00c4(_0x51db54[_0x41b44a(0x104)]);}let _0x180c6f='';if(_0x229e45['requiresAppCode']!==![]){_0x180c6f=_0x51db54['appCode']??'',_0x180c6f=await resolveExplicitAppName(_0x229e45,_0x51db54,_0x180c6f);if(!_0x180c6f){await assertSelectedAppNameIsRuntimeAccessible(_0x229e45,_0x51db54);throw CliErrors[_0x41b44a(0xcb)](_0x41b44a(0xcf)+PRODUCT_CONFIG[_0x41b44a(0xd2)]+'.');}await assertAppCodeIsRuntimeAccessible(_0x229e45,_0x51db54,_0x180c6f);}if(_0x180c6f){const {initSdkClient:_0x369a85}=await import(_0x41b44a(0xf7));_0x369a85({'appCode':_0x180c6f,'env':_0x51db54[_0x41b44a(0xd5)]??_0x41b44a(0xdd),'accessKey':_0x51db54[_0x41b44a(0x104)],'authMode':_0x144986}),sdkClientInitialized=!![];}return{'defaults':{'booleans':{'verbose':_0x51db54[_0x41b44a(0x106)]},'numbers':{'pagesize':_0x51db54[_0x41b44a(0x108)]}},'extras':{'appCode':_0x180c6f,'cookie':'','apiDomain':_0x51db54['apiDomain'],'apiDir':'','accessKey':_0x51db54[_0x41b44a(0x104)],'envName':_0x51db54['env'],'mergedCli':_0x51db54['mergedCli']}};},'confirmHighRisk':_0x295cf3[_0x5b1d58(0xef)]??(async({def:_0x3df037,env:_0x47d562,flags:_0xa451c1,commandLabel:_0x51f2a3})=>{const _0x3eaa6f=_0x5b1d58;if(_0x47d562[_0x3eaa6f(0xea)]){const _0x3ebbaa=reconstructCommandArgv(_0x3df037,_0xa451c1);throw CliErrors[_0x3eaa6f(0xde)]('High-risk\x20operation\x20`'+_0x51f2a3+_0x3eaa6f(0xfe)+('\x20\x20To\x20proceed:\x20'+_0x3ebbaa));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x3df037,_0x51f2a3,_0xa451c1),'createCancelledError':_0x527ce4=>CliErrors['cancelled'](_0x527ce4)});}),'mapDryRunError'(_0x5216c8){return mapUserFacingExecuteError(_0x5216c8);},'mapExecuteError'(_0x236056){return mapUserFacingExecuteError(_0x236056);},async 'finalize'(){await finalizeLovrabetRuntimeState();}};return _0x5bb302;}const terminalRunnerAdapter=createLovrabetRunnerAdapter();export async function finalizeLovrabetRuntimeState(){const _0x9ccacc=a94_0x4577;try{if(sdkClientInitialized){const {clearSdkClient:_0x405968}=await import('../core/sdk-client.js');_0x405968();}}finally{sdkClientInitialized=![];const {clearActiveAK:_0x3a09fa}=await import(_0x9ccacc(0xe1));_0x3a09fa();}}async function resolveExplicitAppName(_0xa8d603,_0x383665,_0xc2e4c4){const _0x5505aa=a94_0x4577;if(_0xa8d603[_0x5505aa(0xe9)]===![])return _0xc2e4c4;const _0x449612=typeof _0x383665[_0x5505aa(0x100)][_0x5505aa(0xe3)]===_0x5505aa(0x107)?_0x383665[_0x5505aa(0x100)][_0x5505aa(0xe3)][_0x5505aa(0xe2)]():'';if(!_0x449612)return _0xc2e4c4;const _0x116c4f=typeof _0x383665['rawFlags']['appcode']===_0x5505aa(0x107)&&_0x383665['rawFlags'][_0x5505aa(0xe6)][_0x5505aa(0xe2)]()||productEnv('APPCODE');if(_0x116c4f||_0x383665[_0x5505aa(0xc8)]===_0x5505aa(0xf3))return _0xc2e4c4;const {getRemoteAppList:_0x43672b}=await import('../commands/app/remote-source.js'),_0x5de988=await _0x43672b({'env':_0x383665[_0x5505aa(0xd5)]??_0x5505aa(0xdd),'accessKey':_0x383665[_0x5505aa(0x104)]}),_0xe452a2=findAppByName(_0x5de988[_0x5505aa(0xee)],_0x449612);if(_0xe452a2&&!isRuntimeAccessibleApp(_0xe452a2))throw runtimeInaccessibleAppError(_0xe452a2,'\x22'+_0x449612+'\x22');const _0xf2cf22=_0xe452a2?.[_0x5505aa(0xe0)]?.['trim']();if(_0xf2cf22)return _0xf2cf22;throw CliErrors[_0x5505aa(0xde)](_0x5505aa(0xfd)+_0x449612,'Run\x20`'+CLI_BIN_NAME+_0x5505aa(0xf8)+_0x449612+'.appcode\x20to\x20'+PRODUCT_CONFIG[_0x5505aa(0xd2)]+'.');}function a94_0x1e2b(){const _0x4a437f=['requiresAuth','doctor','_notice','../core/sdk-client.js','\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20add\x20apps.','../commands/app/remote-source.js','formatOutput','has','update','Unknown\x20app:\x20','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a','pretty','rawFlags','service','Set\x20accessKey\x20in\x20','verbose','accessKey','includes','defaultVerbose','string','defaultPageSize','160618CaOhea','map','nonInteractive','appCodeSource','45808iNEnkJ','1482021KirWAt','configMissing','cancelled','APPCODE','mergedCli','Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20','27CZeoxi','currentApp','newConfigFileName','resolve','filter','env','command','98772OFVoSK','2742340YiSBqI','\x20or\x20pass\x20','21lVZwDB','execute','error','production','validation','6KycWFX','appCode','../core/api-client.js','trim','app','ClientAk','105065xYhomN','appcode','object','format','requiresAppCode','isNonInteractive','schema','129222EoqyTO','riskLevel','items','confirmHighRisk','11UMLYKm','defaultApp','authRequired','local-alias'];a94_0x1e2b=function(){return _0x4a437f;};return a94_0x1e2b();}async function assertSelectedAppNameIsRuntimeAccessible(_0x22d4aa,_0x42f811){const _0x8eb7c1=a94_0x4577;if(_0x22d4aa[_0x8eb7c1(0xe9)]===![]||!_0x42f811[_0x8eb7c1(0x104)])return;const _0x4eb0cc=(typeof _0x42f811[_0x8eb7c1(0x100)][_0x8eb7c1(0xe3)]===_0x8eb7c1(0x107)&&_0x42f811[_0x8eb7c1(0x100)][_0x8eb7c1(0xe3)][_0x8eb7c1(0xe2)]()?_0x42f811['rawFlags']['app']:_0x42f811[_0x8eb7c1(0xce)]?.[_0x8eb7c1(0xd1)]??_0x42f811[_0x8eb7c1(0xce)]?.[_0x8eb7c1(0xf1)])?.[_0x8eb7c1(0xe2)]();if(!_0x4eb0cc)return;const {getRemoteAppList:_0x2d1a9f}=await import(_0x8eb7c1(0xf9)),_0x1c1b7d=await _0x2d1a9f({'env':_0x42f811['env']??_0x8eb7c1(0xdd),'accessKey':_0x42f811[_0x8eb7c1(0x104)]}),_0x3699ef=findAppByName(_0x1c1b7d['items'],_0x4eb0cc);if(_0x3699ef&&!isRuntimeAccessibleApp(_0x3699ef))throw runtimeInaccessibleAppError(_0x3699ef,'\x22'+_0x4eb0cc+'\x22');}async function assertAppCodeIsRuntimeAccessible(_0x34c238,_0x25a41b,_0x142b20){const _0x3bc8c0=a94_0x4577;if(_0x34c238[_0x3bc8c0(0xe9)]===![]||!_0x25a41b[_0x3bc8c0(0x104)])return;const {getRemoteAppList:_0x5ab2ea}=await import('../commands/app/remote-source.js'),_0x213c59=await _0x5ab2ea({'env':_0x25a41b[_0x3bc8c0(0xd5)]??'production','accessKey':_0x25a41b['accessKey']}),_0x31961d=findAppByCode(_0x213c59[_0x3bc8c0(0xee)],_0x142b20);if(_0x31961d&&!isRuntimeAccessibleApp(_0x31961d))throw runtimeInaccessibleAppError(_0x31961d,'appcode\x20\x22'+_0x142b20+'\x22');}export async function runCommand(_0x35a855,_0x362e17,_0x5c5d5b=terminalRunnerAdapter){const _0x2abda9=a94_0x4577;assertKnownCommandFlags(_0x35a855,_0x362e17[_0x2abda9(0x100)]),await runCommandWithAdapter(shouldAttachUpdateNotice(_0x35a855)?withUpdateNotice(_0x35a855):_0x35a855,_0x362e17,_0x5c5d5b);}function shouldAttachUpdateNotice(_0x8c7b20){const _0x19cdf0=a94_0x4577;return![_0x19cdf0(0xfc),_0x19cdf0(0xeb),_0x19cdf0(0xf5)][_0x19cdf0(0x105)](_0x8c7b20[_0x19cdf0(0x101)]);}function withUpdateNotice(_0x4c0989){return{..._0x4c0989,async 'execute'(_0xeebd4d){const _0x31ee20=a94_0x4577,_0x5a81c1=shouldResolveUpdateNotice(_0xeebd4d)?resolveLatestUpdateNotice()['catch'](()=>null):Promise[_0x31ee20(0xd3)](null),_0x2c829e=await _0x4c0989[_0x31ee20(0xdb)](_0xeebd4d);return attachUpdateNotice(_0x2c829e,await _0x5a81c1);}};}function shouldResolveUpdateNotice(_0x5033e5){const _0x4d5888=a94_0x4577;return _0x5033e5[_0x4d5888(0xe8)]===_0x4d5888(0xff)&&!_0x5033e5[_0x4d5888(0xc7)];}function a94_0x4577(_0xb46737,_0x2b9442){_0xb46737=_0xb46737-0xc7;const _0x1e2b10=a94_0x1e2b();let _0x4577a3=_0x1e2b10[_0xb46737];return _0x4577a3;}function attachUpdateNotice(_0x8823d9,_0x16ad16){const _0x536b19=a94_0x4577;if(!_0x16ad16||!_0x8823d9||typeof _0x8823d9!==_0x536b19(0xe7))return _0x8823d9;const _0x159a11=_0x8823d9,_0x507d9f=typeof _0x159a11[_0x536b19(0xf6)]==='object'&&_0x159a11[_0x536b19(0xf6)]!==null?_0x159a11[_0x536b19(0xf6)]:{};return{..._0x159a11,'_notice':{..._0x507d9f,'update':_0x16ad16}};}
|
|
1
|
+
(function(_0x5f373b,_0x56c275){const _0x1cd61f=a94_0x567b,_0x239cdc=_0x5f373b();while(!![]){try{const _0xdb7711=parseInt(_0x1cd61f(0x1c9))/0x1*(-parseInt(_0x1cd61f(0x1cb))/0x2)+parseInt(_0x1cd61f(0x1db))/0x3*(-parseInt(_0x1cd61f(0x1e6))/0x4)+-parseInt(_0x1cd61f(0x1e1))/0x5+parseInt(_0x1cd61f(0x1f6))/0x6+parseInt(_0x1cd61f(0x1d9))/0x7*(-parseInt(_0x1cd61f(0x1fd))/0x8)+parseInt(_0x1cd61f(0x1f0))/0x9*(-parseInt(_0x1cd61f(0x1ea))/0xa)+-parseInt(_0x1cd61f(0x1c7))/0xb*(-parseInt(_0x1cd61f(0x1dd))/0xc);if(_0xdb7711===_0x56c275)break;else _0x239cdc['push'](_0x239cdc['shift']());}catch(_0x4d25d9){_0x239cdc['push'](_0x239cdc['shift']());}}}(a94_0x3bf0,0x419d6));import{runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';function a94_0x567b(_0x2809ef,_0xf14381){_0x2809ef=_0x2809ef-0x1b9;const _0x3bf016=a94_0x3bf0();let _0x567b2c=_0x3bf016[_0x2809ef];return _0x567b2c;}import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../constant/product.js';import{isNonInteractiveMode,readAppCodeFromConfig}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{getApiDomain}from'../constant/domain.js';import{buildConfirmationLines,reconstructCommandArgv}from'../framework/runner-confirmation.js';import{mapUserFacingExecuteError}from'../framework/runner-error.js';import{assertKnownCommandFlags}from'../framework/raw-flags.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';import{findAppByCode,findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../commands/app/eligibility.js';export function resolveAuthMode(_0x4e25fb){const _0x100c68=a94_0x567b;return void _0x4e25fb,AUTH_MODE[_0x100c68(0x1f2)];}let sdkClientInitialized=![];export function createPipelineEnv(_0x581956,_0x337641){const _0x1d66a1=a94_0x567b,_0xfb2287=typeof _0x337641[_0x1d66a1(0x1d8)]===_0x1d66a1(0x1cd)&&_0x337641[_0x1d66a1(0x1d8)]['trim']();return{'rawFlags':_0x337641,'appCode':_0x581956[_0x1d66a1(0x1ce)]||productEnv('APPCODE')||(_0xfb2287?undefined:readAppCodeFromConfig()),'appCodeSource':_0x581956[_0x1d66a1(0x1f1)],'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x337641),'defaultFormat':_0x581956[_0x1d66a1(0x1c2)],'defaultPageSize':_0x581956[_0x1d66a1(0x1c0)],'defaultVerbose':_0x581956[_0x1d66a1(0x1d4)],'riskLevel':_0x581956[_0x1d66a1(0x1f4)],'accessKey':_0x581956[_0x1d66a1(0x1ff)],'env':_0x581956[_0x1d66a1(0x1da)],'mergedCli':{'defaultApp':_0x581956[_0x1d66a1(0x1e5)],'currentApp':_0x581956['currentApp'],'appCode':_0x581956[_0x1d66a1(0x1ce)]}};}export function createLovrabetRunnerAdapter(_0x54b160={}){const _0x3aeb80=a94_0x567b,_0x501114={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[_0x3aeb80(0x1c8)](_0x524cf1=>PIPELINE_FLAG_NAMES['has'](_0x524cf1[_0x3aeb80(0x1f9)]))[_0x3aeb80(0x1e2)](({name:_0x27fe68,type:_0x3db636,description:_0x1b0006})=>({'name':_0x27fe68,'type':_0x3db636,'description':_0x1b0006})),'formatOutput':_0x54b160[_0x3aeb80(0x1c1)]??formatOutput,'getCommandLabel'(_0x29ed1e){const _0x1bb351=_0x3aeb80;return CLI_BIN_NAME+'\x20'+_0x29ed1e[_0x1bb351(0x1dc)]+'\x20'+_0x29ed1e[_0x1bb351(0x1e7)];},'riskPolicy':{'onViolation'(_0x4c6e0c){const _0x5b7250=_0x3aeb80;console[_0x5b7250(0x1d2)](_0x4c6e0c);},'createError'(_0x2c786f){const _0x57fc64=_0x3aeb80;return CliErrors[_0x57fc64(0x1bf)](_0x2c786f);}},async 'prepare'(_0xd87fa0,_0x419734){const _0x1cab60=_0x3aeb80,_0x1762f5=resolveAuthMode(_0x419734);if(_0xd87fa0[_0x1cab60(0x200)]!==![]){if(!_0x419734['accessKey'])throw CliErrors[_0x1cab60(0x1e0)](_0x1cab60(0x1d0)+PRODUCT_CONFIG[_0x1cab60(0x1ba)]+_0x1cab60(0x201)+productEnvName(_0x1cab60(0x1f7))+'.');const {setActiveAK:_0x103683}=await import(_0x1cab60(0x1d1));_0x103683(_0x419734[_0x1cab60(0x1ff)]);}let _0x4943a7='';if(_0xd87fa0[_0x1cab60(0x1fa)]!==![]){_0x4943a7=_0x419734[_0x1cab60(0x1ce)]??'',_0x4943a7=await resolveExplicitAppName(_0xd87fa0,_0x419734,_0x4943a7);if(!_0x4943a7){await assertSelectedAppNameIsRuntimeAccessible(_0xd87fa0,_0x419734);throw CliErrors[_0x1cab60(0x1d3)](_0x1cab60(0x1e4)+PRODUCT_CONFIG['newConfigFileName']+'.');}await assertAppCodeIsRuntimeAccessible(_0xd87fa0,_0x419734,_0x4943a7);}if(_0x4943a7){const {initSdkClient:_0x522025}=await import(_0x1cab60(0x1c5));_0x522025({'appCode':_0x4943a7,'env':_0x419734[_0x1cab60(0x1da)]??_0x1cab60(0x1fe),'accessKey':_0x419734[_0x1cab60(0x1ff)],'authMode':_0x1762f5}),sdkClientInitialized=!![];}return{'defaults':{'booleans':{'verbose':_0x419734['defaultVerbose']},'numbers':{'pagesize':_0x419734[_0x1cab60(0x1bb)]}},'extras':{'appCode':_0x4943a7,'cookie':'','apiDomain':_0x419734[_0x1cab60(0x1d5)],'apiDir':'','accessKey':_0x419734[_0x1cab60(0x1ff)],'envName':_0x419734['env'],'mergedCli':_0x419734[_0x1cab60(0x1df)]}};},'confirmHighRisk':_0x54b160[_0x3aeb80(0x1c4)]??(async({def:_0x474324,env:_0x3b50ff,flags:_0x297a15,commandLabel:_0x5069f7})=>{const _0x5c923b=_0x3aeb80;if(_0x3b50ff[_0x5c923b(0x1e8)]){const _0x34a63b=reconstructCommandArgv(_0x474324,_0x297a15);throw CliErrors[_0x5c923b(0x1bc)](_0x5c923b(0x1ec)+_0x5069f7+'`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a'+(_0x5c923b(0x1d6)+_0x34a63b));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x474324,_0x5069f7,_0x297a15),'createCancelledError':_0xdfdcb1=>CliErrors[_0x5c923b(0x1bf)](_0xdfdcb1)});}),'mapDryRunError'(_0x4d12c2){return mapUserFacingExecuteError(_0x4d12c2);},'mapExecuteError'(_0x13def7){return mapUserFacingExecuteError(_0x13def7);},async 'finalize'(){await finalizeLovrabetRuntimeState();}};return _0x501114;}const terminalRunnerAdapter=createLovrabetRunnerAdapter();export async function finalizeLovrabetRuntimeState(){const _0x583572=a94_0x567b;try{if(sdkClientInitialized){const {clearSdkClient:_0x3e0430}=await import(_0x583572(0x1c5));_0x3e0430();}}finally{sdkClientInitialized=![];const {clearActiveAK:_0x19a856}=await import(_0x583572(0x1d1));_0x19a856();}}async function resolveExplicitAppName(_0x152328,_0x5bed70,_0x21871c){const _0x3d9456=a94_0x567b;if(_0x152328['requiresAppCode']===![])return _0x21871c;const _0x536cca=typeof _0x5bed70[_0x3d9456(0x1e9)][_0x3d9456(0x1d8)]===_0x3d9456(0x1cd)?_0x5bed70['rawFlags'][_0x3d9456(0x1d8)][_0x3d9456(0x1fb)]():'';if(!_0x536cca)return _0x21871c;const _0x5ebb05=typeof _0x5bed70['rawFlags'][_0x3d9456(0x1de)]===_0x3d9456(0x1cd)&&_0x5bed70['rawFlags'][_0x3d9456(0x1de)][_0x3d9456(0x1fb)]()||productEnv(_0x3d9456(0x1ed));if(_0x5ebb05||_0x5bed70[_0x3d9456(0x1f1)]===_0x3d9456(0x1eb))return _0x21871c;const {getRemoteAppList:_0xa8882b}=await import(_0x3d9456(0x1f8)),_0x1b1e20=await _0xa8882b({'env':_0x5bed70[_0x3d9456(0x1da)]??_0x3d9456(0x1fe),'accessKey':_0x5bed70[_0x3d9456(0x1ff)]}),_0x477601=findAppByName(_0x1b1e20[_0x3d9456(0x1fc)],_0x536cca);if(_0x477601&&!isRuntimeAccessibleApp(_0x477601))throw runtimeInaccessibleAppError(_0x477601,'\x22'+_0x536cca+'\x22');const _0x69e269=_0x477601?.[_0x3d9456(0x1ce)]?.[_0x3d9456(0x1fb)]();if(_0x69e269)return _0x69e269;throw CliErrors[_0x3d9456(0x1bc)]('Unknown\x20app:\x20'+_0x536cca,_0x3d9456(0x1e3)+CLI_BIN_NAME+_0x3d9456(0x1cc)+_0x536cca+_0x3d9456(0x1f5)+PRODUCT_CONFIG['newConfigFileName']+'.');}async function assertSelectedAppNameIsRuntimeAccessible(_0x5ecd1a,_0x5d3622){const _0x312d13=a94_0x567b;if(_0x5ecd1a[_0x312d13(0x1fa)]===![]||!_0x5d3622['accessKey'])return;const _0x21e57f=(typeof _0x5d3622[_0x312d13(0x1e9)][_0x312d13(0x1d8)]===_0x312d13(0x1cd)&&_0x5d3622[_0x312d13(0x1e9)][_0x312d13(0x1d8)]['trim']()?_0x5d3622[_0x312d13(0x1e9)][_0x312d13(0x1d8)]:_0x5d3622['mergedCli']?.['currentApp']??_0x5d3622[_0x312d13(0x1df)]?.[_0x312d13(0x1e5)])?.[_0x312d13(0x1fb)]();if(!_0x21e57f)return;const {getRemoteAppList:_0x2e4838}=await import(_0x312d13(0x1f8)),_0x580137=await _0x2e4838({'env':_0x5d3622[_0x312d13(0x1da)]??_0x312d13(0x1fe),'accessKey':_0x5d3622['accessKey']}),_0x342641=findAppByName(_0x580137['items'],_0x21e57f);if(_0x342641&&!isRuntimeAccessibleApp(_0x342641))throw runtimeInaccessibleAppError(_0x342641,'\x22'+_0x21e57f+'\x22');}async function assertAppCodeIsRuntimeAccessible(_0x5c5b3c,_0x3b0acd,_0x1b5259){const _0x23175b=a94_0x567b;if(_0x5c5b3c['requiresAppCode']===![]||!_0x3b0acd[_0x23175b(0x1ff)])return;const {getRemoteAppList:_0x38121f}=await import(_0x23175b(0x1f8)),_0x183b2f=await _0x38121f({'env':_0x3b0acd[_0x23175b(0x1da)]??_0x23175b(0x1fe),'accessKey':_0x3b0acd['accessKey']}),_0x1eeb11=findAppByCode(_0x183b2f['items'],_0x1b5259);if(_0x1eeb11&&!isRuntimeAccessibleApp(_0x1eeb11))throw runtimeInaccessibleAppError(_0x1eeb11,_0x23175b(0x1b9)+_0x1b5259+'\x22');}export async function runCommand(_0x4c631e,_0x38e1e0,_0x46d8c2=terminalRunnerAdapter){const _0x4d378e=a94_0x567b;assertKnownCommandFlags(_0x4c631e,_0x38e1e0[_0x4d378e(0x1e9)]),await runCommandWithAdapter(shouldAttachUpdateNotice(_0x4c631e)?withUpdateNotice(_0x4c631e):_0x4c631e,_0x38e1e0,_0x46d8c2);}function a94_0x3bf0(){const _0x23b9e8=['Set\x20accessKey\x20in\x20','../core/api-client.js','error','configMissing','verbose','apiDomain','\x20\x20To\x20proceed:\x20','update','app','13958NDGoyn','env','3xEsziE','service','12wMjSRg','appcode','mergedCli','authRequired','37445EQsSrt','map','Run\x20`','Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20','defaultApp','851204IifNCM','command','isNonInteractive','rawFlags','20110fGYOYF','local-alias','High-risk\x20operation\x20`','APPCODE','doctor','includes','2205sMGuET','appCodeSource','ClientAk','object','riskLevel','.appcode\x20to\x20','2746278KOsrWH','ACCESS_KEY','../commands/app/remote-source.js','name','requiresAppCode','trim','items','440BpDbMj','production','accessKey','requiresAuth','\x20or\x20pass\x20','appcode\x20\x22','newConfigFileName','defaultPageSize','validation','_notice','catch','cancelled','pageSize','formatOutput','format','execute','confirmHighRisk','../core/sdk-client.js','resolve','10337217EuHvwa','filter','1JceySF','schema','612094zAfLNK','\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20add\x20apps.','string','appCode','pretty'];a94_0x3bf0=function(){return _0x23b9e8;};return a94_0x3bf0();}function shouldAttachUpdateNotice(_0x33382d){const _0x3c4ab6=a94_0x567b;return![_0x3c4ab6(0x1d7),_0x3c4ab6(0x1ca),_0x3c4ab6(0x1ee)][_0x3c4ab6(0x1ef)](_0x33382d['service']);}function withUpdateNotice(_0x472e18){return{..._0x472e18,async 'execute'(_0x4e1486){const _0x5c7b6b=a94_0x567b,_0x59f79c=shouldResolveUpdateNotice(_0x4e1486)?resolveLatestUpdateNotice()[_0x5c7b6b(0x1be)](()=>null):Promise[_0x5c7b6b(0x1c6)](null),_0x8bcb79=await _0x472e18[_0x5c7b6b(0x1c3)](_0x4e1486);return attachUpdateNotice(_0x8bcb79,await _0x59f79c);}};}function shouldResolveUpdateNotice(_0x39bda1){const _0x4596d9=a94_0x567b;return _0x39bda1['format']===_0x4596d9(0x1cf)&&!_0x39bda1['nonInteractive'];}function attachUpdateNotice(_0x9e6e5b,_0x1f6c1a){const _0x227862=a94_0x567b;if(!_0x1f6c1a||!_0x9e6e5b||typeof _0x9e6e5b!==_0x227862(0x1f3))return _0x9e6e5b;const _0x100c50=_0x9e6e5b,_0x195f6f=typeof _0x100c50['_notice']===_0x227862(0x1f3)&&_0x100c50[_0x227862(0x1bd)]!==null?_0x100c50[_0x227862(0x1bd)]:{};return{..._0x100c50,'_notice':{..._0x195f6f,'update':_0x1f6c1a}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x108f9e,_0x42e10b){const _0x37a074=a95_0x5c37,_0x530e1c=_0x108f9e();while(!![]){try{const _0x327f43=parseInt(_0x37a074(0x157))/0x1*(parseInt(_0x37a074(0x158))/0x2)+parseInt(_0x37a074(0x153))/0x3*(parseInt(_0x37a074(0x165))/0x4)+-parseInt(_0x37a074(0x15d))/0x5*(-parseInt(_0x37a074(0x156))/0x6)+parseInt(_0x37a074(0x159))/0x7*(-parseInt(_0x37a074(0x163))/0x8)+-parseInt(_0x37a074(0x15f))/0x9*(parseInt(_0x37a074(0x15a))/0xa)+-parseInt(_0x37a074(0x155))/0xb*(parseInt(_0x37a074(0x154))/0xc)+parseInt(_0x37a074(0x15c))/0xd;if(_0x327f43===_0x42e10b)break;else _0x530e1c['push'](_0x530e1c['shift']());}catch(_0x421bf3){_0x530e1c['push'](_0x530e1c['shift']());}}}(a95_0xb620,0x92050));function a95_0xb620(){const _0x1e5aa8=['5247359cfQBeX','20eReHAO','commands','27963UfkZux','none','services','auth','120PBwVmU','../commands/registry.js','12UGBMgA','service','has','required','370797ikSJzd','54384OweefY','1078OpOSit','1721766aeWwmM','789iLqrzn','22AQRSXu','113155BJeXuG','2080YKWOLb','map'];a95_0xb620=function(){return _0x1e5aa8;};return a95_0xb620();}import{buildSchemaPayload as a95_0x4dc7ca}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{findDynamicServiceDefinition,listDynamicServiceEntries}from'../commands/service/dynamic.js';import{insertDynamicServicesAfterServiceTree}from'../framework/service-order.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{getCliGitCommit,getCliVersion}from'../utils/version.js';export async function buildSchemaPayload(){const _0x2fc614=a95_0x5c37,{serviceRegistry:_0x5d72ad,findDefinition:_0x22bc3c}=await import(_0x2fc614(0x164)),_0x1d073f=new Set(_0x5d72ad[_0x2fc614(0x15b)](_0x2584ff=>_0x2584ff['service'])),_0x88140=listDynamicServiceEntries()['filter'](_0x5f1530=>!_0x1d073f[_0x2fc614(0x151)](_0x5f1530[_0x2fc614(0x150)])),_0x2d0fd6=a95_0x4dc7ca({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'cliVersion':getCliVersion(),'gitCommit':getCliGitCommit(),'globalFlags':GLOBAL_FLAGS,'serviceRegistry':insertDynamicServicesAfterServiceTree(_0x5d72ad,_0x88140),'buildAllFlags':buildAllFlags,'findDefinition':(_0x1c2645,_0x3115ef)=>_0x22bc3c(_0x1c2645,_0x3115ef)??findDynamicServiceDefinition(_0x1c2645,_0x3115ef)});return normalizeSchemaPayload(_0x2d0fd6);}function normalizeSchemaPayload(_0x17a008){const _0x59baa8=a95_0x5c37;return{..._0x17a008,'schemaVersion':0x2,'services':_0x17a008[_0x59baa8(0x161)]['map'](_0x4737ed=>({..._0x4737ed,'commands':_0x4737ed[_0x59baa8(0x15e)]['map'](normalizeSchemaCommand)}))};}function a95_0x5c37(_0x441fb4,_0x470598){_0x441fb4=_0x441fb4-0x150;const _0xb6209d=a95_0xb620();let _0x5c3767=_0xb6209d[_0x441fb4];return _0x5c3767;}function normalizeSchemaCommand(_0xc7e087){const _0x4d8c80=a95_0x5c37,_0x2d80c7=_0xc7e087;return{..._0xc7e087,'auth':_0x2d80c7[_0x4d8c80(0x162)]??(_0xc7e087['requiresAuth']?_0x4d8c80(0x152):_0x4d8c80(0x160))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a96_0x42ec(){const _0x5ec7a4=['18218niYYlU','317982fVISIS','slice','1304107vELnFS','findIndex','76500SewtdR','4976896SnFjpS','14428271HIeyQE','661390AyTYWt','service','length','340IkmXiv','18IEdDAQ','4dnchcf','61PpVghR'];a96_0x42ec=function(){return _0x5ec7a4;};return a96_0x42ec();}(function(_0x3f672c,_0x1216d2){const _0x274ac8=a96_0x390c,_0x27f394=_0x3f672c();while(!![]){try{const _0x3dd872=parseInt(_0x274ac8(0x12b))/0x1*(parseInt(_0x274ac8(0x12c))/0x2)+parseInt(_0x274ac8(0x12d))/0x3+-parseInt(_0x274ac8(0x12a))/0x4*(-parseInt(_0x274ac8(0x125))/0x5)+-parseInt(_0x274ac8(0x129))/0x6*(-parseInt(_0x274ac8(0x12f))/0x7)+parseInt(_0x274ac8(0x132))/0x8+-parseInt(_0x274ac8(0x131))/0x9*(parseInt(_0x274ac8(0x128))/0xa)+-parseInt(_0x274ac8(0x133))/0xb;if(_0x3dd872===_0x1216d2)break;else _0x27f394['push'](_0x27f394['shift']());}catch(_0x465963){_0x27f394['push'](_0x27f394['shift']());}}}(a96_0x42ec,0x5b603));function a96_0x390c(_0x2241ba,_0x320d0b){_0x2241ba=_0x2241ba-0x125;const _0x42ec2f=a96_0x42ec();let _0x390ca0=_0x42ec2f[_0x2241ba];return _0x390ca0;}export function insertDynamicServicesAfterServiceTree(_0x247247,_0x271a7a){const _0x285a63=a96_0x390c;if(_0x271a7a[_0x285a63(0x127)]===0x0)return[..._0x247247];const _0x3e0a05=_0x247247[_0x285a63(0x130)](_0x18046d=>_0x18046d[_0x285a63(0x126)]===_0x285a63(0x126));if(_0x3e0a05<0x0)return[..._0x247247,..._0x271a7a];return[..._0x247247[_0x285a63(0x12e)](0x0,_0x3e0a05+0x1),..._0x271a7a,..._0x247247[_0x285a63(0x12e)](_0x3e0a05+0x1)];}
|
package/lib/framework/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x473fb8,_0xefad56){var _0x52b816=a97_0x4f79,_0x5673bf=_0x473fb8();while(!![]){try{var _0x307597=parseInt(_0x52b816(0x1b9))/0x1+-parseInt(_0x52b816(0x1bf))/0x2*(-parseInt(_0x52b816(0x1bd))/0x3)+parseInt(_0x52b816(0x1b7))/0x4*(-parseInt(_0x52b816(0x1b6))/0x5)+parseInt(_0x52b816(0x1be))/0x6*(-parseInt(_0x52b816(0x1bc))/0x7)+parseInt(_0x52b816(0x1b5))/0x8*(parseInt(_0x52b816(0x1c0))/0x9)+parseInt(_0x52b816(0x1b8))/0xa+-parseInt(_0x52b816(0x1bb))/0xb*(parseInt(_0x52b816(0x1ba))/0xc);if(_0x307597===_0xefad56)break;else _0x5673bf['push'](_0x5673bf['shift']());}catch(_0x5ab847){_0x5673bf['push'](_0x5673bf['shift']());}}}(a97_0x5186,0xeb4b3));function a97_0x5186(){var _0x4efa86=['477kANVju','270376AuXfGB','8151655dUTQPh','4BirCEm','8300460KvToXU','1726926Yeqnof','2358876UpjeuC','11bairDQ','5677063KmvNSR','48354PWXuvi','12cYAgEl','8pnqPCs'];a97_0x5186=function(){return _0x4efa86;};return a97_0x5186();}function a97_0x4f79(_0x1a2321,_0x650a29){_0x1a2321=_0x1a2321-0x1b5;var _0x518644=a97_0x5186();var _0x4f79bc=_0x518644[_0x1a2321];return _0x4f79bc;}export{riskLevelOrder,normalizeLegacyOutputFormat,isValidFormat}from'@lovrabet/cli-framework';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "2.1.
|
|
2
|
-
export declare const GIT_TAG = "v2.1.
|
|
3
|
-
export declare const GIT_COMMIT = "
|
|
4
|
-
export declare const BUILD_TIME = "2026-08-
|
|
1
|
+
export declare const VERSION = "2.2.1-beta.1";
|
|
2
|
+
export declare const GIT_TAG = "v2.2.1-beta.1";
|
|
3
|
+
export declare const GIT_COMMIT = "9cf6cc6";
|
|
4
|
+
export declare const BUILD_TIME = "2026-08-12T09:16:00.092Z";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a98_0xead6(_0xa94595,_0x5925ec){_0xa94595=_0xa94595-0x1c9;const _0x45780f=a98_0x4578();let _0xead669=_0x45780f[_0xa94595];return _0xead669;}const a98_0x4de752=a98_0xead6;(function(_0x45aa5f,_0x116f08){const _0x484e32=a98_0xead6,_0x4f967f=_0x45aa5f();while(!![]){try{const _0x4ce9e9=-parseInt(_0x484e32(0x1cd))/0x1*(-parseInt(_0x484e32(0x1d1))/0x2)+-parseInt(_0x484e32(0x1d0))/0x3+parseInt(_0x484e32(0x1ca))/0x4*(parseInt(_0x484e32(0x1d3))/0x5)+parseInt(_0x484e32(0x1d2))/0x6+-parseInt(_0x484e32(0x1cc))/0x7+parseInt(_0x484e32(0x1d4))/0x8+-parseInt(_0x484e32(0x1cb))/0x9;if(_0x4ce9e9===_0x116f08)break;else _0x4f967f['push'](_0x4f967f['shift']());}catch(_0x5da066){_0x4f967f['push'](_0x4f967f['shift']());}}}(a98_0x4578,0x85719));export const VERSION=a98_0x4de752(0x1cf);export const GIT_TAG=a98_0x4de752(0x1c9);export const GIT_COMMIT='9cf6cc6';function a98_0x4578(){const _0x3de96b=['98174MQgsvT','2026-08-12T09:16:00.092Z','2.2.1-beta.1','868737cVsvbH','10AFYAoQ','1872576PjLenx','2290445xqzpxm','154856dDedRI','v2.2.1-beta.1','8qGHfcQ','1567971optITK','5096826strWIi'];a98_0x4578=function(){return _0x3de96b;};return a98_0x4578();}export const BUILD_TIME=a98_0x4de752(0x1ce);
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x184730,_0xe9d881){const _0x16b2f2=a99_0x443f,_0xff3620=_0x184730();while(!![]){try{const _0x8654ed=-parseInt(_0x16b2f2(0xe5))/0x1+parseInt(_0x16b2f2(0xe0))/0x2*(parseInt(_0x16b2f2(0xe6))/0x3)+-parseInt(_0x16b2f2(0xde))/0x4*(parseInt(_0x16b2f2(0xe3))/0x5)+parseInt(_0x16b2f2(0xe1))/0x6+parseInt(_0x16b2f2(0xe4))/0x7*(parseInt(_0x16b2f2(0xdf))/0x8)+-parseInt(_0x16b2f2(0xe2))/0x9+-parseInt(_0x16b2f2(0xe7))/0xa;if(_0x8654ed===_0xe9d881)break;else _0xff3620['push'](_0xff3620['shift']());}catch(_0xec07d6){_0xff3620['push'](_0xff3620['shift']());}}}(a99_0x4670,0x84718));import{jsx as a99_0x13d99e,jsxs as a99_0x5f56ed}from'react/jsx-runtime';function a99_0x4670(){const _0x113c56=['15585cvoYdK','2621950urvzMW','green','\x20\x20Use\x20','85116iswDBV','10328kPBKjL','302alNfac','4187124DHcuzw','2405448ACwSUN','75fqpjzh','2947VeDDZk','634670XFDseD'];a99_0x4670=function(){return _0x113c56;};return a99_0x4670();}import{useEffect}from'react';function a99_0x443f(_0x5d86e9,_0x5a8a63){_0x5d86e9=_0x5d86e9-0xdd;const _0x46701f=a99_0x4670();let _0x443f6e=_0x46701f[_0x5d86e9];return _0x443f6e;}import{Box,Text,useApp}from'ink';import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'./constant/cli.js';export function Help(){const _0x1bdd0c=a99_0x443f,{exit:_0x17e615}=useApp();return useEffect(()=>{_0x17e615();},[_0x17e615]),a99_0x5f56ed(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a99_0x13d99e(Box,{'children':a99_0x13d99e(Text,{'bold':!![],'color':_0x1bdd0c(0xe8),'children':'\x20\x20'+CLI_DISPLAY_NAME})}),a99_0x5f56ed(Box,{'marginTop':0x1,'children':[a99_0x13d99e(Text,{'dimColor':!![],'children':_0x1bdd0c(0xdd)}),a99_0x13d99e(Text,{'bold':!![],'color':_0x1bdd0c(0xe8),'children':CLI_BIN_NAME+'\x20--help'}),a99_0x13d99e(Text,{'dimColor':!![],'children':'\x20to\x20view\x20available\x20commands.'})]})]});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x50c0f4,_0x204393){const _0x57dd46=a100_0x22df,_0x8b1be8=_0x50c0f4();while(!![]){try{const _0x4b0bbc=-parseInt(_0x57dd46(0xf0))/0x1+-parseInt(_0x57dd46(0xff))/0x2*(parseInt(_0x57dd46(0xe8))/0x3)+parseInt(_0x57dd46(0xf3))/0x4+-parseInt(_0x57dd46(0xfe))/0x5+parseInt(_0x57dd46(0xef))/0x6+parseInt(_0x57dd46(0xf9))/0x7*(-parseInt(_0x57dd46(0xf2))/0x8)+parseInt(_0x57dd46(0xfd))/0x9*(parseInt(_0x57dd46(0xf6))/0xa);if(_0x4b0bbc===_0x204393)break;else _0x8b1be8['push'](_0x8b1be8['shift']());}catch(_0x36dd47){_0x8b1be8['push'](_0x8b1be8['shift']());}}}(a100_0x3666,0x6a681));import{installBuiltinSkill}from'./skills/builtin-skill.js';export async function runPostinstall(_0x36bbda={}){const _0x221fc2=a100_0x22df,_0x23f9cb=installBuiltinSkill(_0x36bbda);if(_0x23f9cb['ok']){const _0x215bd9=_0x23f9cb[_0x221fc2(0xf1)]?_0x221fc2(0xed):'already\x20current',_0x3b0146=_0x23f9cb['installedPath']?'\x20at\x20'+_0x23f9cb[_0x221fc2(0xee)]:_0x221fc2(0xf7);return console[_0x221fc2(0xf4)](_0x221fc2(0xf5)+_0x23f9cb[_0x221fc2(0xe7)]+'\x20'+_0x215bd9+_0x3b0146),_0x23f9cb;}const _0x4d1cef=_0x221fc2(0xec)+(_0x23f9cb['code']??'FAILED')+']\x20'+(_0x23f9cb[_0x221fc2(0xfc)]??_0x221fc2(0xfb))+'.\x20'+(_0x221fc2(0xea)+_0x23f9cb[_0x221fc2(0xe9)]);if(_0x23f9cb[_0x221fc2(0xf8)]===_0x221fc2(0xfa))throw new Error(_0x4d1cef);return console[_0x221fc2(0xeb)](_0x4d1cef),_0x23f9cb;}function a100_0x22df(_0x4ed80c,_0x5cc374){_0x4ed80c=_0x4ed80c-0xe7;const _0x366615=a100_0x3666();let _0x22df50=_0x366615[_0x4ed80c];return _0x22df50;}function a100_0x3666(){const _0x358889=['changed','26264uNXHCK','266872szFPUV','log','Lovrabet\x20Built-in\x20Skill\x20','40guHowH','\x20via\x20skills@latest','code','1708aUCXBQ','SOURCE_INVALID','Installation\x20failed','error','5820408NkXaTP','3905690uolbZN','340PXcBMY','skillVersion','7539RbzFGu','repairCommand','Repair\x20with:\x20','warn','[BUILTIN_SKILL_INSTALL_','installed','installedPath','3858372UNWQzM','851387uLqqeH'];a100_0x3666=function(){return _0x358889;};return a100_0x3666();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a101_0x42d0(_0x5a7f6f,_0x55fd9f){_0x5a7f6f=_0x5a7f6f-0xef;const _0x318c64=a101_0x318c();let _0x42d048=_0x318c64[_0x5a7f6f];return _0x42d048;}(function(_0x5a6dec,_0x3352d2){const _0x1ba2d7=a101_0x42d0,_0x2b3f9c=_0x5a6dec();while(!![]){try{const _0x1289cf=parseInt(_0x1ba2d7(0xf8))/0x1*(-parseInt(_0x1ba2d7(0xfd))/0x2)+parseInt(_0x1ba2d7(0xf6))/0x3*(-parseInt(_0x1ba2d7(0x103))/0x4)+-parseInt(_0x1ba2d7(0x101))/0x5*(-parseInt(_0x1ba2d7(0xf2))/0x6)+parseInt(_0x1ba2d7(0xf5))/0x7*(parseInt(_0x1ba2d7(0xf9))/0x8)+parseInt(_0x1ba2d7(0xf7))/0x9+parseInt(_0x1ba2d7(0x102))/0xa+-parseInt(_0x1ba2d7(0xf3))/0xb*(parseInt(_0x1ba2d7(0xfe))/0xc);if(_0x1289cf===_0x3352d2)break;else _0x2b3f9c['push'](_0x2b3f9c['shift']());}catch(_0x21093b){_0x2b3f9c['push'](_0x2b3f9c['shift']());}}}(a101_0x318c,0xd681d));const DESCRIPTION_MAX_LENGTH=0x1f4;export function buildLovrabetConfirmationRequest(_0x43b78d,_0x4bae5e,_0x48398a){const _0x1ea711=a101_0x42d0,_0x1b4ad3=normalizeText(_0x43b78d[_0x1ea711(0xf4)],DESCRIPTION_MAX_LENGTH),_0x250140=normalizeText(_0x43b78d[_0x1ea711(0xfa)],DESCRIPTION_MAX_LENGTH);return{'operation':_0x4bae5e,'risk':requireWriteRisk(_0x43b78d),'description':_0x1b4ad3||_0x250140||'执行该写入操作',..._0x48398a?{'signal':_0x48398a}:{}};}function requireWriteRisk(_0x22135d){const _0xa82aa0=a101_0x42d0;if(_0x22135d[_0xa82aa0(0xf0)]===_0xa82aa0(0x100)||_0x22135d[_0xa82aa0(0xf0)]===_0xa82aa0(0x104))return _0x22135d['risk'];throw new Error(_0xa82aa0(0xf1));}function normalizeText(_0x23456b,_0x378df2){const _0x3df1f0=a101_0x42d0;if(typeof _0x23456b!==_0x3df1f0(0xef))return'';return _0x23456b[_0x3df1f0(0xfc)](/[\u0000-\u001f\u007f]+/g,'\x20')[_0x3df1f0(0xfc)](/\s+/g,'\x20')[_0x3df1f0(0xff)]()[_0x3df1f0(0xfb)](0x0,_0x378df2);}function a101_0x318c(){const _0x26ac67=['8bdXdKl','description','slice','replace','918WmimqS','1805172HRMNqE','trim','write','3475515GHnDLl','7570280MIFFnw','4sDWAiw','high-risk-write','string','risk','Lovrabet\x20confirmation\x20requires\x20a\x20write\x20command.','12qOULyJ','55aQhwmP','confirmationDescription','10149727YVtjQG','5026596JXzPNk','7222059AzuMAi','2382JrVeZP'];a101_0x318c=function(){return _0x26ac67;};return a101_0x318c();}
|
package/lib/runtime/event.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a102_0x1585(_0x5e2c32,_0x426a6f){_0x5e2c32=_0x5e2c32-0x106;const _0x2e3291=a102_0x2e32();let _0x158525=_0x2e3291[_0x5e2c32];return _0x158525;}(function(_0x48ef3a,_0x5829c9){const _0x3e2283=a102_0x1585,_0x1e8065=_0x48ef3a();while(!![]){try{const _0x586093=-parseInt(_0x3e2283(0x106))/0x1*(-parseInt(_0x3e2283(0x10c))/0x2)+parseInt(_0x3e2283(0x10f))/0x3+parseInt(_0x3e2283(0x10b))/0x4*(-parseInt(_0x3e2283(0x110))/0x5)+parseInt(_0x3e2283(0x117))/0x6*(-parseInt(_0x3e2283(0x111))/0x7)+parseInt(_0x3e2283(0x10a))/0x8+-parseInt(_0x3e2283(0x114))/0x9+-parseInt(_0x3e2283(0x113))/0xa;if(_0x586093===_0x5829c9)break;else _0x1e8065['push'](_0x1e8065['shift']());}catch(_0x3c6aca){_0x1e8065['push'](_0x1e8065['shift']());}}}(a102_0x2e32,0x5062a));export function canonicalLovrabetOperation(_0x1ca29d){const _0x435ed4=a102_0x1585;return[_0x1ca29d[_0x435ed4(0x112)],..._0x1ca29d[_0x435ed4(0x116)][_0x435ed4(0x115)]()['split'](/\s+/)][_0x435ed4(0x10d)](Boolean)[_0x435ed4(0x109)]('.');}function a102_0x2e32(){const _0x18a4be=['582NnJnup','write','7257aYEDsK','high-risk-write','risk','join','5155160VzwYod','778108smPlKQ','56cEGmUg','filter','lovrabet.write.completed','1653159LOttZk','10AYYqYI','2744Vtkkqh','service','2328370PjobJC','3685239xUfPUn','trim','command'];a102_0x2e32=function(){return _0x18a4be;};return a102_0x2e32();}export function createLovrabetWriteMetadata(_0x2cc4c6,_0x13b627,_0x38536b,_0x4b1073){const _0x5cf40c=a102_0x1585;if(_0x4b1073||_0x38536b['ok']!==!![]||_0x2cc4c6[_0x5cf40c(0x108)]!==_0x5cf40c(0x118)&&_0x2cc4c6[_0x5cf40c(0x108)]!==_0x5cf40c(0x107))return undefined;const _0x3743a3=_0x2cc4c6['writeEventSubject']?.(_0x38536b),_0x573954={'type':_0x5cf40c(0x10e),'operation':_0x13b627,'risk':_0x2cc4c6[_0x5cf40c(0x108)],..._0x3743a3?{'subject':_0x3743a3}:{}};return{'lovrabet':{'schemaVersion':0x1,'event':_0x573954}};}
|
package/lib/runtime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3acc1f,_0x4897d0){const _0x2dc183=a103_0x173b,_0x32dc8a=_0x3acc1f();while(!![]){try{const _0x2650cd=parseInt(_0x2dc183(0x10f))/0x1+-parseInt(_0x2dc183(0x10e))/0x2*(-parseInt(_0x2dc183(0x115))/0x3)+-parseInt(_0x2dc183(0xf1))/0x4*(-parseInt(_0x2dc183(0xfd))/0x5)+parseInt(_0x2dc183(0x111))/0x6*(-parseInt(_0x2dc183(0x101))/0x7)+-parseInt(_0x2dc183(0xf3))/0x8*(-parseInt(_0x2dc183(0x104))/0x9)+parseInt(_0x2dc183(0xfc))/0xa*(-parseInt(_0x2dc183(0xf5))/0xb)+parseInt(_0x2dc183(0x107))/0xc*(-parseInt(_0x2dc183(0xf8))/0xd);if(_0x2650cd===_0x4897d0)break;else _0x32dc8a['push'](_0x32dc8a['shift']());}catch(_0x597eb2){_0x32dc8a['push'](_0x32dc8a['shift']());}}}(a103_0xbbae,0xaccdf));import{buildConfigFromFlags,initGlobalEnvironment}from'../context.js';function a103_0x173b(_0x56dc9f,_0x292aa8){_0x56dc9f=_0x56dc9f-0xf1;const _0xbbaece=a103_0xbbae();let _0x173b81=_0xbbaece[_0x56dc9f];return _0x173b81;}function a103_0xbbae(){const _0x50d46c=['presentation','stringify','present','rawFlags','args','1412iTJUWD','863831mnbVIV','Lovrabet\x20invocation\x20completed\x20without\x20a\x20captured\x20command\x20result.','11910YXsNJc','confirm','message','data','4725nGNUBQ','write','1916WHYtct','definition','46832fZrWqh','result','989098Rurbbv','risk','aborted','62153xtpDMO','riskLevel','Embedded\x20Lovrabet\x20confirmation\x20must\x20run\x20inside\x20execute.','reason','120gTsNIE','11925ipRjqR','format','dryRun','isNonInteractive','1687LyVuJU','execute','command','585oAHLJj','yes','high-risk-write','3096NgbMEM','Lovrabet\x20invocation\x20aborted.'];a103_0xbbae=function(){return _0x50d46c;};return a103_0xbbae();}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:_0x12a17d,command:_0x1d7fee,risk:_0x5e59cf,dryRun:_0x2c17d6}){const _0x336870=a103_0x173b;return JSON[_0x336870(0x10a)]({'ok':_0x12a17d['ok'],'command':_0x1d7fee,'risk':_0x5e59cf,..._0x2c17d6?{'dryRun':!![]}:{},..._0x12a17d[_0x336870(0x114)]!==undefined?{'data':_0x12a17d[_0x336870(0x114)]}:{},..._0x12a17d[_0x336870(0x113)]?{'message':_0x12a17d[_0x336870(0x113)]}:{}});}};export async function invokeLovrabet(_0x1f48dc,_0x128cf0){const _0x1087cf=a103_0x173b;throwIfAborted(_0x128cf0['signal']);const _0x51aa15=await resolveLovrabetInvocation(_0x1f48dc),_0x3202aa=canonicalLovrabetOperation(_0x51aa15[_0x1087cf(0xf2)]);return await confirmWriteBeforeQueue(_0x51aa15[_0x1087cf(0xf2)],_0x51aa15['rawFlags'],_0x3202aa,_0x128cf0),runSerialized(async()=>{const _0x356067=_0x1087cf;throwIfAborted(_0x128cf0['signal']);const _0x1b0a59={},_0xfeab6f=buildConfigFromFlags(_0x51aa15[_0x356067(0x10c)]);await initGlobalEnvironment(_0xfeab6f);const _0x5b2747=createPipelineEnv(_0xfeab6f,{..._0x51aa15[_0x356067(0x10c)],'yes':_0x51aa15[_0x356067(0xf2)][_0x356067(0xf6)]===_0x356067(0x106)?!![]:_0x51aa15[_0x356067(0x10c)][_0x356067(0x105)],'nonInteractive':!![]});_0x5b2747[_0x356067(0x10d)]=_0x51aa15[_0x356067(0x10d)],_0x5b2747[_0x356067(0x100)]=!![],_0x5b2747[_0x356067(0xf9)]='high-risk-write';const _0x3ebfc1=withAbortSignal(_0x51aa15[_0x356067(0xf2)],_0x128cf0['signal']),_0x4e2082=createLovrabetRunnerAdapter({'formatOutput'(_0x18d7d3,_0x8d52cb){const _0x55573f=_0x356067;_0x1b0a59[_0x55573f(0xf4)]=_0x18d7d3,_0x1b0a59[_0x55573f(0x103)]=_0x8d52cb[_0x55573f(0x103)],_0x1b0a59[_0x55573f(0xf6)]=_0x8d52cb['risk'],_0x1b0a59[_0x55573f(0xfe)]=_0x8d52cb[_0x55573f(0xfe)],_0x1b0a59[_0x55573f(0xff)]=_0x8d52cb['dryRun']===!![];},async 'confirmHighRisk'(){const _0x8c9ec4=_0x356067;throw new Error(_0x8c9ec4(0xfa));}});try{await runCommand(_0x3ebfc1,_0x5b2747,_0x4e2082);if(!_0x1b0a59[_0x356067(0xf4)]||!_0x1b0a59[_0x356067(0x103)]||!_0x1b0a59[_0x356067(0xf6)]||!_0x1b0a59['format'])throw new Error(_0x356067(0x110));const _0x4950a5=_0x128cf0[_0x356067(0x109)]??defaultPresentation,_0x14791b=_0x1b0a59[_0x356067(0xff)]===!![],_0x5081d8={'result':_0x1b0a59[_0x356067(0xf4)],'command':_0x1b0a59['command'],'operation':_0x3202aa,'risk':_0x1b0a59[_0x356067(0xf6)],'format':_0x1b0a59[_0x356067(0xfe)],'dryRun':_0x14791b},_0x5b6728=createLovrabetWriteMetadata(_0x51aa15[_0x356067(0xf2)],_0x3202aa,_0x1b0a59[_0x356067(0xf4)],_0x14791b);let _0x393632;try{_0x393632=await _0x4950a5[_0x356067(0x10b)](_0x5081d8);}catch(_0x3b8376){if(!_0x5b6728||_0x4950a5===defaultPresentation)throw _0x3b8376;_0x393632=await defaultPresentation[_0x356067(0x10b)](_0x5081d8);}return{'operation':_0x3202aa,'risk':_0x1b0a59[_0x356067(0xf6)],'mode':_0x14791b?'dry-run':_0x356067(0x102),'result':_0x1b0a59[_0x356067(0xf4)],'output':_0x393632,..._0x5b6728?{'metadata':_0x5b6728}:{}};}finally{await finalizeLovrabetRuntimeState();}});}async function confirmWriteBeforeQueue(_0x13f53e,_0x35a01c,_0x42b255,_0xbc4716){const _0x5f50ff=a103_0x173b;if(_0x35a01c[_0x5f50ff(0xff)]===!![]||_0x13f53e[_0x5f50ff(0xf6)]!==_0x5f50ff(0x116)&&_0x13f53e[_0x5f50ff(0xf6)]!==_0x5f50ff(0x106))return;await _0xbc4716['confirmation'][_0x5f50ff(0x112)](buildLovrabetConfirmationRequest(_0x13f53e,_0x42b255,_0xbc4716['signal']));}function withAbortSignal(_0x2f84,_0x46c460){return{..._0x2f84,async 'execute'(_0x28fdf1){return throwIfAborted(_0x46c460),_0x2f84['execute'](_0x28fdf1);}};}function throwIfAborted(_0x1213f2){const _0x499e8d=a103_0x173b;if(_0x1213f2?.[_0x499e8d(0xf7)])throw _0x1213f2[_0x499e8d(0xfb)]instanceof Error?_0x1213f2[_0x499e8d(0xfb)]:new DOMException(_0x499e8d(0x108),'AbortError');}
|
package/lib/runtime/queue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3e343d,_0x25cdde){const _0x107d0d=a104_0x396f,_0xa7ae2e=_0x3e343d();while(!![]){try{const _0x511d06=-parseInt(_0x107d0d(0x18e))/0x1+-parseInt(_0x107d0d(0x18b))/0x2+parseInt(_0x107d0d(0x18f))/0x3*(-parseInt(_0x107d0d(0x18a))/0x4)+-parseInt(_0x107d0d(0x190))/0x5+-parseInt(_0x107d0d(0x191))/0x6+-parseInt(_0x107d0d(0x192))/0x7*(-parseInt(_0x107d0d(0x189))/0x8)+-parseInt(_0x107d0d(0x18c))/0x9*(-parseInt(_0x107d0d(0x193))/0xa);if(_0x511d06===_0x25cdde)break;else _0xa7ae2e['push'](_0xa7ae2e['shift']());}catch(_0x1bd5f5){_0xa7ae2e['push'](_0xa7ae2e['shift']());}}}(a104_0x3f56,0x299ed));let tail=Promise['resolve']();export async function runSerialized(_0x282a39){const _0x108517=a104_0x396f,_0x6fe79c=tail;let _0x222265;tail=new Promise(_0x3dfab8=>{_0x222265=_0x3dfab8;}),await _0x6fe79c[_0x108517(0x18d)](()=>undefined);try{return await _0x282a39();}finally{_0x222265();}}function a104_0x396f(_0xfc7a45,_0x54b048){_0xfc7a45=_0xfc7a45-0x189;const _0x3f56c8=a104_0x3f56();let _0x396f92=_0x3f56c8[_0xfc7a45];return _0x396f92;}function a104_0x3f56(){const _0x1e4f1e=['637105zmCYSb','681354oRtKXe','1169588MLXdPX','3220PlmQqv','8WzfHAQ','321892xXpCUr','19544iMrpHL','12456IprXox','catch','111030rqxDPq','3haFGbX'];a104_0x3f56=function(){return _0x1e4f1e;};return a104_0x3f56();}
|
package/lib/runtime/resolve.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a105_0x52ab(_0x205db2,_0x2ccbfc){_0x205db2=_0x205db2-0xb1;const _0x4f4b2b=a105_0x4f4b();let _0x52abbc=_0x4f4b2b[_0x205db2];return _0x52abbc;}(function(_0x1fb9f7,_0x39a236){const _0x4daf15=a105_0x52ab,_0x1a2714=_0x1fb9f7();while(!![]){try{const _0x196941=-parseInt(_0x4daf15(0xc6))/0x1+parseInt(_0x4daf15(0xbf))/0x2+-parseInt(_0x4daf15(0xb2))/0x3*(-parseInt(_0x4daf15(0xc2))/0x4)+parseInt(_0x4daf15(0xc4))/0x5+parseInt(_0x4daf15(0xbb))/0x6*(-parseInt(_0x4daf15(0xc5))/0x7)+-parseInt(_0x4daf15(0xb1))/0x8+parseInt(_0x4daf15(0xc1))/0x9*(-parseInt(_0x4daf15(0xb9))/0xa);if(_0x196941===_0x39a236)break;else _0x1a2714['push'](_0x1a2714['shift']());}catch(_0xb8afdd){_0x1a2714['push'](_0x1a2714['shift']());}}}(a105_0x4f4b,0x615ce));import a105_0x47106b from'meow';import{findDefinition,getServiceEntry,isKnownService,resolveRemovedCommand}from'../commands/registry.js';function a105_0x4f4b(){const _0x5c265d=['../commands/registry.js','379010aEENed','7VAHTza','14386ZbWhAD','defaultCommand','2440552FunXvW','3dFaHtY','input','flags','unknownCommand','hint','Lovrabet\x20argv\x20must\x20include\x20a\x20service\x20and\x20command.','validation','5290blpwIm','Lovrabet\x20argv\x20must\x20include\x20a\x20command\x20for\x20service\x20\x22','195144vfSZFd','../framework/preparse.js','assign','flatMap','1070086uRHJXH','join','9999LlnFrj','2910604NVJnKZ'];a105_0x4f4b=function(){return _0x5c265d;};return a105_0x4f4b();}import{resolveDynamicServiceCommand}from'../commands/service/dynamic.js';import{buildMeowFlags}from'../constant/cli.js';import{CliErrors}from'../errors.js';export async function resolveLovrabetInvocation(_0x12f7e2){const _0x3a9ff6=a105_0x52ab,_0x374625=a105_0x47106b('',{'importMeta':import.meta,'argv':_0x12f7e2,'flags':buildMeowFlags(),'autoHelp':![],'autoVersion':![]}),_0x2cddd1=[..._0x374625[_0x3a9ff6(0xb3)]],_0x39b514=_0x374625[_0x3a9ff6(0xb4)];await correctFlags(_0x39b514);const _0x406ca8=_0x2cddd1[0x0];if(!_0x406ca8)throw CliErrors[_0x3a9ff6(0xb8)](_0x3a9ff6(0xb7));const _0x2b7fa7=resolveRemovedCommand(_0x406ca8,_0x2cddd1[0x1]);if(_0x2b7fa7)throw CliErrors['validation'](_0x2b7fa7['message'],_0x2b7fa7[_0x3a9ff6(0xb6)]);if(!isKnownService(_0x406ca8)){const _0x4fc2af=resolveDynamicServiceCommand(_0x2cddd1,_0x39b514);if(!_0x4fc2af)throw CliErrors[_0x3a9ff6(0xb5)](_0x2cddd1[_0x3a9ff6(0xc0)]('\x20'));return Object[_0x3a9ff6(0xbd)](_0x39b514,_0x4fc2af[_0x3a9ff6(0xb4)]),{'definition':_0x4fc2af['definition'],'rawFlags':_0x39b514,'args':_0x4fc2af['args']};}const _0x3c50c3=getServiceEntry(_0x406ca8),_0x6b1de5=_0x2cddd1[0x1]||_0x3c50c3[_0x3a9ff6(0xc7)];if(!_0x6b1de5)throw CliErrors[_0x3a9ff6(0xb8)](_0x3a9ff6(0xba)+_0x406ca8+'\x22.');const _0x34559f=findDefinition(_0x406ca8,_0x6b1de5);if(!_0x34559f)throw CliErrors[_0x3a9ff6(0xb5)](_0x406ca8+'\x20'+_0x6b1de5);return{'definition':_0x34559f,'rawFlags':_0x39b514,'args':_0x2cddd1['slice'](0x2)};}async function correctFlags(_0x2c4e2c){const _0x290d37=a105_0x52ab;try{const {correctFlags:_0x4f5903}=await import(_0x290d37(0xbc)),{getAllDefinitions:_0xd8c326}=await import(_0x290d37(0xc3)),_0x2e7f5d=_0xd8c326()[_0x290d37(0xbe)](_0x691dac=>_0x691dac[_0x290d37(0xb4)]??[]),_0x1abc07=_0x4f5903(_0x2c4e2c,_0x2e7f5d);Object['assign'](_0x2c4e2c,_0x1abc07[_0x290d37(0xb4)]);}catch{}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type BuiltinSkillState = "missing" | "current" | "version_mismatch" | "content_mismatch" | "unverifiable";
|
|
2
|
+
export type BuiltinSkillInstallCode = "SOURCE_INVALID" | "INSTALL_FAILED" | "VERIFY_FAILED";
|
|
3
|
+
export interface BuiltinSkillOptions {
|
|
4
|
+
packageRoot?: string;
|
|
5
|
+
home?: string;
|
|
6
|
+
stdio?: "inherit" | "pipe";
|
|
7
|
+
}
|
|
8
|
+
export interface BuiltinSkillStatus {
|
|
9
|
+
state: BuiltinSkillState;
|
|
10
|
+
packageVersion: string;
|
|
11
|
+
skillVersion?: string;
|
|
12
|
+
installedPath?: string;
|
|
13
|
+
digest?: string;
|
|
14
|
+
reason?: string;
|
|
15
|
+
repairCommand: string;
|
|
16
|
+
}
|
|
17
|
+
export interface BuiltinSkillInstallResult {
|
|
18
|
+
ok: boolean;
|
|
19
|
+
code?: BuiltinSkillInstallCode;
|
|
20
|
+
packageVersion: string;
|
|
21
|
+
skillVersion: string;
|
|
22
|
+
installedPath?: string;
|
|
23
|
+
changed: boolean;
|
|
24
|
+
repairCommand: string;
|
|
25
|
+
error?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface InstalledBuiltinSkillVersionStatus {
|
|
28
|
+
state: "current" | "missing" | "version_mismatch" | "unverifiable";
|
|
29
|
+
expectedVersion: string;
|
|
30
|
+
skillVersion?: string;
|
|
31
|
+
installedPath?: string;
|
|
32
|
+
reason?: string;
|
|
33
|
+
repairCommand: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function inspectInstalledBuiltinSkillVersion(expectedVersion: string, options?: Pick<BuiltinSkillOptions, "home">): InstalledBuiltinSkillVersionStatus;
|
|
36
|
+
export declare function inspectBuiltinSkill(options?: BuiltinSkillOptions): BuiltinSkillStatus;
|
|
37
|
+
export declare function installBuiltinSkill(options?: BuiltinSkillOptions): BuiltinSkillInstallResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a107_0x5685(){const _0x2a298b=['skipped','SKILL.md','match','schemaVersion','reason','4598280sBdMIb','installedPath','every','Symbolic\x20link\x20is\x20not\x20allowed:\x20','home','254vzyDws','trim','SOURCE_INVALID','VERIFY_FAILED','3077204EwaUZn','root','16413HwNbUh','isDirectory','isFile','state','split','INSTALL_FAILED','digest','1115585fOFPMH','version','length','utf8','914011YAosHA','Unsupported\x20Skill\x20entry:\x20','package.json','unknown','packageVersion','22985433HQDwFh','2029122TpmicW','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','includes','flatMap','missing','update','manifest','skills@latest\x20exited\x20','absent','content_mismatch','pipe','skills','hex','parse','7Zzgevn','message','stdio','path','version_mismatch','unverifiable','present','lovrabet','startsWith',':\x5cs*(.+)$','isSymbolicLink','Installed\x20Skill\x20state\x20is\x20','current','skillVersion'];a107_0x5685=function(){return _0x2a298b;};return a107_0x5685();}const a107_0x56990e=a107_0x477a;(function(_0x1de834,_0x277d7c){const _0x31b96f=a107_0x477a,_0xfc1492=_0x1de834();while(!![]){try{const _0x17367e=-parseInt(_0x31b96f(0xf0))/0x1+parseInt(_0x31b96f(0xdf))/0x2*(-parseInt(_0x31b96f(0xe5))/0x3)+-parseInt(_0x31b96f(0xe3))/0x4+parseInt(_0x31b96f(0xec))/0x5+-parseInt(_0x31b96f(0xf6))/0x6+-parseInt(_0x31b96f(0x104))/0x7*(-parseInt(_0x31b96f(0x117))/0x8)+parseInt(_0x31b96f(0xf5))/0x9;if(_0x17367e===_0x277d7c)break;else _0xfc1492['push'](_0xfc1492['shift']());}catch(_0x331771){_0xfc1492['push'](_0xfc1492['shift']());}}}(a107_0x5685,0x9b283));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME=a107_0x56990e(0x10b);function frontmatterValue(_0x5ea751,_0x339343){const _0x2b9a06=a107_0x56990e;return _0x5ea751[_0x2b9a06(0x114)](new RegExp('^'+_0x339343+_0x2b9a06(0x10d),'m'))?.[0x1]?.[_0x2b9a06(0xe0)]()??'';}function listFiles(_0x5b0728,_0x22c7a3=_0x5b0728){const _0x3e2bb5=a107_0x56990e;return readdirSync(_0x22c7a3,{'withFileTypes':!![]})[_0x3e2bb5(0xf9)](_0x2e0408=>{const _0x36d20a=_0x3e2bb5,_0x4de5e9=join(_0x22c7a3,_0x2e0408['name']),_0x53ec64=lstatSync(_0x4de5e9);if(_0x53ec64[_0x36d20a(0x10e)]())throw new Error(_0x36d20a(0xdd)+_0x4de5e9);if(_0x53ec64[_0x36d20a(0xe6)]())return listFiles(_0x5b0728,_0x4de5e9);if(!_0x53ec64[_0x36d20a(0xe7)]())throw new Error(_0x36d20a(0xf1)+_0x4de5e9);return[relative(_0x5b0728,_0x4de5e9)['split'](sep)['join']('/')];})['sort']((_0x43bdda,_0x44d4ea)=>_0x43bdda<_0x44d4ea?-0x1:_0x43bdda>_0x44d4ea?0x1:0x0);}function a107_0x477a(_0x5b91c1,_0x58b3bc){_0x5b91c1=_0x5b91c1-0xdb;const _0x5685f4=a107_0x5685();let _0x477a68=_0x5685f4[_0x5b91c1];return _0x477a68;}function digestFiles(_0x46f0f0,_0x3cf0ee){const _0x30781c=a107_0x56990e,_0x95c636=createHash('sha256');for(const _0x59772b of _0x3cf0ee){if(_0x59772b[_0x30781c(0x10c)]('/')||_0x59772b[_0x30781c(0xe9)]('/')[_0x30781c(0xf8)]('..')||_0x59772b[_0x30781c(0xf8)]('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x59772b);_0x95c636[_0x30781c(0xfb)](_0x59772b),_0x95c636['update']('\x00'),_0x95c636[_0x30781c(0xfb)](readFileSync(join(_0x46f0f0,..._0x59772b[_0x30781c(0xe9)]('/')))),_0x95c636['update']('\x00');}return _0x95c636[_0x30781c(0xeb)](_0x30781c(0x102));}function sameFiles(_0x407f7e,_0x10bff0){const _0x188d77=a107_0x56990e;return _0x407f7e[_0x188d77(0xee)]===_0x10bff0[_0x188d77(0xee)]&&_0x407f7e[_0x188d77(0xdc)]((_0x10871a,_0x13f00c)=>_0x10871a===_0x10bff0[_0x13f00c]);}function readSource(_0x3b923a){const _0x2b8f3c=a107_0x56990e,_0x1c129a=JSON[_0x2b8f3c(0x103)](readFileSync(join(_0x3b923a,_0x2b8f3c(0xf2)),'utf8')),_0x5f4e9a=JSON[_0x2b8f3c(0x103)](readFileSync(join(_0x3b923a,_0x2b8f3c(0x101),'lovrabet.manifest.json'),'utf8')),_0x31a0cd=join(_0x3b923a,_0x2b8f3c(0x101),SKILL_NAME),_0x159572=frontmatterValue(readFileSync(join(_0x31a0cd,_0x2b8f3c(0x113)),_0x2b8f3c(0xef)),'version'),_0x38b854=listFiles(_0x31a0cd);if(_0x5f4e9a[_0x2b8f3c(0x115)]!==0x1||_0x5f4e9a['name']!==SKILL_NAME||!_0x1c129a[_0x2b8f3c(0xed)]||_0x5f4e9a[_0x2b8f3c(0xf4)]!==_0x1c129a[_0x2b8f3c(0xed)]||_0x5f4e9a['skillVersion']!==_0x1c129a['version']||_0x159572!==_0x1c129a[_0x2b8f3c(0xed)]||!sameFiles(_0x38b854,_0x5f4e9a['files'])||digestFiles(_0x31a0cd,_0x38b854)!==_0x5f4e9a[_0x2b8f3c(0xeb)])throw new Error(_0x2b8f3c(0xf7));return{'packageVersion':_0x1c129a['version'],'skillVersion':_0x159572,'root':_0x31a0cd,'manifest':_0x5f4e9a};}function installedSkillPath(_0x116a58){const _0x151f7e=a107_0x56990e,_0x2cd5dc=resolveInstalledSkill(SKILL_NAME,{'home':_0x116a58});if(_0x2cd5dc[_0x151f7e(0xe8)]===_0x151f7e(0x10a))return{'state':_0x151f7e(0x10a),'path':dirname(_0x2cd5dc[_0x151f7e(0x107)])};if(_0x2cd5dc[_0x151f7e(0xe8)]===_0x151f7e(0xfe))return{'state':_0x151f7e(0xfa)};return{'state':_0x151f7e(0x109),'reason':_0x2cd5dc['reason']};}export function inspectInstalledBuiltinSkillVersion(_0x1620c7,_0x30c8b4={}){const _0x2a7865=a107_0x56990e,_0x10711d=installedSkillPath(_0x30c8b4['home']??homedir());if(_0x10711d['state']===_0x2a7865(0xfa))return{'state':_0x2a7865(0xfa),'expectedVersion':_0x1620c7,'repairCommand':REPAIR_COMMAND};if(_0x10711d[_0x2a7865(0xe8)]===_0x2a7865(0x109))return{'state':'unverifiable','expectedVersion':_0x1620c7,'reason':_0x10711d[_0x2a7865(0x116)],'repairCommand':REPAIR_COMMAND};try{const _0x47ca20=frontmatterValue(readFileSync(join(_0x10711d[_0x2a7865(0x107)],'SKILL.md'),'utf8'),'version');return{'state':_0x47ca20===_0x1620c7?'current':_0x2a7865(0x108),'expectedVersion':_0x1620c7,'skillVersion':_0x47ca20,'installedPath':_0x10711d['path'],'repairCommand':REPAIR_COMMAND};}catch(_0xb79b1e){return{'state':_0x2a7865(0x109),'expectedVersion':_0x1620c7,'installedPath':_0x10711d[_0x2a7865(0x107)],'reason':_0xb79b1e instanceof Error?_0xb79b1e['message']:String(_0xb79b1e),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x5e505f={}){const _0xe88bba=a107_0x56990e,_0x302772=_0x5e505f['packageRoot']??DEFAULT_PACKAGE_ROOT;let _0x1428e1;try{_0x1428e1=readSource(_0x302772);}catch(_0xbb097b){return{'state':'unverifiable','packageVersion':_0xe88bba(0xf3),'reason':_0xbb097b instanceof Error?_0xbb097b['message']:String(_0xbb097b),'repairCommand':REPAIR_COMMAND};}const _0x2b0206=installedSkillPath(_0x5e505f[_0xe88bba(0xde)]??homedir());if(_0x2b0206[_0xe88bba(0xe8)]==='missing')return{'state':_0xe88bba(0xfa),'packageVersion':_0x1428e1[_0xe88bba(0xf4)],'repairCommand':REPAIR_COMMAND};if(_0x2b0206[_0xe88bba(0xe8)]===_0xe88bba(0x109))return{'state':'unverifiable','packageVersion':_0x1428e1[_0xe88bba(0xf4)],'reason':_0x2b0206[_0xe88bba(0x116)],'repairCommand':REPAIR_COMMAND};try{const _0x89d918=frontmatterValue(readFileSync(join(_0x2b0206[_0xe88bba(0x107)],_0xe88bba(0x113)),_0xe88bba(0xef)),'version');if(_0x89d918!==_0x1428e1[_0xe88bba(0x111)])return{'state':_0xe88bba(0x108),'packageVersion':_0x1428e1[_0xe88bba(0xf4)],'skillVersion':_0x89d918,'installedPath':_0x2b0206[_0xe88bba(0x107)],'repairCommand':REPAIR_COMMAND};const _0x1005d0=listFiles(_0x2b0206['path']),_0x2511af=digestFiles(_0x2b0206[_0xe88bba(0x107)],_0x1005d0);return{'state':sameFiles(_0x1005d0,_0x1428e1[_0xe88bba(0xfc)]['files'])&&_0x2511af===_0x1428e1[_0xe88bba(0xfc)][_0xe88bba(0xeb)]?_0xe88bba(0x110):_0xe88bba(0xff),'packageVersion':_0x1428e1[_0xe88bba(0xf4)],'skillVersion':_0x89d918,'installedPath':_0x2b0206[_0xe88bba(0x107)],'digest':_0x2511af,'repairCommand':REPAIR_COMMAND};}catch(_0x422a76){return{'state':_0xe88bba(0x109),'packageVersion':_0x1428e1[_0xe88bba(0xf4)],'installedPath':_0x2b0206[_0xe88bba(0x107)],'reason':_0x422a76 instanceof Error?_0x422a76[_0xe88bba(0x105)]:String(_0x422a76),'repairCommand':REPAIR_COMMAND};}}function failure(_0x3ccb08,_0x2d21fc,_0x45134e,_0x397d5a){const _0x1073d2=a107_0x56990e;return{'ok':![],'code':_0x3ccb08,'packageVersion':_0x2d21fc[_0x1073d2(0xf4)],'skillVersion':_0x2d21fc[_0x1073d2(0x111)],'installedPath':_0x397d5a,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x45134e instanceof Error?_0x45134e[_0x1073d2(0x105)]:String(_0x45134e)};}export function installBuiltinSkill(_0x24142b={}){const _0x26854d=a107_0x56990e,_0x32d4f7=_0x24142b['packageRoot']??DEFAULT_PACKAGE_ROOT,_0x40dbd4=_0x24142b['home']??homedir();let _0x1b30be;try{_0x1b30be=readSource(_0x32d4f7);}catch(_0x28b64d){return failure(_0x26854d(0xe1),{'packageVersion':_0x26854d(0xf3),'skillVersion':_0x26854d(0xf3)},_0x28b64d);}const _0x1f85f4=inspectBuiltinSkill({'packageRoot':_0x32d4f7,'home':_0x40dbd4}),_0x3e335c=runNpxSkillsAddGlobal(_0x32d4f7,_0x1b30be[_0x26854d(0xe4)],{'stdio':_0x24142b[_0x26854d(0x106)]??_0x26854d(0x100),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x40dbd4}});if(_0x3e335c[_0x26854d(0x112)])return{'ok':!![],'packageVersion':_0x1b30be[_0x26854d(0xf4)],'skillVersion':_0x1b30be['skillVersion'],'installedPath':_0x1f85f4['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x3e335c['ok'])return failure(_0x26854d(0xea),_0x1b30be,_0x3e335c['error']??_0x26854d(0xfd)+_0x3e335c['status']);const _0x444d29=inspectBuiltinSkill({'packageRoot':_0x32d4f7,'home':_0x40dbd4});if(_0x444d29['state']!=='current')return failure(_0x26854d(0xe2),_0x1b30be,_0x444d29[_0x26854d(0x116)]??_0x26854d(0x10f)+_0x444d29[_0x26854d(0xe8)],_0x444d29[_0x26854d(0xdb)]);return{'ok':!![],'packageVersion':_0x1b30be[_0x26854d(0xf4)],'skillVersion':_0x1b30be[_0x26854d(0x111)],'installedPath':_0x444d29[_0x26854d(0xdb)],'changed':_0x1f85f4[_0x26854d(0xe8)]!==_0x26854d(0x110),'repairCommand':REPAIR_COMMAND};}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Official `skills` CLI integration used by `lovrabet cli-skill install`.
|
|
3
3
|
*
|
|
4
|
-
* The runtime CLI currently only needs the `npx skills add <
|
|
4
|
+
* The runtime CLI currently only needs the `npx -y skills@latest add <source> -g -y`
|
|
5
5
|
* flow, so this module intentionally keeps the surface area narrow.
|
|
6
6
|
*/
|
|
7
7
|
import { type ResolveSkillPresenceOptions } from "../skills/skill-presence.js";
|
|
@@ -46,6 +46,8 @@ export interface RunNpxSkillsAddOptions {
|
|
|
46
46
|
stdio?: "inherit" | "pipe";
|
|
47
47
|
/** Override how global Skill install state is probed (isolated environments or tests). */
|
|
48
48
|
presence?: ResolveSkillPresenceOptions;
|
|
49
|
+
/** Expected installed Skill name for package-local paths that have no source mapping. */
|
|
50
|
+
expectedSkillName?: string;
|
|
49
51
|
}
|
|
50
52
|
/**
|
|
51
53
|
* Failure classification.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a108_0x49a0a9=a108_0x358a;(function(_0x5b0675,_0x9e0daf){const _0x565d05=a108_0x358a,_0x4ade73=_0x5b0675();while(!![]){try{const _0x23b166=parseInt(_0x565d05(0x13b))/0x1*(parseInt(_0x565d05(0x137))/0x2)+-parseInt(_0x565d05(0x124))/0x3+parseInt(_0x565d05(0x114))/0x4+parseInt(_0x565d05(0x11c))/0x5*(-parseInt(_0x565d05(0x11d))/0x6)+parseInt(_0x565d05(0x13d))/0x7*(parseInt(_0x565d05(0x13a))/0x8)+-parseInt(_0x565d05(0x125))/0x9+parseInt(_0x565d05(0x126))/0xa*(-parseInt(_0x565d05(0x139))/0xb);if(_0x23b166===_0x9e0daf)break;else _0x4ade73['push'](_0x4ade73['shift']());}catch(_0x1608d7){_0x4ade73['push'](_0x4ade73['shift']());}}}(a108_0x184d,0xb4931));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a108_0x107f90}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a108_0x107f90;function a108_0x184d(){const _0x59bb7e=['absent','warn','\x22\x20install\x20state:\x20','match','SPAWN_FAILED','\x20failed\x20target(s)','reason','code','message','trim','status','presence','!\x20Could\x20not\x20verify\x20\x22','unverifiable','10918SfpPOx','npx','11WaCDDd','5418456snEOnp','257uqrfZq','Installer\x20reported\x20','7xglHkZ','signal','npx\x20terminated\x20by\x20signal\x20','error','skipNpxSkillsEnvSuffix','state','toString','stderr','pipe','CHILD_TERMINATED','join','log','4654852AcyoPU','PERMISSION_DENIED','internalSkillSource','exit\x20','ENOENT','stdio','EPERM','stdout','851315gAJjbu','6BahpQd','NPX_NOT_FOUND','npm_config_global','filter','expectedSkillName','Skill\x20\x22','INSTALL_PARTIAL','2503596uxAtVN','10976022xOaoGr','2799970nypHlQ','EACCES','checked'];a108_0x184d=function(){return _0x59bb7e;};return a108_0x184d();}export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a108_0x49a0a9(0x116)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x1fcd64){const _0x491d53=a108_0x49a0a9;switch(_0x1fcd64[_0x491d53(0x132)]()){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[a108_0x49a0a9(0x10c)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function a108_0x358a(_0x3a3ad5,_0x114d43){_0x3a3ad5=_0x3a3ad5-0x10c;const _0x184d0f=a108_0x184d();let _0x358a1d=_0x184d0f[_0x3a3ad5];return _0x358a1d;}function failure(_0x4e757f,_0x52dfb5,_0xdc1b2){return{'ok':![],'status':_0x52dfb5,'code':_0x4e757f,'error':'['+_0x4e757f+']\x20'+_0xdc1b2};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x1a04b9,_0x225d2d=LOVRABET_SKILL_SOURCE,_0x148780){const _0x25b925=a108_0x49a0a9;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5b7fa8=resolveNpmBin(_0x25b925(0x138)),_0x13616c=['-y','skills@latest','add',_0x225d2d,'-g','-y'],_0x4afe5b=[_0x5b7fa8,..._0x13616c][_0x25b925(0x112)]('\x20');console[_0x25b925(0x113)]('*\x20'+_0x4afe5b);const _0x29c8a8={...process.env};delete _0x29c8a8[_0x25b925(0x11f)],delete _0x29c8a8['NPM_CONFIG_GLOBAL'];const _0x2e51bd=spawnSync(_0x5b7fa8,_0x13616c,{'cwd':_0x1a04b9,'stdio':'pipe','env':_0x29c8a8,'shell':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x412d2c=[_0x2e51bd['stdout']?_0x2e51bd[_0x25b925(0x11b)]['toString']():'',_0x2e51bd[_0x25b925(0x10f)]?_0x2e51bd['stderr'][_0x25b925(0x10e)]():''][_0x25b925(0x120)](Boolean)[_0x25b925(0x112)]('\x0a')[_0x25b925(0x132)]();_0x148780?.[_0x25b925(0x119)]!==_0x25b925(0x110)&&_0x412d2c&&console['log'](_0x412d2c);if(_0x2e51bd[_0x25b925(0x140)]){const _0x16bd6e=_0x2e51bd[_0x25b925(0x140)],_0x2b4ad7=_0x16bd6e['code']===_0x25b925(0x118)?_0x25b925(0x11e):_0x16bd6e['code']===_0x25b925(0x11a)||_0x16bd6e[_0x25b925(0x130)]===_0x25b925(0x127)?_0x25b925(0x115):_0x25b925(0x12d);return failure(_0x2b4ad7,_0x2e51bd[_0x25b925(0x133)],_0x16bd6e[_0x25b925(0x131)]);}if(_0x2e51bd['signal'])return failure(_0x25b925(0x111),_0x2e51bd[_0x25b925(0x133)],_0x25b925(0x13f)+_0x2e51bd[_0x25b925(0x13e)]);if(_0x2e51bd[_0x25b925(0x133)]!==0x0)return failure('CHILD_EXIT_NONZERO',_0x2e51bd[_0x25b925(0x133)],_0x412d2c||_0x25b925(0x117)+(_0x2e51bd[_0x25b925(0x133)]??'unknown'));const _0x91638f=_0x412d2c[_0x25b925(0x12c)](/Failed to install\s+(\d+)/i);if(_0x91638f&&Number(_0x91638f[0x1])>0x0)return failure(_0x25b925(0x123),0x0,_0x25b925(0x13c)+_0x91638f[0x1]+_0x25b925(0x12e)+(_0x412d2c?':\x0a'+_0x412d2c:''));const _0x36510c=_0x148780?.[_0x25b925(0x121)]??resolveGlobalSkillName(_0x225d2d);if(_0x36510c){const _0x43e14=resolveInstalledSkill(_0x36510c,_0x148780?.[_0x25b925(0x134)]);if(_0x43e14[_0x25b925(0x10d)]===_0x25b925(0x129))return failure('SKILL_NOT_INSTALLED',0x0,_0x25b925(0x122)+_0x36510c+'\x22\x20not\x20found\x20after\x20install\x20(checked\x20'+_0x43e14[_0x25b925(0x128)][_0x25b925(0x112)](',\x20')+')');_0x43e14['state']===_0x25b925(0x136)&&console[_0x25b925(0x12a)](_0x25b925(0x135)+_0x36510c+_0x25b925(0x12b)+_0x43e14[_0x25b925(0x12f)]);}return{'ok':!![],'status':0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a109_0x41f9ad=a109_0x5dc3;(function(_0x582206,_0x3c2e51){const _0x59fc41=a109_0x5dc3,_0x541014=_0x582206();while(!![]){try{const _0xd6bf61=parseInt(_0x59fc41(0x1ed))/0x1*(parseInt(_0x59fc41(0x1ea))/0x2)+parseInt(_0x59fc41(0x1df))/0x3+parseInt(_0x59fc41(0x1dd))/0x4*(-parseInt(_0x59fc41(0x1e1))/0x5)+parseInt(_0x59fc41(0x1ee))/0x6+-parseInt(_0x59fc41(0x1ef))/0x7+parseInt(_0x59fc41(0x1f1))/0x8+-parseInt(_0x59fc41(0x1e6))/0x9*(parseInt(_0x59fc41(0x1e9))/0xa);if(_0xd6bf61===_0x3c2e51)break;else _0x541014['push'](_0x541014['shift']());}catch(_0x4d9ea0){_0x541014['push'](_0x541014['shift']());}}}(a109_0x192b,0x80970));export const METADATA_FILE='lovrabet.skill.json';function a109_0x192b(){const _0x338985=['dist','45pGswxc','.hg','SKILL.md','1007270FwGRkC','2JSIegv','.svn','coverage','109676LdtBkx','1081872xxKDmU','1415750GunhXy','build','6043048mKppft','428LwjibS','.cache','2778807XVxebT','.DS_Store','34535dEDNyC','.git','.turbo','node_modules'];a109_0x192b=function(){return _0x338985;};return a109_0x192b();}function a109_0x5dc3(_0x3192aa,_0x21c582){_0x3192aa=_0x3192aa-0x1dd;const _0x192be6=a109_0x192b();let _0x5dc394=_0x192be6[_0x3192aa];return _0x5dc394;}export const SKILL_FILE=a109_0x41f9ad(0x1e8);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a109_0x41f9ad(0x1e0)]);export const IGNORED_DIR_NAMES=new Set([a109_0x41f9ad(0x1e2),a109_0x41f9ad(0x1e7),a109_0x41f9ad(0x1eb),a109_0x41f9ad(0x1e4),'.next',a109_0x41f9ad(0x1e5),a109_0x41f9ad(0x1f0),a109_0x41f9ad(0x1ec),a109_0x41f9ad(0x1e3),a109_0x41f9ad(0x1de)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4700d7,_0x35ea4a){const _0x56998c=a110_0x2576,_0x541cdc=_0x4700d7();while(!![]){try{const _0x5cbae8=parseInt(_0x56998c(0x15e))/0x1+-parseInt(_0x56998c(0x158))/0x2*(-parseInt(_0x56998c(0x15f))/0x3)+-parseInt(_0x56998c(0x155))/0x4+parseInt(_0x56998c(0x162))/0x5*(-parseInt(_0x56998c(0x163))/0x6)+-parseInt(_0x56998c(0x164))/0x7*(parseInt(_0x56998c(0x15b))/0x8)+-parseInt(_0x56998c(0x160))/0x9*(parseInt(_0x56998c(0x157))/0xa)+parseInt(_0x56998c(0x168))/0xb*(parseInt(_0x56998c(0x15c))/0xc);if(_0x5cbae8===_0x35ea4a)break;else _0x541cdc['push'](_0x541cdc['shift']());}catch(_0x36b8f2){_0x541cdc['push'](_0x541cdc['shift']());}}}(a110_0x1062,0xb700f));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x4c6788,_0x2e26f7){const _0x3b0057=a110_0x2576,_0x375574=normalizeSkillRelativePath(_0x2e26f7),_0x548686=realOrResolved(_0x4c6788),_0x3e5775=resolve(_0x548686,..._0x375574[_0x3b0057(0x159)]('/'));if(!isPathInside(_0x3e5775,_0x548686))throw CliErrors[_0x3b0057(0x15a)](_0x3b0057(0x165)+_0x2e26f7);return ensureNoSymlinkInManagedPath(_0x548686,_0x375574),_0x3e5775;}export function ensureNoSymlinkInManagedPath(_0x2434dd,_0x39a626){const _0x248404=a110_0x2576;let _0x5bf9c4=_0x2434dd;for(const _0x44a045 of _0x39a626[_0x248404(0x159)]('/')){_0x5bf9c4=resolve(_0x5bf9c4,_0x44a045);const _0x280a52=lstatIfPresent(_0x5bf9c4);if(_0x280a52?.['isSymbolicLink']())throw CliErrors['validation'](_0x248404(0x167)+_0x39a626);}}export function isDanglingSymlink(_0x25b348){try{return lstatSync(_0x25b348)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x22dfe2){const _0x1ee2a9=readlinkSync(_0x22dfe2);return isAbsolute(_0x1ee2a9)?_0x1ee2a9:resolve(dirname(_0x22dfe2),_0x1ee2a9);}export function isPathInside(_0x5e8b55,_0x23e46a){const _0x3e845e=a110_0x2576,_0x4abace=_0x5e8b55['endsWith'](sep)?_0x5e8b55:''+_0x5e8b55+sep,_0x1591d1=_0x23e46a[_0x3e845e(0x15d)](sep)?_0x23e46a:''+_0x23e46a+sep;return _0x5e8b55===_0x23e46a||_0x4abace[_0x3e845e(0x166)](_0x1591d1);}export function realOrResolved(_0x39055d){try{return realpathSync(_0x39055d);}catch{return resolve(_0x39055d);}}export function lstatIfPresent(_0x1f5b86){try{return lstatSync(_0x1f5b86);}catch{return undefined;}}export function writeTextAtomic(_0x1db1d1,_0x39c3d2,_0x3367be){const _0x5a7850=a110_0x2576;writeBytesAtomic(_0x1db1d1,Buffer['from'](_0x39c3d2,_0x5a7850(0x169)),_0x3367be);}function a110_0x1062(){const _0x48f5ea=['1496198xajcNK','3adRczS','63693VfwdAj','.tmp','50SOVEhR','342354tjscnJ','7pCauev','Unsafe\x20Skill\x20file\x20path:\x20','startsWith','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','31999GlSMsv','utf8','3584796SlKkvP','stringify','1370WqwODq','40718WhfpcC','split','validation','11755576bIjbmw','12948YzKGTl','endsWith'];a110_0x1062=function(){return _0x48f5ea;};return a110_0x1062();}export function writeBytesAtomic(_0x473ab9,_0x496763,_0x96c426){const _0x4428c1=a110_0x2576,_0x517c8b=_0x473ab9+_0x4428c1(0x161);try{writeFileSync(_0x517c8b,_0x496763,{'mode':_0x96c426}),renameSync(_0x517c8b,_0x473ab9);}catch(_0x170b6f){try{rmSync(_0x517c8b,{'force':!![]});}catch{}throw _0x170b6f;}}function a110_0x2576(_0x59dac3,_0x4e940e){_0x59dac3=_0x59dac3-0x155;const _0x10623d=a110_0x1062();let _0x257650=_0x10623d[_0x59dac3];return _0x257650;}export function writeJsonAtomic(_0x3df00e,_0x54ea79){const _0x520bfe=a110_0x2576;writeTextAtomic(_0x3df00e,JSON[_0x520bfe(0x156)](_0x54ea79,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3cc5fb,_0x235644){const _0x5ec3e1=a111_0x4ba7,_0x379a6b=_0x3cc5fb();while(!![]){try{const _0x177736=parseInt(_0x5ec3e1(0x7f))/0x1+-parseInt(_0x5ec3e1(0x7c))/0x2*(-parseInt(_0x5ec3e1(0x87))/0x3)+-parseInt(_0x5ec3e1(0x88))/0x4*(parseInt(_0x5ec3e1(0x83))/0x5)+-parseInt(_0x5ec3e1(0x7d))/0x6+-parseInt(_0x5ec3e1(0x86))/0x7*(parseInt(_0x5ec3e1(0x7e))/0x8)+-parseInt(_0x5ec3e1(0x7b))/0x9*(parseInt(_0x5ec3e1(0x8b))/0xa)+parseInt(_0x5ec3e1(0x84))/0xb*(parseInt(_0x5ec3e1(0x81))/0xc);if(_0x177736===_0x235644)break;else _0x379a6b['push'](_0x379a6b['shift']());}catch(_0x44c91d){_0x379a6b['push'](_0x379a6b['shift']());}}}(a111_0x3c8d,0xc166a));import{createHash}from'node:crypto';function a111_0x4ba7(_0x44a354,_0x3a905c){_0x44a354=_0x44a354-0x7b;const _0x3c8d5a=a111_0x3c8d();let _0x4ba7e9=_0x3c8d5a[_0x44a354];return _0x4ba7e9;}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x27fe4a){const _0x53c310=a111_0x4ba7;return createHash(_0x53c310(0x82))[_0x53c310(0x8a)](_0x27fe4a)[_0x53c310(0x85)](_0x53c310(0x80));}function a111_0x3c8d(){const _0x46336d=['4432276ixHaGb','path','update','50uknnus','623547kmLcVq','12kfhVul','2870616LyRHOX','27344WjKJZB','1194332WtYLyN','hex','1884utxEBt','sha256','5gZPWzU','145508GUKjMi','digest','1148DJqXqe','7257DyqlCC'];a111_0x3c8d=function(){return _0x46336d;};return a111_0x3c8d();}export function fileHash(_0x56af2a){return bufferSha256(fileContent(_0x56af2a));}export function bufferSha256(_0x402109){const _0x8bcda=a111_0x4ba7;return createHash('sha256')[_0x8bcda(0x8a)](_0x402109)['digest'](_0x8bcda(0x80));}export function fileTreeHash(_0xe8c129){const _0x46f498=a111_0x4ba7,_0x26e68b=createHash('sha256');for(const _0x32d7e3 of normalizeManifestFiles(_0xe8c129)){_0x26e68b[_0x46f498(0x8a)](_0x32d7e3[_0x46f498(0x89)]),_0x26e68b[_0x46f498(0x8a)]('\x00'),_0x26e68b[_0x46f498(0x8a)](_0x32d7e3[_0x46f498(0x82)]),_0x26e68b['update']('\x00'),_0x26e68b[_0x46f498(0x8a)](String(_0x32d7e3['size'])),_0x26e68b['update']('\x00');}return _0x26e68b['digest'](_0x46f498(0x80));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a112_0x3c4a(){const _0x42a909=['32RQotBx','5939720xIadVS','2945670pmTUPt','351939EbRUZS','104158eeFicq','.agents','2msVRqo','3272370sLMdMZ','cwd','skills','33TZrLcz','4741650ItcLbh','global','9OxdlbC','1600465KUfPlg','project'];a112_0x3c4a=function(){return _0x42a909;};return a112_0x3c4a();}const a112_0x423d43=a112_0x5acf;(function(_0xf5124,_0x1878f0){const _0x156966=a112_0x5acf,_0x1ace11=_0xf5124();while(!![]){try{const _0x139871=parseInt(_0x156966(0x92))/0x1*(-parseInt(_0x156966(0x94))/0x2)+parseInt(_0x156966(0x91))/0x3*(-parseInt(_0x156966(0x8e))/0x4)+parseInt(_0x156966(0x8c))/0x5+-parseInt(_0x156966(0x95))/0x6+-parseInt(_0x156966(0x90))/0x7+parseInt(_0x156966(0x8f))/0x8*(parseInt(_0x156966(0x8b))/0x9)+parseInt(_0x156966(0x99))/0xa*(parseInt(_0x156966(0x98))/0xb);if(_0x139871===_0x1878f0)break;else _0x1ace11['push'](_0x1ace11['shift']());}catch(_0x2031ef){_0x1ace11['push'](_0x1ace11['shift']());}}}(a112_0x3c4a,0x7441a));function a112_0x5acf(_0x39c14e,_0x4523cb){_0x39c14e=_0x39c14e-0x8a;const _0x3c4ae8=a112_0x3c4a();let _0x5acfa0=_0x3c4ae8[_0x39c14e];return _0x5acfa0;}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x2003b0,_0x3e62a6=a112_0x423d43(0x8a),_0x512493={}){const _0x111d65=a112_0x423d43,_0x35d124=resolveSkillSyncPaths(_0x512493),_0x2705bd=safePathSegment(_0x2003b0,'appCode'),_0x115e59=_0x3e62a6===_0x111d65(0x8d)?[resolve(_0x512493['cwd']??process[_0x111d65(0x96)](),_0x111d65(0x93),_0x111d65(0x97))]:runtimeAgentSkillRoots(_0x35d124);return Object['freeze']({'scope':_0x3e62a6,'appCode':_0x2705bd,'skillRoots':Object['freeze'](_0x115e59),'managedRoot':_0x35d124['managedRoot']});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a111_0x4ef7e3=a111_0x311e;(function(_0x53bcce,_0x2ae1bb){const _0x12635e=a111_0x311e,_0x5d09ce=_0x53bcce();while(!![]){try{const _0x2310e0=parseInt(_0x12635e(0x11b))/0x1+parseInt(_0x12635e(0x110))/0x2*(-parseInt(_0x12635e(0x146))/0x3)+parseInt(_0x12635e(0x12a))/0x4*(parseInt(_0x12635e(0x11f))/0x5)+-parseInt(_0x12635e(0x139))/0x6+-parseInt(_0x12635e(0x10e))/0x7*(-parseInt(_0x12635e(0x116))/0x8)+-parseInt(_0x12635e(0x127))/0x9*(parseInt(_0x12635e(0x117))/0xa)+parseInt(_0x12635e(0x13a))/0xb;if(_0x2310e0===_0x2ae1bb)break;else _0x5d09ce['push'](_0x5d09ce['shift']());}catch(_0x18cc1c){_0x5d09ce['push'](_0x5d09ce['shift']());}}}(a111_0x3f1b,0x24cbe));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a111_0x45d3f0 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 a111_0x311e(_0x4e7588,_0x2f4a89){_0x4e7588=_0x4e7588-0x10c;const _0x3f1bf5=a111_0x3f1b();let _0x311e19=_0x3f1bf5[_0x4e7588];return _0x311e19;}const {copySync,ensureDirSync,removeSync}=a111_0x45d3f0,RESERVED_PROJECT_SKILL_CODES=new Set([a111_0x4ef7e3(0x144),a111_0x4ef7e3(0x145),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x5a7d86,_0x1f1f13){const _0x3a8d4c=a111_0x4ef7e3,_0x2a7034=new Map();for(const _0x9468e8 of _0x5a7d86){const _0x5a1496=_0x9468e8['skill'][_0x3a8d4c(0x11e)];if(!_0x5a1496)continue;const _0x2ca0bc=_0x2a7034[_0x3a8d4c(0x120)](_0x5a1496);(!_0x2ca0bc||_0x9468e8['scope']==='personal')&&_0x2a7034[_0x3a8d4c(0x129)](_0x5a1496,_0x9468e8);}const _0x4351b4=[];for(const _0x429492 of _0x2a7034['values']()){const _0x36ef89=requireSkillCode(_0x429492[_0x3a8d4c(0x131)]),_0x2a7e34=readMetadataIfPresent(_0x429492['metadataPath']);if(_0x2a7e34?.[_0x3a8d4c(0x13c)]!==_0x1f1f13[_0x3a8d4c(0x13c)]||_0x2a7e34['skillCode']!==_0x36ef89)throw CliErrors['validation'](_0x3a8d4c(0x11d)+_0x1f1f13[_0x3a8d4c(0x13c)]+':\x20'+_0x429492[_0x3a8d4c(0x121)]);const _0x2ce2e5=runtimeSkillLinkName(_0x1f1f13,_0x36ef89);for(const _0x21987c of _0x1f1f13[_0x3a8d4c(0x149)]){_0x4351b4['push'](ensureManagedSymlink(resolve(_0x21987c,_0x2ce2e5),_0x429492[_0x3a8d4c(0x14b)],_0x1f1f13,_0x36ef89));}}return _0x4351b4;}export function pruneStaleRuntimeSkillLinks(_0xc14f8a,_0xd6b08c,_0x4fac51){const _0x994788=a111_0x4ef7e3,_0x2fa759=new Set([..._0xd6b08c][_0x994788(0x111)](_0x1a2db6=>_0x1a2db6[_0x994788(0x10c)]())['filter'](Boolean)),_0x343d1a=_0x4fac51?new Set([..._0x4fac51][_0x994788(0x111)](_0x19c687=>_0x19c687[_0x994788(0x10c)]())['filter'](Boolean)):undefined,_0x9e7a36=[];for(const _0x2abfef of _0xc14f8a['skillRoots']){for(const _0x527e65 of managedTargetSkillLinkPaths(_0x2abfef,_0xc14f8a)){const _0x2b3017=runtimeSkillCodeFromLink(_0xc14f8a,_0x527e65);if(_0x343d1a&&!_0x343d1a[_0x994788(0x113)](_0x2b3017))continue;if(_0x2fa759['has'](_0x2b3017))continue;_0x9e7a36[_0x994788(0x142)](removeManagedSkillLink(_0x527e65,_0xc14f8a,_0x2b3017));}}return _0x9e7a36;}export function pruneStaleRuntimeSkillCache(_0x79a07d,_0x348f1a={}){const _0x32d92c=a111_0x4ef7e3,_0x27a803=new Set([..._0x79a07d[_0x32d92c(0x126)]][_0x32d92c(0x111)](_0x2ffab9=>_0x2ffab9[_0x32d92c(0x10c)]())['filter'](Boolean)),_0xb89967=_0x79a07d[_0x32d92c(0x125)]?new Set([..._0x79a07d[_0x32d92c(0x125)]][_0x32d92c(0x111)](_0x5dd440=>_0x5dd440[_0x32d92c(0x10c)]())[_0x32d92c(0x13f)](Boolean)):undefined,_0x162076=_0x79a07d[_0x32d92c(0x118)]??[_0x32d92c(0x135),'company'],_0x380175=resolve(getRuntimeSkillCacheRoot(_0x79a07d[_0x32d92c(0x148)],_0x79a07d['accessKey'],_0x348f1a),safePathSegment(_0x79a07d['appCode'],_0x32d92c(0x13c))),_0x4860e1=[];for(const _0x13e4fb of _0x162076){const _0x2cebe1=resolve(_0x380175,_0x13e4fb);if(!existsSync(_0x2cebe1))continue;for(const _0x160f4d of readdirSync(_0x2cebe1,{'withFileTypes':!![]})){if(!_0x160f4d[_0x32d92c(0x10f)]())continue;const _0x321743=_0x160f4d['name'];if(_0xb89967&&!_0xb89967[_0x32d92c(0x113)](_0x321743))continue;if(_0x27a803[_0x32d92c(0x113)](_0x321743))continue;const _0x3aee34=resolve(_0x2cebe1,_0x321743),_0x3dfc7e=readMetadataIfPresent(resolve(_0x3aee34,METADATA_FILE));if(_0x3dfc7e?.[_0x32d92c(0x13c)]!==_0x79a07d[_0x32d92c(0x13c)]||_0x3dfc7e[_0x32d92c(0x124)]!==_0x13e4fb||_0x3dfc7e['skillCode']!==_0x321743){_0x4860e1[_0x32d92c(0x142)]({'path':_0x3aee34,'action':_0x32d92c(0x12b),'reason':_0x32d92c(0x11a)});continue;}if(isLinkedFromAnyRoot(_0x3aee34,_0x79a07d[_0x32d92c(0x137)]??[])){_0x4860e1[_0x32d92c(0x142)]({'path':_0x3aee34,'action':_0x32d92c(0x12b),'reason':_0x32d92c(0x13d)});continue;}removeSync(_0x3aee34),_0x4860e1[_0x32d92c(0x142)]({'path':_0x3aee34,'action':_0x32d92c(0x141)});}}return _0x4860e1;}export function linkGlobalRuntimeSkills(_0x1f5f88,_0x5b5e9f={}){const _0x52a389=a111_0x4ef7e3,_0x1df583=resolveSkillSyncPaths(_0x5b5e9f),_0x2b30fc=[];for(const _0x5aa613 of _0x1f5f88){if(_0x5aa613[_0x52a389(0x124)]!==_0x52a389(0x130))throw CliErrors[_0x52a389(0x114)](_0x52a389(0x12f)+_0x5aa613['scope']);const _0xebf498=requireSkillCode(_0x5aa613[_0x52a389(0x131)]),_0xc7a820=copyManagedSkillDirectory(_0x5aa613[_0x52a389(0x14b)],resolve(_0x1df583[_0x52a389(0x136)],_0xebf498));_0x2b30fc['push']({..._0xc7a820,'contentHash':_0x5aa613[_0x52a389(0x119)]});}return _0x2b30fc;}function ensureManagedSymlink(_0x215a8b,_0x1c794b,_0x26057f,_0x3527fc){const _0x2f1194=a111_0x4ef7e3;mkdirSync(dirname(_0x215a8b),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x215a8b)||isDanglingSymlink(_0x215a8b)){const _0x3c3b5d=lstatSync(_0x215a8b);if(!_0x3c3b5d['isSymbolicLink']())throw CliErrors[_0x2f1194(0x114)](_0x2f1194(0x138)+_0x215a8b);const _0x620aa=resolveSymlinkTarget(_0x215a8b);if(!isPathInside(realOrResolved(_0x620aa),realOrResolved(_0x26057f[_0x2f1194(0x12d)])))throw CliErrors['validation'](_0x2f1194(0x122)+_0x215a8b);if(realOrResolved(_0x620aa)===realOrResolved(_0x1c794b))return{'path':_0x215a8b,'target':_0x1c794b,'action':'unchanged'};const _0x4ae89c=readMetadataIfPresent(resolve(_0x620aa,METADATA_FILE));if(_0x26057f['scope']===_0x2f1194(0x134)&&(_0x4ae89c?.[_0x2f1194(0x13c)]!==_0x26057f[_0x2f1194(0x13c)]||_0x4ae89c[_0x2f1194(0x11e)]!==_0x3527fc))throw CliErrors['validation'](_0x2f1194(0x115)+_0x215a8b);return unlinkSync(_0x215a8b),symlinkSync(_0x1c794b,_0x215a8b,'dir'),{'path':_0x215a8b,'target':_0x1c794b,'action':_0x2f1194(0x123)};}return symlinkSync(_0x1c794b,_0x215a8b,_0x2f1194(0x14b)),{'path':_0x215a8b,'target':_0x1c794b,'action':_0x2f1194(0x13b)};}function a111_0x3f1b(){const _0x58c42f=['updated','scope','pruneSkillCodes','activeSkillCodes','18uIHzaf','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','set','36184XrTpDj','skipped','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','managedRoot','not-managed-symlink','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','builtin','skill','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','external-symlink','project','personal','agentsSkillsDir','protectedLinkRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','568440hDvOqg','4877004CxAVxv','created','appCode','linked-from-protected-root','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','filter','name','removed','push','length','lovrabet','runtime-observe','3OljNBW','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','env','skillRoots','slice','dir','trim','startsWith','33089uNAAai','isDirectory','460802iQcPPk','map','isSymbolicLink','has','validation','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','232kviwOU','1409020adeiHY','scopes','contentHash','metadata-mismatch','32480RwtzYT','unchanged','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','skillCode','80uPMMhD','get','metadataPath','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'];a111_0x3f1b=function(){return _0x58c42f;};return a111_0x3f1b();}function managedTargetSkillLinkPaths(_0x5c8933,_0x4b528a){const _0x5b0ff6=a111_0x4ef7e3;if(!existsSync(_0x5c8933))return[];const _0x5aad49=_0x4b528a['appCode']+'--';return readdirSync(_0x5c8933,{'withFileTypes':!![]})[_0x5b0ff6(0x13f)](_0x2cceb2=>_0x4b528a[_0x5b0ff6(0x124)]===_0x5b0ff6(0x134)||_0x2cceb2[_0x5b0ff6(0x140)][_0x5b0ff6(0x10d)](_0x5aad49))['map'](_0x3ac82c=>resolve(_0x5c8933,_0x3ac82c[_0x5b0ff6(0x140)]));}function removeManagedSkillLink(_0xadac75,_0x56787f,_0xb5526){const _0x50dbd2=a111_0x4ef7e3,_0x465960=lstatIfPresent(_0xadac75);if(!_0x465960?.[_0x50dbd2(0x112)]())return{'path':_0xadac75,'action':_0x50dbd2(0x12b),'reason':_0x50dbd2(0x12e)};const _0x3262dd=resolveSymlinkTarget(_0xadac75);if(!isPathInside(realOrResolved(_0x3262dd),realOrResolved(_0x56787f[_0x50dbd2(0x12d)])))return{'path':_0xadac75,'action':_0x50dbd2(0x12b),'reason':_0x50dbd2(0x133)};const _0x18fd26=readMetadataIfPresent(resolve(_0x3262dd,METADATA_FILE));if(_0x56787f[_0x50dbd2(0x124)]===_0x50dbd2(0x134)&&(_0x18fd26?.[_0x50dbd2(0x13c)]!==_0x56787f[_0x50dbd2(0x13c)]||_0x18fd26['skillCode']!==_0xb5526))return{'path':_0xadac75,'action':_0x50dbd2(0x12b),'reason':_0x50dbd2(0x11a)};return unlinkSync(_0xadac75),{'path':_0xadac75,'action':'removed'};}function isLinkedFromAnyRoot(_0x382151,_0x36f5d5){const _0x1bdf1a=a111_0x4ef7e3,_0x274920=realOrResolved(_0x382151);for(const _0x4333a5 of _0x36f5d5){if(!existsSync(_0x4333a5))continue;for(const _0x192588 of readdirSync(_0x4333a5,{'withFileTypes':!![]})){if(!_0x192588[_0x1bdf1a(0x112)]())continue;const _0x42857c=resolve(_0x4333a5,_0x192588[_0x1bdf1a(0x140)]);if(realOrResolved(resolveSymlinkTarget(_0x42857c))===_0x274920)return!![];}}return![];}function runtimeSkillLinkName(_0x379c16,_0x1b2579){const _0x3b04bf=a111_0x4ef7e3,_0x585986=safePathSegment(_0x1b2579,_0x3b04bf(0x11e));if(_0x379c16[_0x3b04bf(0x124)]===_0x3b04bf(0x134)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x585986))throw CliErrors['validation'](_0x3b04bf(0x132)+_0x585986);return _0x379c16[_0x3b04bf(0x124)]===_0x3b04bf(0x134)?_0x585986:_0x379c16[_0x3b04bf(0x13c)]+'--'+_0x585986;}function runtimeSkillCodeFromLink(_0xeca8be,_0xa057bf){const _0xb5242a=a111_0x4ef7e3,_0xaa2a15=basename(_0xa057bf);return _0xeca8be['scope']===_0xb5242a(0x134)?_0xaa2a15:_0xaa2a15[_0xb5242a(0x14a)]((_0xeca8be['appCode']+'--')[_0xb5242a(0x143)]);}export function copyManagedSkillDirectory(_0x4fd3f8,_0x369d96){const _0x32e8e0=a111_0x4ef7e3,_0x5a4ed0=resolve(_0x369d96,METADATA_FILE),_0x26f4eb=existsSync(_0x369d96);if(_0x26f4eb){const _0x4247c0=lstatSync(_0x369d96);if(_0x4247c0[_0x32e8e0(0x112)]())throw CliErrors[_0x32e8e0(0x114)](_0x32e8e0(0x128)+_0x369d96);if(!_0x4247c0[_0x32e8e0(0x10f)]())throw CliErrors['validation'](_0x32e8e0(0x13e)+_0x369d96);const _0x573877=readMetadataIfPresent(_0x5a4ed0);if(_0x573877?.[_0x32e8e0(0x124)]!==_0x32e8e0(0x130))throw CliErrors[_0x32e8e0(0x114)](_0x32e8e0(0x12c)+_0x369d96);}ensureDirSync(dirname(_0x369d96));const _0x410754=_0x26f4eb?readMetadataIfPresent(_0x5a4ed0)?.['contentHash']:undefined,_0x56c5c3=readMetadataIfPresent(resolve(_0x4fd3f8,METADATA_FILE))?.[_0x32e8e0(0x119)];return _0x26f4eb&&removeSync(_0x369d96),copySkillDirectory(_0x4fd3f8,_0x369d96),{'path':_0x369d96,'target':_0x4fd3f8,'action':!_0x26f4eb?_0x32e8e0(0x13b):_0x410754===_0x56c5c3?_0x32e8e0(0x11c):_0x32e8e0(0x123)};}function copySkillDirectory(_0x5db7b2,_0x1cda64){copySync(_0x5db7b2,_0x1cda64,{'dereference':![],'overwrite':!![],'filter'(_0x298dc4){const _0x1a34e3=a111_0x311e;if(lstatSync(_0x298dc4)[_0x1a34e3(0x112)]())throw CliErrors['validation'](_0x1a34e3(0x147)+_0x298dc4);return!![];}});}
|
|
1
|
+
const a113_0x374ccc=a113_0x287c;(function(_0x43dc15,_0x48ba19){const _0x476565=a113_0x287c,_0x19c391=_0x43dc15();while(!![]){try{const _0x3b672c=parseInt(_0x476565(0x1aa))/0x1+parseInt(_0x476565(0x1c1))/0x2+parseInt(_0x476565(0x19c))/0x3*(parseInt(_0x476565(0x1a4))/0x4)+-parseInt(_0x476565(0x1b6))/0x5*(parseInt(_0x476565(0x1d6))/0x6)+parseInt(_0x476565(0x1d0))/0x7*(-parseInt(_0x476565(0x1ad))/0x8)+-parseInt(_0x476565(0x1c3))/0x9+-parseInt(_0x476565(0x1a8))/0xa*(-parseInt(_0x476565(0x1d2))/0xb);if(_0x3b672c===_0x48ba19)break;else _0x19c391['push'](_0x19c391['shift']());}catch(_0x259790){_0x19c391['push'](_0x19c391['shift']());}}}(a113_0xe6ce,0x48c73));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a113_0x1b27b2 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a113_0x1b27b2,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet','runtime-observe',a113_0x374ccc(0x1ae)]);export function linkEffectiveRuntimeSkills(_0x30d037,_0x1e238d){const _0x17cf2d=a113_0x374ccc,_0x3d4c73=new Map();for(const _0x500e56 of _0x30d037){const _0x59fcae=_0x500e56[_0x17cf2d(0x1a5)][_0x17cf2d(0x1b7)];if(!_0x59fcae)continue;const _0x1e7323=_0x3d4c73[_0x17cf2d(0x1b5)](_0x59fcae);(!_0x1e7323||_0x500e56[_0x17cf2d(0x1cb)]===_0x17cf2d(0x1c4))&&_0x3d4c73[_0x17cf2d(0x1bf)](_0x59fcae,_0x500e56);}const _0x1ccd23=[];for(const _0x4f1ac2 of _0x3d4c73[_0x17cf2d(0x1cd)]()){const _0x46e691=requireSkillCode(_0x4f1ac2[_0x17cf2d(0x1a5)]),_0x3b14a4=readMetadataIfPresent(_0x4f1ac2[_0x17cf2d(0x1d1)]);if(_0x3b14a4?.[_0x17cf2d(0x1d5)]!==_0x1e238d[_0x17cf2d(0x1d5)]||_0x3b14a4[_0x17cf2d(0x1b7)]!==_0x46e691)throw CliErrors[_0x17cf2d(0x1ac)](_0x17cf2d(0x1c0)+_0x1e238d['appCode']+':\x20'+_0x4f1ac2[_0x17cf2d(0x1d1)]);const _0x183263=runtimeSkillLinkName(_0x1e238d,_0x46e691);for(const _0x8d4f40 of _0x1e238d[_0x17cf2d(0x1c2)]){_0x1ccd23[_0x17cf2d(0x1ab)](ensureManagedSymlink(resolve(_0x8d4f40,_0x183263),_0x4f1ac2[_0x17cf2d(0x1c7)],_0x1e238d,_0x46e691));}}return _0x1ccd23;}function a113_0xe6ce(){const _0x5b72e0=['get','25meDvlK','skillCode','removed','protectedLinkRoots','name','pruneSkillCodes','agentsSkillsDir','has','company','set','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','334352WXFKEI','skillRoots','4496103cxRqyz','personal','isDirectory','project','dir','managedRoot','env','unchanged','scope','skipped','values','filter','not-managed-symlink','556535ZkWqcV','metadataPath','33hrUGzC','contentHash','created','appCode','127398NCJZua','928050KWnjiI','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','linked-from-protected-root','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','trim','activeSkillCodes','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','4Kampfd','skill','updated','map','1103890yWuAOm','scopes','334653BYZmLc','push','validation','24sZACbM','secret-retriever','metadata-mismatch','isSymbolicLink','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','slice','external-symlink','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'];a113_0xe6ce=function(){return _0x5b72e0;};return a113_0xe6ce();}export function pruneStaleRuntimeSkillLinks(_0x5ef490,_0x539545,_0x2bfa71){const _0x2a72d9=a113_0x374ccc,_0x233198=new Set([..._0x539545][_0x2a72d9(0x1a7)](_0x37eb3c=>_0x37eb3c['trim']())[_0x2a72d9(0x1ce)](Boolean)),_0x15b868=_0x2bfa71?new Set([..._0x2bfa71][_0x2a72d9(0x1a7)](_0x3214cb=>_0x3214cb[_0x2a72d9(0x1a1)]())[_0x2a72d9(0x1ce)](Boolean)):undefined,_0x376e85=[];for(const _0x527708 of _0x5ef490[_0x2a72d9(0x1c2)]){for(const _0x2720fb of managedTargetSkillLinkPaths(_0x527708,_0x5ef490)){const _0x595903=runtimeSkillCodeFromLink(_0x5ef490,_0x2720fb);if(_0x15b868&&!_0x15b868[_0x2a72d9(0x1bd)](_0x595903))continue;if(_0x233198[_0x2a72d9(0x1bd)](_0x595903))continue;_0x376e85[_0x2a72d9(0x1ab)](removeManagedSkillLink(_0x2720fb,_0x5ef490,_0x595903));}}return _0x376e85;}export function pruneStaleRuntimeSkillCache(_0x140288,_0x1a1406={}){const _0x403fd8=a113_0x374ccc,_0xf69179=new Set([..._0x140288[_0x403fd8(0x1a2)]][_0x403fd8(0x1a7)](_0x2e5bf8=>_0x2e5bf8['trim']())['filter'](Boolean)),_0x1f85ee=_0x140288[_0x403fd8(0x1bb)]?new Set([..._0x140288['pruneSkillCodes']][_0x403fd8(0x1a7)](_0x5dfa20=>_0x5dfa20['trim']())[_0x403fd8(0x1ce)](Boolean)):undefined,_0x3fa7f4=_0x140288[_0x403fd8(0x1a9)]??[_0x403fd8(0x1c4),_0x403fd8(0x1be)],_0x32673d=resolve(getRuntimeSkillCacheRoot(_0x140288[_0x403fd8(0x1c9)],_0x140288['accessKey'],_0x1a1406),safePathSegment(_0x140288['appCode'],_0x403fd8(0x1d5))),_0x346b9f=[];for(const _0x189d0f of _0x3fa7f4){const _0x3f150b=resolve(_0x32673d,_0x189d0f);if(!existsSync(_0x3f150b))continue;for(const _0x352a4e of readdirSync(_0x3f150b,{'withFileTypes':!![]})){if(!_0x352a4e[_0x403fd8(0x1c5)]())continue;const _0x5ac194=_0x352a4e['name'];if(_0x1f85ee&&!_0x1f85ee[_0x403fd8(0x1bd)](_0x5ac194))continue;if(_0xf69179['has'](_0x5ac194))continue;const _0x56876b=resolve(_0x3f150b,_0x5ac194),_0x26dbc1=readMetadataIfPresent(resolve(_0x56876b,METADATA_FILE));if(_0x26dbc1?.[_0x403fd8(0x1d5)]!==_0x140288[_0x403fd8(0x1d5)]||_0x26dbc1[_0x403fd8(0x1cb)]!==_0x189d0f||_0x26dbc1[_0x403fd8(0x1b7)]!==_0x5ac194){_0x346b9f[_0x403fd8(0x1ab)]({'path':_0x56876b,'action':_0x403fd8(0x1cc),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x56876b,_0x140288[_0x403fd8(0x1b9)]??[])){_0x346b9f[_0x403fd8(0x1ab)]({'path':_0x56876b,'action':_0x403fd8(0x1cc),'reason':_0x403fd8(0x19f)});continue;}removeSync(_0x56876b),_0x346b9f[_0x403fd8(0x1ab)]({'path':_0x56876b,'action':_0x403fd8(0x1b8)});}}return _0x346b9f;}export function linkGlobalRuntimeSkills(_0x1b0f88,_0x80e304={}){const _0x560f67=a113_0x374ccc,_0x24121f=resolveSkillSyncPaths(_0x80e304),_0x63d467=[];for(const _0x55fa58 of _0x1b0f88){if(_0x55fa58[_0x560f67(0x1cb)]!=='builtin')throw CliErrors[_0x560f67(0x1ac)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x55fa58[_0x560f67(0x1cb)]);const _0x54945e=requireSkillCode(_0x55fa58[_0x560f67(0x1a5)]),_0xe0d224=copyManagedSkillDirectory(_0x55fa58['dir'],resolve(_0x24121f[_0x560f67(0x1bc)],_0x54945e));_0x63d467['push']({..._0xe0d224,'contentHash':_0x55fa58[_0x560f67(0x1d3)]});}return _0x63d467;}function ensureManagedSymlink(_0x28c4ab,_0x431427,_0x4be7f1,_0x11fef6){const _0x5ca224=a113_0x374ccc;mkdirSync(dirname(_0x28c4ab),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x28c4ab)||isDanglingSymlink(_0x28c4ab)){const _0x19fd6c=lstatSync(_0x28c4ab);if(!_0x19fd6c['isSymbolicLink']())throw CliErrors[_0x5ca224(0x1ac)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x28c4ab);const _0x11eb6c=resolveSymlinkTarget(_0x28c4ab);if(!isPathInside(realOrResolved(_0x11eb6c),realOrResolved(_0x4be7f1[_0x5ca224(0x1c8)])))throw CliErrors[_0x5ca224(0x1ac)](_0x5ca224(0x1b1)+_0x28c4ab);if(realOrResolved(_0x11eb6c)===realOrResolved(_0x431427))return{'path':_0x28c4ab,'target':_0x431427,'action':'unchanged'};const _0x41fbf5=readMetadataIfPresent(resolve(_0x11eb6c,METADATA_FILE));if(_0x4be7f1[_0x5ca224(0x1cb)]===_0x5ca224(0x1c6)&&(_0x41fbf5?.['appCode']!==_0x4be7f1['appCode']||_0x41fbf5[_0x5ca224(0x1b7)]!==_0x11fef6))throw CliErrors[_0x5ca224(0x1ac)](_0x5ca224(0x19e)+_0x28c4ab);return unlinkSync(_0x28c4ab),symlinkSync(_0x431427,_0x28c4ab,'dir'),{'path':_0x28c4ab,'target':_0x431427,'action':'updated'};}return symlinkSync(_0x431427,_0x28c4ab,'dir'),{'path':_0x28c4ab,'target':_0x431427,'action':'created'};}function managedTargetSkillLinkPaths(_0x482605,_0x2e2e9c){const _0x3ded3c=a113_0x374ccc;if(!existsSync(_0x482605))return[];const _0x2082f1=_0x2e2e9c[_0x3ded3c(0x1d5)]+'--';return readdirSync(_0x482605,{'withFileTypes':!![]})[_0x3ded3c(0x1ce)](_0x360bb7=>_0x2e2e9c[_0x3ded3c(0x1cb)]===_0x3ded3c(0x1c6)||_0x360bb7['name']['startsWith'](_0x2082f1))[_0x3ded3c(0x1a7)](_0x72b888=>resolve(_0x482605,_0x72b888[_0x3ded3c(0x1ba)]));}function removeManagedSkillLink(_0x39ed0f,_0x4bab5d,_0x299bb2){const _0x2d1acc=a113_0x374ccc,_0x418281=lstatIfPresent(_0x39ed0f);if(!_0x418281?.[_0x2d1acc(0x1b0)]())return{'path':_0x39ed0f,'action':'skipped','reason':_0x2d1acc(0x1cf)};const _0x647c06=resolveSymlinkTarget(_0x39ed0f);if(!isPathInside(realOrResolved(_0x647c06),realOrResolved(_0x4bab5d[_0x2d1acc(0x1c8)])))return{'path':_0x39ed0f,'action':_0x2d1acc(0x1cc),'reason':_0x2d1acc(0x1b3)};const _0x5d642e=readMetadataIfPresent(resolve(_0x647c06,METADATA_FILE));if(_0x4bab5d['scope']===_0x2d1acc(0x1c6)&&(_0x5d642e?.[_0x2d1acc(0x1d5)]!==_0x4bab5d[_0x2d1acc(0x1d5)]||_0x5d642e[_0x2d1acc(0x1b7)]!==_0x299bb2))return{'path':_0x39ed0f,'action':'skipped','reason':_0x2d1acc(0x1af)};return unlinkSync(_0x39ed0f),{'path':_0x39ed0f,'action':_0x2d1acc(0x1b8)};}function isLinkedFromAnyRoot(_0x1fdb44,_0x426b47){const _0x284ca7=a113_0x374ccc,_0x42ed40=realOrResolved(_0x1fdb44);for(const _0x2511ac of _0x426b47){if(!existsSync(_0x2511ac))continue;for(const _0x18c480 of readdirSync(_0x2511ac,{'withFileTypes':!![]})){if(!_0x18c480[_0x284ca7(0x1b0)]())continue;const _0x19f12b=resolve(_0x2511ac,_0x18c480[_0x284ca7(0x1ba)]);if(realOrResolved(resolveSymlinkTarget(_0x19f12b))===_0x42ed40)return!![];}}return![];}function a113_0x287c(_0x498521,_0x13665a){_0x498521=_0x498521-0x19c;const _0xe6ce1a=a113_0xe6ce();let _0x287ca8=_0xe6ce1a[_0x498521];return _0x287ca8;}function runtimeSkillLinkName(_0x44bb59,_0x47f2d1){const _0xac6a57=a113_0x374ccc,_0x567c10=safePathSegment(_0x47f2d1,_0xac6a57(0x1b7));if(_0x44bb59[_0xac6a57(0x1cb)]===_0xac6a57(0x1c6)&&RESERVED_PROJECT_SKILL_CODES[_0xac6a57(0x1bd)](_0x567c10))throw CliErrors[_0xac6a57(0x1ac)](_0xac6a57(0x1a3)+_0x567c10);return _0x44bb59['scope']===_0xac6a57(0x1c6)?_0x567c10:_0x44bb59[_0xac6a57(0x1d5)]+'--'+_0x567c10;}function runtimeSkillCodeFromLink(_0x1aea51,_0x26ab06){const _0x2df78d=a113_0x374ccc,_0x2bbbbc=basename(_0x26ab06);return _0x1aea51[_0x2df78d(0x1cb)]==='project'?_0x2bbbbc:_0x2bbbbc[_0x2df78d(0x1b2)]((_0x1aea51['appCode']+'--')['length']);}export function copyManagedSkillDirectory(_0x24de42,_0x28d077){const _0x24f72a=a113_0x374ccc,_0x2171b9=resolve(_0x28d077,METADATA_FILE),_0x1c9e22=existsSync(_0x28d077);if(_0x1c9e22){const _0x378ca0=lstatSync(_0x28d077);if(_0x378ca0[_0x24f72a(0x1b0)]())throw CliErrors['validation'](_0x24f72a(0x1a0)+_0x28d077);if(!_0x378ca0[_0x24f72a(0x1c5)]())throw CliErrors['validation'](_0x24f72a(0x1b4)+_0x28d077);const _0x1f490e=readMetadataIfPresent(_0x2171b9);if(_0x1f490e?.['scope']!=='builtin')throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x28d077);}ensureDirSync(dirname(_0x28d077));const _0x2ea11d=_0x1c9e22?readMetadataIfPresent(_0x2171b9)?.[_0x24f72a(0x1d3)]:undefined,_0x31c12f=readMetadataIfPresent(resolve(_0x24de42,METADATA_FILE))?.[_0x24f72a(0x1d3)];return _0x1c9e22&&removeSync(_0x28d077),copySkillDirectory(_0x24de42,_0x28d077),{'path':_0x28d077,'target':_0x24de42,'action':!_0x1c9e22?_0x24f72a(0x1d4):_0x2ea11d===_0x31c12f?_0x24f72a(0x1ca):_0x24f72a(0x1a6)};}function copySkillDirectory(_0x1eb766,_0x35919d){copySync(_0x1eb766,_0x35919d,{'dereference':![],'overwrite':!![],'filter'(_0x50d0c4){const _0x3d8c52=a113_0x287c;if(lstatSync(_0x50d0c4)[_0x3d8c52(0x1b0)]())throw CliErrors[_0x3d8c52(0x1ac)](_0x3d8c52(0x19d)+_0x50d0c4);return!![];}});}
|