@lovrabet/lovrabet-cli 2.1.23-beta.2 → 2.1.23-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/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.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.d.ts +14 -0
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/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/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/npx-skills-add.d.ts +30 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.d.ts +48 -0
- package/lib/skills/skill-presence.js +1 -0
- 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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a93_0x4c53(_0x14302c,_0x38e999){_0x14302c=_0x14302c-0x1f4;const _0x31f1a7=a93_0x31f1();let _0x4c533a=_0x31f1a7[_0x14302c];return _0x4c533a;}(function(_0x33da9e,_0x20c35d){const _0x2b3fe4=a93_0x4c53,_0x44121f=_0x33da9e();while(!![]){try{const _0x32a419=-parseInt(_0x2b3fe4(0x200))/0x1+-parseInt(_0x2b3fe4(0x201))/0x2*(parseInt(_0x2b3fe4(0x1f8))/0x3)+parseInt(_0x2b3fe4(0x1fa))/0x4+parseInt(_0x2b3fe4(0x1f4))/0x5+-parseInt(_0x2b3fe4(0x1f6))/0x6+parseInt(_0x2b3fe4(0x1fb))/0x7*(-parseInt(_0x2b3fe4(0x1fe))/0x8)+-parseInt(_0x2b3fe4(0x1fc))/0x9*(-parseInt(_0x2b3fe4(0x1fd))/0xa);if(_0x32a419===_0x20c35d)break;else _0x44121f['push'](_0x44121f['shift']());}catch(_0x325ab4){_0x44121f['push'](_0x44121f['shift']());}}}(a93_0x31f1,0xf3506));function a93_0x31f1(){const _0x2cf8d6=['1026480ejWmkR','1161AUvApV','143800Vnbyqt','8DQahsZ','trim','433676yoWtCf','954qAzLdp','8061405CcFhuR','status','10066404aRrSYu','stringify','8661hrvuBd','response','4657848sxTzWC'];a93_0x31f1=function(){return _0x2cf8d6;};return a93_0x31f1();}import{LovrabetError}from'@lovrabet/sdk';import{CliErrors}from'../errors.js';import{createRateLimitError,readRetryAfter,readRetryAfterSeconds}from'../framework/rate-limit.js';export function mapUserFacingExecuteError(_0x42103a){const _0x2f91c3=a93_0x4c53;if(_0x42103a instanceof LovrabetError){const _0x4b3c23=userFacingLovrabetMessage(_0x42103a),_0x5e6f1a=_0x42103a,_0x4ae8ad=createRateLimitError({'status':_0x5e6f1a[_0x2f91c3(0x1f5)],'errorCode':_0x5e6f1a['code'],'message':_0x4b3c23,'retryAfter':readRetryAfter(_0x5e6f1a[_0x2f91c3(0x1f9)]?.['headers'])??readRetryAfterSeconds(_0x5e6f1a[_0x2f91c3(0x1f9)])});return _0x4ae8ad??CliErrors['validation'](_0x4b3c23);}return _0x42103a;}function userFacingLovrabetMessage(_0x47526f){const _0x3a9ab5=a93_0x4c53,_0x298867=_0x47526f['description'];if(_0x298867!==undefined&&_0x298867!==null){if(typeof _0x298867==='string'&&_0x298867['trim']())return _0x298867[_0x3a9ab5(0x1ff)]();try{return JSON[_0x3a9ab5(0x1f7)](_0x298867);}catch{}}return _0x47526f['message'];}
|
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x424cf6,_0x5d93e2){const _0x49dc5c=a94_0x2de1,_0x15aaf4=_0x424cf6();while(!![]){try{const _0x1365f3=parseInt(_0x49dc5c(0x136))/0x1+parseInt(_0x49dc5c(0x10d))/0x2+-parseInt(_0x49dc5c(0x124))/0x3*(parseInt(_0x49dc5c(0x146))/0x4)+-parseInt(_0x49dc5c(0x12b))/0x5+-parseInt(_0x49dc5c(0x14c))/0x6*(-parseInt(_0x49dc5c(0x138))/0x7)+parseInt(_0x49dc5c(0x127))/0x8*(-parseInt(_0x49dc5c(0x110))/0x9)+-parseInt(_0x49dc5c(0x144))/0xa*(-parseInt(_0x49dc5c(0x114))/0xb);if(_0x1365f3===_0x5d93e2)break;else _0x15aaf4['push'](_0x15aaf4['shift']());}catch(_0x199fdf){_0x15aaf4['push'](_0x15aaf4['shift']());}}}(a94_0x32c0,0x33ce7));function a94_0x32c0(){const _0x6cc0de=['6HHueLf','cancelled','616970otDZxU','string','validation','225YxoyXC','pretty','.appcode\x20to\x20','currentApp','209NJEdsx','command','APPCODE','appCode','Unknown\x20app:\x20','_notice','\x20or\x20pass\x20','authRequired','items','defaultVerbose','accessKey','../core/api-client.js','app','apiDomain','requiresAuth','appCodeSource','153zkYjWO','trim','Set\x20accessKey\x20in\x20','85880MiriGn','confirmHighRisk','format','mergedCli','2113500xSzrYp','includes','Run\x20`','../commands/app/remote-source.js','ACCESS_KEY','isNonInteractive','error','has','newConfigFileName','requiresAppCode','pageSize','242386cCnRPH','name','1339051ZiQucd','formatOutput','\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20add\x20apps.','verbose','production','local-alias','update','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a','appcode\x20\x22','service','object','appcode','227890QWcCUm','env','21324yFljxD','map','../core/sdk-client.js','rawFlags','defaultPageSize','catch'];a94_0x32c0=function(){return _0x6cc0de;};return a94_0x32c0();}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(_0x2af408){return void _0x2af408,AUTH_MODE['ClientAk'];}let sdkClientInitialized=![];export function createPipelineEnv(_0xf9191b,_0x4930f9){const _0x48e28b=a94_0x2de1,_0x410dd5=typeof _0x4930f9[_0x48e28b(0x120)]===_0x48e28b(0x10e)&&_0x4930f9['app']['trim']();return{'rawFlags':_0x4930f9,'appCode':_0xf9191b[_0x48e28b(0x117)]||productEnv(_0x48e28b(0x116))||(_0x410dd5?undefined:readAppCodeFromConfig()),'appCodeSource':_0xf9191b[_0x48e28b(0x123)],'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x4930f9),'defaultFormat':_0xf9191b[_0x48e28b(0x129)],'defaultPageSize':_0xf9191b[_0x48e28b(0x135)],'defaultVerbose':_0xf9191b[_0x48e28b(0x13b)],'riskLevel':_0xf9191b['riskLevel'],'accessKey':_0xf9191b[_0x48e28b(0x11e)],'env':_0xf9191b[_0x48e28b(0x145)],'mergedCli':{'defaultApp':_0xf9191b['defaultApp'],'currentApp':_0xf9191b[_0x48e28b(0x113)],'appCode':_0xf9191b['appCode']}};}export function createLovrabetRunnerAdapter(_0x3af5e0={}){const _0x1aaa48=a94_0x2de1,_0x1fa1f9={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS['filter'](_0x354fcf=>PIPELINE_FLAG_NAMES[_0x1aaa48(0x132)](_0x354fcf[_0x1aaa48(0x137)]))[_0x1aaa48(0x147)](({name:_0x1d7236,type:_0x54b80a,description:_0x177493})=>({'name':_0x1d7236,'type':_0x54b80a,'description':_0x177493})),'formatOutput':_0x3af5e0[_0x1aaa48(0x139)]??formatOutput,'getCommandLabel'(_0x145b7d){const _0xa05a5b=_0x1aaa48;return CLI_BIN_NAME+'\x20'+_0x145b7d['service']+'\x20'+_0x145b7d[_0xa05a5b(0x115)];},'riskPolicy':{'onViolation'(_0x57bc5e){const _0x3635db=_0x1aaa48;console[_0x3635db(0x131)](_0x57bc5e);},'createError'(_0x5ca0f3){const _0x3e2fd3=_0x1aaa48;return CliErrors[_0x3e2fd3(0x10c)](_0x5ca0f3);}},async 'prepare'(_0x587df1,_0x4231a2){const _0x51e6b7=_0x1aaa48,_0x3d789a=resolveAuthMode(_0x4231a2);if(_0x587df1[_0x51e6b7(0x122)]!==![]){if(!_0x4231a2[_0x51e6b7(0x11e)])throw CliErrors[_0x51e6b7(0x11b)](_0x51e6b7(0x126)+PRODUCT_CONFIG['newConfigFileName']+_0x51e6b7(0x11a)+productEnvName(_0x51e6b7(0x12f))+'.');const {setActiveAK:_0x910f05}=await import(_0x51e6b7(0x11f));_0x910f05(_0x4231a2[_0x51e6b7(0x11e)]);}let _0x25feeb='';if(_0x587df1[_0x51e6b7(0x134)]!==![]){_0x25feeb=_0x4231a2[_0x51e6b7(0x117)]??'',_0x25feeb=await resolveExplicitAppName(_0x587df1,_0x4231a2,_0x25feeb);if(!_0x25feeb){await assertSelectedAppNameIsRuntimeAccessible(_0x587df1,_0x4231a2);throw CliErrors['configMissing']('Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20'+PRODUCT_CONFIG[_0x51e6b7(0x133)]+'.');}await assertAppCodeIsRuntimeAccessible(_0x587df1,_0x4231a2,_0x25feeb);}if(_0x25feeb){const {initSdkClient:_0x4bd3c3}=await import(_0x51e6b7(0x148));_0x4bd3c3({'appCode':_0x25feeb,'env':_0x4231a2['env']??_0x51e6b7(0x13c),'accessKey':_0x4231a2[_0x51e6b7(0x11e)],'authMode':_0x3d789a}),sdkClientInitialized=!![];}return{'defaults':{'booleans':{'verbose':_0x4231a2[_0x51e6b7(0x11d)]},'numbers':{'pagesize':_0x4231a2[_0x51e6b7(0x14a)]}},'extras':{'appCode':_0x25feeb,'cookie':'','apiDomain':_0x4231a2[_0x51e6b7(0x121)],'apiDir':'','accessKey':_0x4231a2[_0x51e6b7(0x11e)],'envName':_0x4231a2[_0x51e6b7(0x145)],'mergedCli':_0x4231a2['mergedCli']}};},'confirmHighRisk':_0x3af5e0[_0x1aaa48(0x128)]??(async({def:_0x360def,env:_0x5f52db,flags:_0x3b9685,commandLabel:_0x5506c8})=>{const _0x4e4569=_0x1aaa48;if(_0x5f52db[_0x4e4569(0x130)]){const _0x590828=reconstructCommandArgv(_0x360def,_0x3b9685);throw CliErrors[_0x4e4569(0x10f)]('High-risk\x20operation\x20`'+_0x5506c8+_0x4e4569(0x13f)+('\x20\x20To\x20proceed:\x20'+_0x590828));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x360def,_0x5506c8,_0x3b9685),'createCancelledError':_0x57a390=>CliErrors['cancelled'](_0x57a390)});}),'mapDryRunError'(_0x387173){return mapUserFacingExecuteError(_0x387173);},'mapExecuteError'(_0x32d29d){return mapUserFacingExecuteError(_0x32d29d);},async 'finalize'(){await finalizeLovrabetRuntimeState();}};return _0x1fa1f9;}function a94_0x2de1(_0x182652,_0x4e0fcb){_0x182652=_0x182652-0x10c;const _0x32c005=a94_0x32c0();let _0x2de17c=_0x32c005[_0x182652];return _0x2de17c;}const terminalRunnerAdapter=createLovrabetRunnerAdapter();export async function finalizeLovrabetRuntimeState(){const _0x2743e5=a94_0x2de1;try{if(sdkClientInitialized){const {clearSdkClient:_0x1657d3}=await import(_0x2743e5(0x148));_0x1657d3();}}finally{sdkClientInitialized=![];const {clearActiveAK:_0x35966c}=await import(_0x2743e5(0x11f));_0x35966c();}}async function resolveExplicitAppName(_0x3bc300,_0x3b89aa,_0x423dd7){const _0x27842a=a94_0x2de1;if(_0x3bc300[_0x27842a(0x134)]===![])return _0x423dd7;const _0x470f5c=typeof _0x3b89aa[_0x27842a(0x149)]['app']===_0x27842a(0x10e)?_0x3b89aa[_0x27842a(0x149)][_0x27842a(0x120)][_0x27842a(0x125)]():'';if(!_0x470f5c)return _0x423dd7;const _0x3011b4=typeof _0x3b89aa[_0x27842a(0x149)][_0x27842a(0x143)]===_0x27842a(0x10e)&&_0x3b89aa[_0x27842a(0x149)][_0x27842a(0x143)]['trim']()||productEnv(_0x27842a(0x116));if(_0x3011b4||_0x3b89aa[_0x27842a(0x123)]===_0x27842a(0x13d))return _0x423dd7;const {getRemoteAppList:_0x373f2f}=await import(_0x27842a(0x12e)),_0x2aada1=await _0x373f2f({'env':_0x3b89aa['env']??'production','accessKey':_0x3b89aa[_0x27842a(0x11e)]}),_0x42b624=findAppByName(_0x2aada1[_0x27842a(0x11c)],_0x470f5c);if(_0x42b624&&!isRuntimeAccessibleApp(_0x42b624))throw runtimeInaccessibleAppError(_0x42b624,'\x22'+_0x470f5c+'\x22');const _0x3b6656=_0x42b624?.[_0x27842a(0x117)]?.[_0x27842a(0x125)]();if(_0x3b6656)return _0x3b6656;throw CliErrors['validation'](_0x27842a(0x118)+_0x470f5c,_0x27842a(0x12d)+CLI_BIN_NAME+_0x27842a(0x13a)+_0x470f5c+_0x27842a(0x112)+PRODUCT_CONFIG[_0x27842a(0x133)]+'.');}async function assertSelectedAppNameIsRuntimeAccessible(_0x2e3cd3,_0x432808){const _0x310fc6=a94_0x2de1;if(_0x2e3cd3[_0x310fc6(0x134)]===![]||!_0x432808['accessKey'])return;const _0x10f1b3=(typeof _0x432808[_0x310fc6(0x149)][_0x310fc6(0x120)]===_0x310fc6(0x10e)&&_0x432808['rawFlags'][_0x310fc6(0x120)]['trim']()?_0x432808['rawFlags']['app']:_0x432808[_0x310fc6(0x12a)]?.[_0x310fc6(0x113)]??_0x432808['mergedCli']?.['defaultApp'])?.['trim']();if(!_0x10f1b3)return;const {getRemoteAppList:_0x9314b9}=await import(_0x310fc6(0x12e)),_0x33794b=await _0x9314b9({'env':_0x432808['env']??_0x310fc6(0x13c),'accessKey':_0x432808['accessKey']}),_0xdf867d=findAppByName(_0x33794b[_0x310fc6(0x11c)],_0x10f1b3);if(_0xdf867d&&!isRuntimeAccessibleApp(_0xdf867d))throw runtimeInaccessibleAppError(_0xdf867d,'\x22'+_0x10f1b3+'\x22');}async function assertAppCodeIsRuntimeAccessible(_0x24ca5f,_0x4d2d0e,_0x39a3f1){const _0x2d064d=a94_0x2de1;if(_0x24ca5f[_0x2d064d(0x134)]===![]||!_0x4d2d0e[_0x2d064d(0x11e)])return;const {getRemoteAppList:_0x1a4785}=await import(_0x2d064d(0x12e)),_0x5d75e2=await _0x1a4785({'env':_0x4d2d0e['env']??'production','accessKey':_0x4d2d0e[_0x2d064d(0x11e)]}),_0x1d34b9=findAppByCode(_0x5d75e2[_0x2d064d(0x11c)],_0x39a3f1);if(_0x1d34b9&&!isRuntimeAccessibleApp(_0x1d34b9))throw runtimeInaccessibleAppError(_0x1d34b9,_0x2d064d(0x140)+_0x39a3f1+'\x22');}export async function runCommand(_0x129656,_0x48d5ad,_0x3ce240=terminalRunnerAdapter){const _0x56b88e=a94_0x2de1;assertKnownCommandFlags(_0x129656,_0x48d5ad[_0x56b88e(0x149)]),await runCommandWithAdapter(shouldAttachUpdateNotice(_0x129656)?withUpdateNotice(_0x129656):_0x129656,_0x48d5ad,_0x3ce240);}function shouldAttachUpdateNotice(_0x1b1366){const _0x3406e2=a94_0x2de1;return![_0x3406e2(0x13e),'schema','doctor'][_0x3406e2(0x12c)](_0x1b1366[_0x3406e2(0x141)]);}function withUpdateNotice(_0x49ba4f){return{..._0x49ba4f,async 'execute'(_0x9f61ad){const _0x2a6228=a94_0x2de1,_0x5a4072=shouldResolveUpdateNotice(_0x9f61ad)?resolveLatestUpdateNotice()[_0x2a6228(0x14b)](()=>null):Promise['resolve'](null),_0x3dda52=await _0x49ba4f['execute'](_0x9f61ad);return attachUpdateNotice(_0x3dda52,await _0x5a4072);}};}function shouldResolveUpdateNotice(_0x305728){const _0xbc96c=a94_0x2de1;return _0x305728[_0xbc96c(0x129)]===_0xbc96c(0x111)&&!_0x305728['nonInteractive'];}function attachUpdateNotice(_0x46bb41,_0x230227){const _0x9f5734=a94_0x2de1;if(!_0x230227||!_0x46bb41||typeof _0x46bb41!==_0x9f5734(0x142))return _0x46bb41;const _0x5be820=_0x46bb41,_0x2a5c95=typeof _0x5be820[_0x9f5734(0x119)]===_0x9f5734(0x142)&&_0x5be820[_0x9f5734(0x119)]!==null?_0x5be820[_0x9f5734(0x119)]:{};return{..._0x5be820,'_notice':{..._0x2a5c95,'update':_0x230227}};}
|
|
1
|
+
(function(_0x267aaf,_0x2ee980){const _0x12e079=a94_0x194f,_0x3f1e19=_0x267aaf();while(!![]){try{const _0x5e6963=parseInt(_0x12e079(0x15a))/0x1+parseInt(_0x12e079(0x14f))/0x2*(parseInt(_0x12e079(0x17c))/0x3)+parseInt(_0x12e079(0x145))/0x4*(-parseInt(_0x12e079(0x17f))/0x5)+-parseInt(_0x12e079(0x143))/0x6*(-parseInt(_0x12e079(0x162))/0x7)+-parseInt(_0x12e079(0x153))/0x8*(-parseInt(_0x12e079(0x169))/0x9)+-parseInt(_0x12e079(0x148))/0xa*(-parseInt(_0x12e079(0x147))/0xb)+-parseInt(_0x12e079(0x146))/0xc;if(_0x5e6963===_0x2ee980)break;else _0x3f1e19['push'](_0x3f1e19['shift']());}catch(_0x4f385f){_0x3f1e19['push'](_0x3f1e19['shift']());}}}(a94_0x587f,0xbb6a3));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';function a94_0x587f(){const _0x32d2ab=['catch','3065UTMPJz','update','rawFlags','appCodeSource','mergedCli','../core/api-client.js','verbose','newConfigFileName','defaultPageSize','cancelled','confirmHighRisk','54CgbGMs','../core/sdk-client.js','5528nEShra','11121000fufFfn','539EFiopu','106570OngWdY','trim','execute','authRequired','../commands/app/remote-source.js','_notice','pretty','132qjepVI','error','ACCESS_KEY','string','8lgPJCE','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a','currentApp','APPCODE','requiresAuth','doctor','appcode','627394xePzFT','isNonInteractive','object','High-risk\x20operation\x20`','accessKey','items','service','validation','100765Ecliad','local-alias','riskLevel','schema','\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20add\x20apps.','includes','apiDomain','4852773wVwgHy','env','appcode\x20\x22','command','configMissing','Run\x20`','filter','Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20','\x20\x20To\x20proceed:\x20','name','\x20or\x20pass\x20','Unknown\x20app:\x20','appCode','production','requiresAppCode','ClientAk','map','pageSize','defaultApp','32874lbBdze','app'];a94_0x587f=function(){return _0x32d2ab;};return a94_0x587f();}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(_0x565b36){const _0x1e2622=a94_0x194f;return void _0x565b36,AUTH_MODE[_0x1e2622(0x178)];}let sdkClientInitialized=![];export function createPipelineEnv(_0x43beb2,_0x264cbd){const _0x20e00f=a94_0x194f,_0x4e4459=typeof _0x264cbd['app']==='string'&&_0x264cbd[_0x20e00f(0x17d)][_0x20e00f(0x149)]();return{'rawFlags':_0x264cbd,'appCode':_0x43beb2[_0x20e00f(0x175)]||productEnv('APPCODE')||(_0x4e4459?undefined:readAppCodeFromConfig()),'appCodeSource':_0x43beb2[_0x20e00f(0x182)],'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x264cbd),'defaultFormat':_0x43beb2['format'],'defaultPageSize':_0x43beb2[_0x20e00f(0x17a)],'defaultVerbose':_0x43beb2[_0x20e00f(0x185)],'riskLevel':_0x43beb2[_0x20e00f(0x164)],'accessKey':_0x43beb2[_0x20e00f(0x15e)],'env':_0x43beb2['env'],'mergedCli':{'defaultApp':_0x43beb2[_0x20e00f(0x17b)],'currentApp':_0x43beb2[_0x20e00f(0x155)],'appCode':_0x43beb2['appCode']}};}function a94_0x194f(_0x179dce,_0x3aa958){_0x179dce=_0x179dce-0x140;const _0x587ff6=a94_0x587f();let _0x194fcb=_0x587ff6[_0x179dce];return _0x194fcb;}export function createLovrabetRunnerAdapter(_0x87231b={}){const _0x4f1c5e=a94_0x194f,_0x1d7e49={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[_0x4f1c5e(0x16f)](_0x522b86=>PIPELINE_FLAG_NAMES['has'](_0x522b86[_0x4f1c5e(0x172)]))[_0x4f1c5e(0x179)](({name:_0x51d938,type:_0x22aa4e,description:_0x97d80f})=>({'name':_0x51d938,'type':_0x22aa4e,'description':_0x97d80f})),'formatOutput':_0x87231b['formatOutput']??formatOutput,'getCommandLabel'(_0x328221){const _0x3e51dd=_0x4f1c5e;return CLI_BIN_NAME+'\x20'+_0x328221['service']+'\x20'+_0x328221[_0x3e51dd(0x16c)];},'riskPolicy':{'onViolation'(_0xbb3556){const _0x9c934e=_0x4f1c5e;console[_0x9c934e(0x150)](_0xbb3556);},'createError'(_0x23fd34){const _0x2d492f=_0x4f1c5e;return CliErrors[_0x2d492f(0x141)](_0x23fd34);}},async 'prepare'(_0x44d73b,_0x76fe35){const _0x4294d5=_0x4f1c5e,_0x40f7d1=resolveAuthMode(_0x76fe35);if(_0x44d73b[_0x4294d5(0x157)]!==![]){if(!_0x76fe35[_0x4294d5(0x15e)])throw CliErrors[_0x4294d5(0x14b)]('Set\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x4294d5(0x186)]+_0x4294d5(0x173)+productEnvName(_0x4294d5(0x151))+'.');const {setActiveAK:_0x3ee172}=await import(_0x4294d5(0x184));_0x3ee172(_0x76fe35[_0x4294d5(0x15e)]);}let _0x4d2817='';if(_0x44d73b[_0x4294d5(0x177)]!==![]){_0x4d2817=_0x76fe35[_0x4294d5(0x175)]??'',_0x4d2817=await resolveExplicitAppName(_0x44d73b,_0x76fe35,_0x4d2817);if(!_0x4d2817){await assertSelectedAppNameIsRuntimeAccessible(_0x44d73b,_0x76fe35);throw CliErrors[_0x4294d5(0x16d)](_0x4294d5(0x170)+PRODUCT_CONFIG['newConfigFileName']+'.');}await assertAppCodeIsRuntimeAccessible(_0x44d73b,_0x76fe35,_0x4d2817);}if(_0x4d2817){const {initSdkClient:_0x334dd6}=await import(_0x4294d5(0x144));_0x334dd6({'appCode':_0x4d2817,'env':_0x76fe35[_0x4294d5(0x16a)]??'production','accessKey':_0x76fe35['accessKey'],'authMode':_0x40f7d1}),sdkClientInitialized=!![];}return{'defaults':{'booleans':{'verbose':_0x76fe35['defaultVerbose']},'numbers':{'pagesize':_0x76fe35[_0x4294d5(0x140)]}},'extras':{'appCode':_0x4d2817,'cookie':'','apiDomain':_0x76fe35[_0x4294d5(0x168)],'apiDir':'','accessKey':_0x76fe35[_0x4294d5(0x15e)],'envName':_0x76fe35[_0x4294d5(0x16a)],'mergedCli':_0x76fe35[_0x4294d5(0x183)]}};},'confirmHighRisk':_0x87231b[_0x4f1c5e(0x142)]??(async({def:_0x572a74,env:_0x230742,flags:_0xee1fb7,commandLabel:_0x1d9080})=>{const _0x339f61=_0x4f1c5e;if(_0x230742[_0x339f61(0x15b)]){const _0x4ff33d=reconstructCommandArgv(_0x572a74,_0xee1fb7);throw CliErrors[_0x339f61(0x161)](_0x339f61(0x15d)+_0x1d9080+_0x339f61(0x154)+(_0x339f61(0x171)+_0x4ff33d));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x572a74,_0x1d9080,_0xee1fb7),'createCancelledError':_0x3857cb=>CliErrors[_0x339f61(0x141)](_0x3857cb)});}),'mapDryRunError'(_0x40b129){return mapUserFacingExecuteError(_0x40b129);},'mapExecuteError'(_0x542b89){return mapUserFacingExecuteError(_0x542b89);},async 'finalize'(){await finalizeLovrabetRuntimeState();}};return _0x1d7e49;}const terminalRunnerAdapter=createLovrabetRunnerAdapter();export async function finalizeLovrabetRuntimeState(){const _0x19eded=a94_0x194f;try{if(sdkClientInitialized){const {clearSdkClient:_0x368eb3}=await import(_0x19eded(0x144));_0x368eb3();}}finally{sdkClientInitialized=![];const {clearActiveAK:_0x381dc2}=await import(_0x19eded(0x184));_0x381dc2();}}async function resolveExplicitAppName(_0x52b218,_0xfdd5ec,_0x3ff09a){const _0x113224=a94_0x194f;if(_0x52b218[_0x113224(0x177)]===![])return _0x3ff09a;const _0x133a2d=typeof _0xfdd5ec[_0x113224(0x181)][_0x113224(0x17d)]===_0x113224(0x152)?_0xfdd5ec[_0x113224(0x181)][_0x113224(0x17d)][_0x113224(0x149)]():'';if(!_0x133a2d)return _0x3ff09a;const _0x368573=typeof _0xfdd5ec['rawFlags'][_0x113224(0x159)]===_0x113224(0x152)&&_0xfdd5ec[_0x113224(0x181)]['appcode'][_0x113224(0x149)]()||productEnv(_0x113224(0x156));if(_0x368573||_0xfdd5ec['appCodeSource']===_0x113224(0x163))return _0x3ff09a;const {getRemoteAppList:_0x1d043d}=await import(_0x113224(0x14c)),_0x602cce=await _0x1d043d({'env':_0xfdd5ec[_0x113224(0x16a)]??_0x113224(0x176),'accessKey':_0xfdd5ec['accessKey']}),_0x3c520e=findAppByName(_0x602cce['items'],_0x133a2d);if(_0x3c520e&&!isRuntimeAccessibleApp(_0x3c520e))throw runtimeInaccessibleAppError(_0x3c520e,'\x22'+_0x133a2d+'\x22');const _0x3eca1b=_0x3c520e?.[_0x113224(0x175)]?.['trim']();if(_0x3eca1b)return _0x3eca1b;throw CliErrors['validation'](_0x113224(0x174)+_0x133a2d,_0x113224(0x16e)+CLI_BIN_NAME+_0x113224(0x166)+_0x133a2d+'.appcode\x20to\x20'+PRODUCT_CONFIG['newConfigFileName']+'.');}async function assertSelectedAppNameIsRuntimeAccessible(_0x1f5c05,_0x242bb7){const _0x7be4b3=a94_0x194f;if(_0x1f5c05['requiresAppCode']===![]||!_0x242bb7['accessKey'])return;const _0x1b84ff=(typeof _0x242bb7[_0x7be4b3(0x181)][_0x7be4b3(0x17d)]==='string'&&_0x242bb7[_0x7be4b3(0x181)]['app'][_0x7be4b3(0x149)]()?_0x242bb7[_0x7be4b3(0x181)][_0x7be4b3(0x17d)]:_0x242bb7['mergedCli']?.[_0x7be4b3(0x155)]??_0x242bb7['mergedCli']?.[_0x7be4b3(0x17b)])?.[_0x7be4b3(0x149)]();if(!_0x1b84ff)return;const {getRemoteAppList:_0xd8d8ba}=await import(_0x7be4b3(0x14c)),_0x54fd89=await _0xd8d8ba({'env':_0x242bb7[_0x7be4b3(0x16a)]??_0x7be4b3(0x176),'accessKey':_0x242bb7[_0x7be4b3(0x15e)]}),_0x4a5d84=findAppByName(_0x54fd89[_0x7be4b3(0x15f)],_0x1b84ff);if(_0x4a5d84&&!isRuntimeAccessibleApp(_0x4a5d84))throw runtimeInaccessibleAppError(_0x4a5d84,'\x22'+_0x1b84ff+'\x22');}async function assertAppCodeIsRuntimeAccessible(_0x5ab60c,_0x32f1c8,_0x2986b4){const _0x4da22b=a94_0x194f;if(_0x5ab60c[_0x4da22b(0x177)]===![]||!_0x32f1c8[_0x4da22b(0x15e)])return;const {getRemoteAppList:_0x2d0c87}=await import(_0x4da22b(0x14c)),_0x43642e=await _0x2d0c87({'env':_0x32f1c8['env']??_0x4da22b(0x176),'accessKey':_0x32f1c8[_0x4da22b(0x15e)]}),_0x4c461b=findAppByCode(_0x43642e[_0x4da22b(0x15f)],_0x2986b4);if(_0x4c461b&&!isRuntimeAccessibleApp(_0x4c461b))throw runtimeInaccessibleAppError(_0x4c461b,_0x4da22b(0x16b)+_0x2986b4+'\x22');}export async function runCommand(_0x4d04f4,_0x28a337,_0x594878=terminalRunnerAdapter){const _0x5f2ef4=a94_0x194f;assertKnownCommandFlags(_0x4d04f4,_0x28a337[_0x5f2ef4(0x181)]),await runCommandWithAdapter(shouldAttachUpdateNotice(_0x4d04f4)?withUpdateNotice(_0x4d04f4):_0x4d04f4,_0x28a337,_0x594878);}function shouldAttachUpdateNotice(_0x4a31df){const _0x3e4909=a94_0x194f;return![_0x3e4909(0x180),_0x3e4909(0x165),_0x3e4909(0x158)][_0x3e4909(0x167)](_0x4a31df[_0x3e4909(0x160)]);}function withUpdateNotice(_0x33545a){return{..._0x33545a,async 'execute'(_0x22c250){const _0x4daf36=a94_0x194f,_0x3c7f59=shouldResolveUpdateNotice(_0x22c250)?resolveLatestUpdateNotice()[_0x4daf36(0x17e)](()=>null):Promise['resolve'](null),_0x407b2b=await _0x33545a[_0x4daf36(0x14a)](_0x22c250);return attachUpdateNotice(_0x407b2b,await _0x3c7f59);}};}function shouldResolveUpdateNotice(_0x38dace){const _0x54935f=a94_0x194f;return _0x38dace['format']===_0x54935f(0x14e)&&!_0x38dace['nonInteractive'];}function attachUpdateNotice(_0x4c893e,_0x1db3ea){const _0x557c3a=a94_0x194f;if(!_0x1db3ea||!_0x4c893e||typeof _0x4c893e!==_0x557c3a(0x15c))return _0x4c893e;const _0x3a5d0d=_0x4c893e,_0x20ded0=typeof _0x3a5d0d[_0x557c3a(0x14d)]==='object'&&_0x3a5d0d[_0x557c3a(0x14d)]!==null?_0x3a5d0d['_notice']:{};return{..._0x3a5d0d,'_notice':{..._0x20ded0,'update':_0x1db3ea}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f1265,_0x1d7fd1){const _0x5d441f=a95_0x10ff,_0x7df778=_0x2f1265();while(!![]){try{const _0x40e698=parseInt(_0x5d441f(0x14c))/0x1*(parseInt(_0x5d441f(0x152))/0x2)+parseInt(_0x5d441f(0x14f))/0x3+parseInt(_0x5d441f(0x149))/0x4+parseInt(_0x5d441f(0x153))/0x5*(parseInt(_0x5d441f(0x14d))/0x6)+parseInt(_0x5d441f(0x14b))/0x7+-parseInt(_0x5d441f(0x150))/0x8+-parseInt(_0x5d441f(0x156))/0x9;if(_0x40e698===_0x1d7fd1)break;else _0x7df778['push'](_0x7df778['shift']());}catch(_0x3cdf0){_0x7df778['push'](_0x7df778['shift']());}}}(a95_0x3f60,0x4f182));import{buildSchemaPayload as a95_0x1a3860}from'@lovrabet/cli-framework';function a95_0x10ff(_0x6fc157,_0x4f0c1c){_0x6fc157=_0x6fc157-0x145;const _0x3f60f4=a95_0x3f60();let _0x10ff5d=_0x3f60f4[_0x6fc157];return _0x10ff5d;}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 _0x4cc1b7=a95_0x10ff,{serviceRegistry:_0x1455e1,findDefinition:_0x3f4c88}=await import(_0x4cc1b7(0x145)),_0x2eda0f=new Set(_0x1455e1['map'](_0x4a1dfb=>_0x4a1dfb[_0x4cc1b7(0x146)])),_0x2ef2d0=listDynamicServiceEntries()[_0x4cc1b7(0x154)](_0x1bf5b0=>!_0x2eda0f[_0x4cc1b7(0x155)](_0x1bf5b0[_0x4cc1b7(0x146)])),_0x1aaf18=a95_0x1a3860({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'cliVersion':getCliVersion(),'gitCommit':getCliGitCommit(),'globalFlags':GLOBAL_FLAGS,'serviceRegistry':insertDynamicServicesAfterServiceTree(_0x1455e1,_0x2ef2d0),'buildAllFlags':buildAllFlags,'findDefinition':(_0x56d0f9,_0x212cfd)=>_0x3f4c88(_0x56d0f9,_0x212cfd)??findDynamicServiceDefinition(_0x56d0f9,_0x212cfd)});return normalizeSchemaPayload(_0x1aaf18);}function normalizeSchemaPayload(_0x587bb7){const _0x27ed88=a95_0x10ff;return{..._0x587bb7,'schemaVersion':0x2,'services':_0x587bb7['services']['map'](_0x2dfcc5=>({..._0x2dfcc5,'commands':_0x2dfcc5[_0x27ed88(0x147)][_0x27ed88(0x14e)](normalizeSchemaCommand)}))};}function normalizeSchemaCommand(_0x32813d){const _0x52efc7=a95_0x10ff,_0x2bbdef=_0x32813d;return{..._0x32813d,'auth':_0x2bbdef[_0x52efc7(0x151)]??(_0x32813d[_0x52efc7(0x148)]?'required':_0x52efc7(0x14a))};}function a95_0x3f60(){const _0x18a604=['has','8483922hkPUmK','../commands/registry.js','service','commands','requiresAuth','848656ZzMpbG','none','1384789HdPBid','117IlqwOU','10938lOdMFL','map','1482933tMTUaN','4532832PeiMiB','auth','10862leGnSM','805IXzuCL','filter'];a95_0x3f60=function(){return _0x18a604;};return a95_0x3f60();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a96_0x5cf7(){const _0x2ee3b8=['2935215GRQevp','136uhlVjc','4433644oYYaAd','29367EyVkli','service','11656MChsVz','8134483JNccuf','slice','43749IVweHm','1078471VZpuKY','5058828lPpsjm','length'];a96_0x5cf7=function(){return _0x2ee3b8;};return a96_0x5cf7();}function a96_0x469a(_0x5c18a0,_0x5e488d){_0x5c18a0=_0x5c18a0-0x109;const _0x5cf785=a96_0x5cf7();let _0x469a7d=_0x5cf785[_0x5c18a0];return _0x469a7d;}(function(_0x27ecdd,_0x5570cd){const _0x2b1a20=a96_0x469a,_0x4526c6=_0x27ecdd();while(!![]){try{const _0x4ad817=-parseInt(_0x2b1a20(0x114))/0x1+parseInt(_0x2b1a20(0x10c))/0x2*(-parseInt(_0x2b1a20(0x113))/0x3)+-parseInt(_0x2b1a20(0x10d))/0x4+-parseInt(_0x2b1a20(0x10b))/0x5+parseInt(_0x2b1a20(0x109))/0x6+-parseInt(_0x2b1a20(0x111))/0x7+parseInt(_0x2b1a20(0x110))/0x8*(parseInt(_0x2b1a20(0x10e))/0x9);if(_0x4ad817===_0x5570cd)break;else _0x4526c6['push'](_0x4526c6['shift']());}catch(_0x167ca3){_0x4526c6['push'](_0x4526c6['shift']());}}}(a96_0x5cf7,0xa37fb));export function insertDynamicServicesAfterServiceTree(_0x7a9790,_0x4fe459){const _0x570b6d=a96_0x469a;if(_0x4fe459[_0x570b6d(0x10a)]===0x0)return[..._0x7a9790];const _0x2d19dd=_0x7a9790['findIndex'](_0x19bbc0=>_0x19bbc0[_0x570b6d(0x10f)]===_0x570b6d(0x10f));if(_0x2d19dd<0x0)return[..._0x7a9790,..._0x4fe459];return[..._0x7a9790['slice'](0x0,_0x2d19dd+0x1),..._0x4fe459,..._0x7a9790[_0x570b6d(0x112)](_0x2d19dd+0x1)];}
|
package/lib/framework/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4e4787,_0x5d46ab){var _0x5f3b42=a97_0x3fe8,_0x3d0b55=_0x4e4787();while(!![]){try{var _0x2710f9=-parseInt(_0x5f3b42(0x1ed))/0x1+parseInt(_0x5f3b42(0x1ec))/0x2+-parseInt(_0x5f3b42(0x1f0))/0x3+-parseInt(_0x5f3b42(0x1f2))/0x4*(parseInt(_0x5f3b42(0x1f4))/0x5)+parseInt(_0x5f3b42(0x1ef))/0x6*(parseInt(_0x5f3b42(0x1f1))/0x7)+parseInt(_0x5f3b42(0x1f3))/0x8+-parseInt(_0x5f3b42(0x1ee))/0x9;if(_0x2710f9===_0x5d46ab)break;else _0x3d0b55['push'](_0x3d0b55['shift']());}catch(_0xf17dd8){_0x3d0b55['push'](_0x3d0b55['shift']());}}}(a97_0x5bfb,0x5bf53));function a97_0x3fe8(_0x1ed1be,_0xa55f68){_0x1ed1be=_0x1ed1be-0x1ec;var _0x5bfb5f=a97_0x5bfb();var _0x3fe8d8=_0x5bfb5f[_0x1ed1be];return _0x3fe8d8;}function a97_0x5bfb(){var _0x115478=['34832ZLguYo','5727576ChCCEE','5YaoGDq','577536RjNpOx','153373NSBfqs','2743110XzfZtr','130074PiBKTZ','1849332WYGECE','147HUzUOj'];a97_0x5bfb=function(){return _0x115478;};return a97_0x5bfb();}export{riskLevelOrder,normalizeLegacyOutputFormat,isValidFormat}from'@lovrabet/cli-framework';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "2.1.23-beta.
|
|
2
|
-
export declare const GIT_TAG = "v2.1.23-beta.
|
|
3
|
-
export declare const GIT_COMMIT = "
|
|
4
|
-
export declare const BUILD_TIME = "2026-08-
|
|
1
|
+
export declare const VERSION = "2.1.23-beta.3";
|
|
2
|
+
export declare const GIT_TAG = "v2.1.23-beta.3";
|
|
3
|
+
export declare const GIT_COMMIT = "da2d251";
|
|
4
|
+
export declare const BUILD_TIME = "2026-08-09T15:04:17.357Z";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a98_0x47174a=a98_0x5288;(function(_0x4041dd,_0x3e90be){const _0xdc4876=a98_0x5288,_0x763348=_0x4041dd();while(!![]){try{const _0x59fecd=-parseInt(_0xdc4876(0x1ea))/0x1+parseInt(_0xdc4876(0x1ec))/0x2+parseInt(_0xdc4876(0x1e7))/0x3+-parseInt(_0xdc4876(0x1ee))/0x4*(-parseInt(_0xdc4876(0x1ef))/0x5)+parseInt(_0xdc4876(0x1ed))/0x6*(-parseInt(_0xdc4876(0x1e9))/0x7)+-parseInt(_0xdc4876(0x1f1))/0x8+parseInt(_0xdc4876(0x1f0))/0x9;if(_0x59fecd===_0x3e90be)break;else _0x763348['push'](_0x763348['shift']());}catch(_0x1f33c1){_0x763348['push'](_0x763348['shift']());}}}(a98_0x4309,0x5a3ca));export const VERSION=a98_0x47174a(0x1eb);function a98_0x5288(_0x33fda9,_0x4cab99){_0x33fda9=_0x33fda9-0x1e6;const _0x430936=a98_0x4309();let _0x528804=_0x430936[_0x33fda9];return _0x528804;}function a98_0x4309(){const _0x4a024a=['2387178ibxkaS','1716384YaqeMk','v2.1.23-beta.3','1030098QibrHK','2026-08-09T15:04:17.357Z','77lQtyFT','341882nbYYSv','2.1.23-beta.3','704276KZGaNM','308058ZBEJcd','2120268THrdZY','5xIoYrd'];a98_0x4309=function(){return _0x4a024a;};return a98_0x4309();}export const GIT_TAG=a98_0x47174a(0x1e6);export const GIT_COMMIT='da2d251';export const BUILD_TIME=a98_0x47174a(0x1e8);
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa42f2c,_0x440dd7){const _0x1daa6b=a99_0x1184,_0x2cd5ae=_0xa42f2c();while(!![]){try{const _0x178b1d=parseInt(_0x1daa6b(0x95))/0x1+parseInt(_0x1daa6b(0x9a))/0x2+parseInt(_0x1daa6b(0x97))/0x3*(parseInt(_0x1daa6b(0x99))/0x4)+parseInt(_0x1daa6b(0x9d))/0x5+parseInt(_0x1daa6b(0x9e))/0x6*(parseInt(_0x1daa6b(0x9f))/0x7)+parseInt(_0x1daa6b(0x94))/0x8+-parseInt(_0x1daa6b(0x98))/0x9;if(_0x178b1d===_0x440dd7)break;else _0x2cd5ae['push'](_0x2cd5ae['shift']());}catch(_0x47ccf7){_0x2cd5ae['push'](_0x2cd5ae['shift']());}}}(a99_0x516b,0xeeea9));import{jsx as a99_0xb83f8a,jsxs as a99_0xc7dbdf}from'react/jsx-runtime';import{useEffect}from'react';function a99_0x1184(_0x19b2fb,_0x6d930c){_0x19b2fb=_0x19b2fb-0x94;const _0x516b20=a99_0x516b();let _0x118457=_0x516b20[_0x19b2fb];return _0x118457;}function a99_0x516b(){const _0x19f776=['green','column','7452550BkFaNh','42HHtbja','43526WqRMYO','13649632DkNvcw','1618494HPnVil','\x20to\x20view\x20available\x20commands.','3HTMtGF','40970448aRTvPy','1216036HVLJIh','736260QMUyRw'];a99_0x516b=function(){return _0x19f776;};return a99_0x516b();}import{Box,Text,useApp}from'ink';import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'./constant/cli.js';export function Help(){const _0x31fe19=a99_0x1184,{exit:_0x24cee1}=useApp();return useEffect(()=>{_0x24cee1();},[_0x24cee1]),a99_0xc7dbdf(Box,{'flexDirection':_0x31fe19(0x9c),'marginTop':0x1,'marginBottom':0x1,'children':[a99_0xb83f8a(Box,{'children':a99_0xb83f8a(Text,{'bold':!![],'color':_0x31fe19(0x9b),'children':'\x20\x20'+CLI_DISPLAY_NAME})}),a99_0xc7dbdf(Box,{'marginTop':0x1,'children':[a99_0xb83f8a(Text,{'dimColor':!![],'children':'\x20\x20Use\x20'}),a99_0xb83f8a(Text,{'bold':!![],'color':_0x31fe19(0x9b),'children':CLI_BIN_NAME+'\x20--help'}),a99_0xb83f8a(Text,{'dimColor':!![],'children':_0x31fe19(0x96)})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5c55b0,_0x50adc9){const _0x21f42e=a100_0x26cf,_0x545cb6=_0x5c55b0();while(!![]){try{const _0x4afa01=-parseInt(_0x21f42e(0x10d))/0x1+parseInt(_0x21f42e(0x10e))/0x2*(-parseInt(_0x21f42e(0x10c))/0x3)+parseInt(_0x21f42e(0x110))/0x4+parseInt(_0x21f42e(0x107))/0x5+parseInt(_0x21f42e(0x109))/0x6*(-parseInt(_0x21f42e(0x106))/0x7)+parseInt(_0x21f42e(0x111))/0x8*(parseInt(_0x21f42e(0x104))/0x9)+parseInt(_0x21f42e(0x108))/0xa;if(_0x4afa01===_0x50adc9)break;else _0x545cb6['push'](_0x545cb6['shift']());}catch(_0xef6e2f){_0x545cb6['push'](_0x545cb6['shift']());}}}(a100_0x12b4,0x32c9f));const DESCRIPTION_MAX_LENGTH=0x1f4;export function buildLovrabetConfirmationRequest(_0x8e1359,_0x46c90d,_0x57373e){const _0x690576=a100_0x26cf,_0x4b104f=normalizeText(_0x8e1359['confirmationDescription'],DESCRIPTION_MAX_LENGTH),_0x661f3b=normalizeText(_0x8e1359[_0x690576(0x10a)],DESCRIPTION_MAX_LENGTH);return{'operation':_0x46c90d,'risk':requireWriteRisk(_0x8e1359),'description':_0x4b104f||_0x661f3b||_0x690576(0x10f),..._0x57373e?{'signal':_0x57373e}:{}};}function a100_0x26cf(_0x26d9fb,_0x9360ae){_0x26d9fb=_0x26d9fb-0x101;const _0x12b4ba=a100_0x12b4();let _0x26cffc=_0x12b4ba[_0x26d9fb];return _0x26cffc;}function a100_0x12b4(){const _0x5a22a0=['103136TfhJvU','string','write','replace','207pvLIif','Lovrabet\x20confirmation\x20requires\x20a\x20write\x20command.','3787MFZIsG','1887170LPYrgK','736380lFGjKe','1902uHgWSX','description','risk','142449sHmTMC','384397LUsCzx','2mBoQAK','执行该写入操作','255280rGCKpK'];a100_0x12b4=function(){return _0x5a22a0;};return a100_0x12b4();}function requireWriteRisk(_0x1f8bbd){const _0x295c52=a100_0x26cf;if(_0x1f8bbd[_0x295c52(0x10b)]===_0x295c52(0x102)||_0x1f8bbd[_0x295c52(0x10b)]==='high-risk-write')return _0x1f8bbd[_0x295c52(0x10b)];throw new Error(_0x295c52(0x105));}function normalizeText(_0x16c4cd,_0xeb01aa){const _0x4504de=a100_0x26cf;if(typeof _0x16c4cd!==_0x4504de(0x101))return'';return _0x16c4cd['replace'](/[\u0000-\u001f\u007f]+/g,'\x20')[_0x4504de(0x103)](/\s+/g,'\x20')['trim']()['slice'](0x0,_0xeb01aa);}
|
package/lib/runtime/event.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a101_0x1548(_0x5970e6,_0x5ef065){_0x5970e6=_0x5970e6-0x69;const _0x17bd11=a101_0x17bd();let _0x15489f=_0x17bd11[_0x5970e6];return _0x15489f;}(function(_0x43f633,_0x1cab3e){const _0x560d57=a101_0x1548,_0x7fe39e=_0x43f633();while(!![]){try{const _0x323af9=-parseInt(_0x560d57(0x73))/0x1+parseInt(_0x560d57(0x78))/0x2*(-parseInt(_0x560d57(0x77))/0x3)+parseInt(_0x560d57(0x6e))/0x4+-parseInt(_0x560d57(0x75))/0x5*(parseInt(_0x560d57(0x6f))/0x6)+parseInt(_0x560d57(0x6c))/0x7*(-parseInt(_0x560d57(0x72))/0x8)+-parseInt(_0x560d57(0x6a))/0x9+parseInt(_0x560d57(0x76))/0xa;if(_0x323af9===_0x1cab3e)break;else _0x7fe39e['push'](_0x7fe39e['shift']());}catch(_0x3700d8){_0x7fe39e['push'](_0x7fe39e['shift']());}}}(a101_0x17bd,0x8bb16));export function canonicalLovrabetOperation(_0x54d9d8){const _0x9beced=a101_0x1548;return[_0x54d9d8[_0x9beced(0x6b)],..._0x54d9d8['command'][_0x9beced(0x71)]()[_0x9beced(0x7a)](/\s+/)][_0x9beced(0x74)](Boolean)['join']('.');}export function createLovrabetWriteMetadata(_0x3ba495,_0x3ebbc4,_0x4426a0,_0x55faba){const _0x4a1bd6=a101_0x1548;if(_0x55faba||_0x4426a0['ok']!==!![]||_0x3ba495[_0x4a1bd6(0x69)]!=='write'&&_0x3ba495[_0x4a1bd6(0x69)]!==_0x4a1bd6(0x79))return undefined;const _0x481909=_0x3ba495[_0x4a1bd6(0x70)]?.(_0x4426a0),_0x197d99={'type':_0x4a1bd6(0x6d),'operation':_0x3ebbc4,'risk':_0x3ba495[_0x4a1bd6(0x69)],..._0x481909?{'subject':_0x481909}:{}};return{'lovrabet':{'schemaVersion':0x1,'event':_0x197d99}};}function a101_0x17bd(){const _0x1291c8=['service','1015091MfLprr','lovrabet.write.completed','2277828qtlzrq','42AbWwch','writeEventSubject','trim','40PPfvRy','744222EigOjI','filter','802335pKPblp','32554900NsRUvG','669VvpLGg','1522DhnGkn','high-risk-write','split','risk','4414554ArKVSb'];a101_0x17bd=function(){return _0x1291c8;};return a101_0x17bd();}
|
package/lib/runtime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46b135,_0x566029){const _0x3ac6fb=a102_0x39d1,_0x42269d=_0x46b135();while(!![]){try{const _0x3fbcf5=parseInt(_0x3ac6fb(0xfc))/0x1+-parseInt(_0x3ac6fb(0xf5))/0x2+-parseInt(_0x3ac6fb(0xfe))/0x3*(parseInt(_0x3ac6fb(0xf9))/0x4)+-parseInt(_0x3ac6fb(0x10a))/0x5+parseInt(_0x3ac6fb(0x10c))/0x6*(-parseInt(_0x3ac6fb(0xff))/0x7)+-parseInt(_0x3ac6fb(0x106))/0x8*(parseInt(_0x3ac6fb(0x10d))/0x9)+parseInt(_0x3ac6fb(0xf8))/0xa;if(_0x3fbcf5===_0x566029)break;else _0x42269d['push'](_0x42269d['shift']());}catch(_0x1a2940){_0x42269d['push'](_0x42269d['shift']());}}}(a102_0x185e,0xeb49a));import{buildConfigFromFlags,initGlobalEnvironment}from'../context.js';import{createLovrabetRunnerAdapter,createPipelineEnv,finalizeLovrabetRuntimeState,runCommand}from'../framework/runner.js';function a102_0x185e(){const _0x4a317e=['riskLevel','847640ZlHlIR','risk','1005QWGpVZ','1015ATfYyE','data','execute','command','Lovrabet\x20invocation\x20completed\x20without\x20a\x20captured\x20command\x20result.','Lovrabet\x20invocation\x20aborted.','definition','88888phPKRK','args','dryRun','signal','83645LqNdSt','reason','16194PtZCfk','900vnGDYY','rawFlags','stringify','dry-run','AbortError','isNonInteractive','aborted','presentation','confirmation','yes','high-risk-write','write','3583146oyFwWZ','message','result','41363850QsXrBm','8472wCnSrR','format'];a102_0x185e=function(){return _0x4a317e;};return a102_0x185e();}import{canonicalLovrabetOperation,createLovrabetWriteMetadata}from'../runtime/event.js';function a102_0x39d1(_0x1ea8e7,_0xe3b2b1){_0x1ea8e7=_0x1ea8e7-0xed;const _0x185edf=a102_0x185e();let _0x39d103=_0x185edf[_0x1ea8e7];return _0x39d103;}import{buildLovrabetConfirmationRequest}from'../runtime/confirmation.js';import{resolveLovrabetInvocation}from'../runtime/resolve.js';import{runSerialized}from'../runtime/queue.js';const defaultPresentation={'present'({result:_0x143bdb,command:_0x47da58,risk:_0x36d5df,dryRun:_0x21281e}){const _0x49228f=a102_0x39d1;return JSON[_0x49228f(0x10f)]({'ok':_0x143bdb['ok'],'command':_0x47da58,'risk':_0x36d5df,..._0x21281e?{'dryRun':!![]}:{},..._0x143bdb[_0x49228f(0x100)]!==undefined?{'data':_0x143bdb[_0x49228f(0x100)]}:{},..._0x143bdb[_0x49228f(0xf6)]?{'message':_0x143bdb[_0x49228f(0xf6)]}:{}});}};export async function invokeLovrabet(_0x86d2c9,_0x24ade7){const _0x313735=a102_0x39d1;throwIfAborted(_0x24ade7[_0x313735(0x109)]);const _0x35a4f6=await resolveLovrabetInvocation(_0x86d2c9),_0x5755d5=canonicalLovrabetOperation(_0x35a4f6[_0x313735(0x105)]);return await confirmWriteBeforeQueue(_0x35a4f6[_0x313735(0x105)],_0x35a4f6[_0x313735(0x10e)],_0x5755d5,_0x24ade7),runSerialized(async()=>{const _0x598edb=_0x313735;throwIfAborted(_0x24ade7[_0x598edb(0x109)]);const _0x108041={},_0x15d5a9=buildConfigFromFlags(_0x35a4f6[_0x598edb(0x10e)]);await initGlobalEnvironment(_0x15d5a9);const _0x3bef28=createPipelineEnv(_0x15d5a9,{..._0x35a4f6[_0x598edb(0x10e)],'yes':_0x35a4f6[_0x598edb(0x105)][_0x598edb(0xfd)]===_0x598edb(0xf3)?!![]:_0x35a4f6[_0x598edb(0x10e)][_0x598edb(0xf2)],'nonInteractive':!![]});_0x3bef28[_0x598edb(0x107)]=_0x35a4f6[_0x598edb(0x107)],_0x3bef28[_0x598edb(0xee)]=!![],_0x3bef28[_0x598edb(0xfb)]=_0x598edb(0xf3);const _0x3cb4ec=withAbortSignal(_0x35a4f6[_0x598edb(0x105)],_0x24ade7[_0x598edb(0x109)]),_0xebff65=createLovrabetRunnerAdapter({'formatOutput'(_0x44a170,_0x3ac1bb){const _0x8acb6f=_0x598edb;_0x108041[_0x8acb6f(0xf7)]=_0x44a170,_0x108041[_0x8acb6f(0x102)]=_0x3ac1bb[_0x8acb6f(0x102)],_0x108041['risk']=_0x3ac1bb[_0x8acb6f(0xfd)],_0x108041[_0x8acb6f(0xfa)]=_0x3ac1bb[_0x8acb6f(0xfa)],_0x108041[_0x8acb6f(0x108)]=_0x3ac1bb['dryRun']===!![];},async 'confirmHighRisk'(){throw new Error('Embedded\x20Lovrabet\x20confirmation\x20must\x20run\x20inside\x20execute.');}});try{await runCommand(_0x3cb4ec,_0x3bef28,_0xebff65);if(!_0x108041['result']||!_0x108041['command']||!_0x108041[_0x598edb(0xfd)]||!_0x108041[_0x598edb(0xfa)])throw new Error(_0x598edb(0x103));const _0x2be778=_0x24ade7[_0x598edb(0xf0)]??defaultPresentation,_0x3fa1cf=_0x108041[_0x598edb(0x108)]===!![],_0x34d6b3={'result':_0x108041[_0x598edb(0xf7)],'command':_0x108041[_0x598edb(0x102)],'operation':_0x5755d5,'risk':_0x108041[_0x598edb(0xfd)],'format':_0x108041['format'],'dryRun':_0x3fa1cf},_0x4e0558=createLovrabetWriteMetadata(_0x35a4f6[_0x598edb(0x105)],_0x5755d5,_0x108041['result'],_0x3fa1cf);let _0x45afea;try{_0x45afea=await _0x2be778['present'](_0x34d6b3);}catch(_0xfb830a){if(!_0x4e0558||_0x2be778===defaultPresentation)throw _0xfb830a;_0x45afea=await defaultPresentation['present'](_0x34d6b3);}return{'operation':_0x5755d5,'risk':_0x108041[_0x598edb(0xfd)],'mode':_0x3fa1cf?_0x598edb(0x110):_0x598edb(0x101),'result':_0x108041[_0x598edb(0xf7)],'output':_0x45afea,..._0x4e0558?{'metadata':_0x4e0558}:{}};}finally{await finalizeLovrabetRuntimeState();}});}async function confirmWriteBeforeQueue(_0x2b93c2,_0x42ff3e,_0x25619f,_0x4dd3f8){const _0x12a548=a102_0x39d1;if(_0x42ff3e[_0x12a548(0x108)]===!![]||_0x2b93c2[_0x12a548(0xfd)]!==_0x12a548(0xf4)&&_0x2b93c2['risk']!=='high-risk-write')return;await _0x4dd3f8[_0x12a548(0xf1)]['confirm'](buildLovrabetConfirmationRequest(_0x2b93c2,_0x25619f,_0x4dd3f8['signal']));}function withAbortSignal(_0x2a593a,_0x416065){return{..._0x2a593a,async 'execute'(_0x3a966a){return throwIfAborted(_0x416065),_0x2a593a['execute'](_0x3a966a);}};}function throwIfAborted(_0x35ceaf){const _0x5173f7=a102_0x39d1;if(_0x35ceaf?.[_0x5173f7(0xef)])throw _0x35ceaf[_0x5173f7(0x10b)]instanceof Error?_0x35ceaf[_0x5173f7(0x10b)]:new DOMException(_0x5173f7(0x104),_0x5173f7(0xed));}
|
package/lib/runtime/queue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a103_0x411e(_0x24b4e8,_0x5e2c8d){_0x24b4e8=_0x24b4e8-0x123;const _0x5adcd4=a103_0x5adc();let _0x411e78=_0x5adcd4[_0x24b4e8];return _0x411e78;}(function(_0x514638,_0x4ebcce){const _0x4477e1=a103_0x411e,_0x684105=_0x514638();while(!![]){try{const _0x35a44b=parseInt(_0x4477e1(0x12d))/0x1+-parseInt(_0x4477e1(0x124))/0x2*(parseInt(_0x4477e1(0x123))/0x3)+parseInt(_0x4477e1(0x12e))/0x4*(parseInt(_0x4477e1(0x12c))/0x5)+parseInt(_0x4477e1(0x12b))/0x6+parseInt(_0x4477e1(0x129))/0x7+-parseInt(_0x4477e1(0x126))/0x8*(-parseInt(_0x4477e1(0x12a))/0x9)+parseInt(_0x4477e1(0x125))/0xa*(-parseInt(_0x4477e1(0x128))/0xb);if(_0x35a44b===_0x4ebcce)break;else _0x684105['push'](_0x684105['shift']());}catch(_0x135152){_0x684105['push'](_0x684105['shift']());}}}(a103_0x5adc,0xd2817));function a103_0x5adc(){const _0x39e100=['68253vnoUyM','54BCeJwO','9400BMzMEb','184hJPyRJ','catch','45991pxqoFT','10289769egMCyf','77202uvXoCh','10037628rkofrZ','30HIgIJm','900415JkxjGf','777356dBiNZj'];a103_0x5adc=function(){return _0x39e100;};return a103_0x5adc();}let tail=Promise['resolve']();export async function runSerialized(_0x347cee){const _0x41c8cb=a103_0x411e,_0xac8a08=tail;let _0x534702;tail=new Promise(_0x306e31=>{_0x534702=_0x306e31;}),await _0xac8a08[_0x41c8cb(0x127)](()=>undefined);try{return await _0x347cee();}finally{_0x534702();}}
|
package/lib/runtime/resolve.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4634e4,_0xc31e42){const _0x1be9da=a104_0x17c1,_0xa9c617=_0x4634e4();while(!![]){try{const _0x4a7dbe=parseInt(_0x1be9da(0x1a7))/0x1+parseInt(_0x1be9da(0x1b3))/0x2+-parseInt(_0x1be9da(0x1a6))/0x3*(-parseInt(_0x1be9da(0x1af))/0x4)+parseInt(_0x1be9da(0x1a5))/0x5+parseInt(_0x1be9da(0x1a4))/0x6+parseInt(_0x1be9da(0x1b2))/0x7+-parseInt(_0x1be9da(0x1a1))/0x8;if(_0x4a7dbe===_0xc31e42)break;else _0xa9c617['push'](_0xa9c617['shift']());}catch(_0x1ef9b9){_0xa9c617['push'](_0xa9c617['shift']());}}}(a104_0x33df,0xd1fa2));function a104_0x17c1(_0x5ec501,_0x5064ef){_0x5ec501=_0x5ec501-0x19e;const _0x33df2c=a104_0x33df();let _0x17c129=_0x33df2c[_0x5ec501];return _0x17c129;}import a104_0x393738 from'meow';import{findDefinition,getServiceEntry,isKnownService,resolveRemovedCommand}from'../commands/registry.js';import{resolveDynamicServiceCommand}from'../commands/service/dynamic.js';import{buildMeowFlags}from'../constant/cli.js';import{CliErrors}from'../errors.js';export async function resolveLovrabetInvocation(_0x13b0e0){const _0x170de9=a104_0x17c1,_0x3f2628=a104_0x393738('',{'importMeta':import.meta,'argv':_0x13b0e0,'flags':buildMeowFlags(),'autoHelp':![],'autoVersion':![]}),_0x5c273e=[..._0x3f2628[_0x170de9(0x1ab)]],_0x3ea234=_0x3f2628[_0x170de9(0x1a3)];await correctFlags(_0x3ea234);const _0x3634aa=_0x5c273e[0x0];if(!_0x3634aa)throw CliErrors[_0x170de9(0x1ad)](_0x170de9(0x19f));const _0x4ee15e=resolveRemovedCommand(_0x3634aa,_0x5c273e[0x1]);if(_0x4ee15e)throw CliErrors[_0x170de9(0x1ad)](_0x4ee15e[_0x170de9(0x19e)],_0x4ee15e[_0x170de9(0x1a0)]);if(!isKnownService(_0x3634aa)){const _0x5c8a82=resolveDynamicServiceCommand(_0x5c273e,_0x3ea234);if(!_0x5c8a82)throw CliErrors[_0x170de9(0x1ae)](_0x5c273e[_0x170de9(0x1a8)]('\x20'));return Object[_0x170de9(0x1b1)](_0x3ea234,_0x5c8a82[_0x170de9(0x1a3)]),{'definition':_0x5c8a82['definition'],'rawFlags':_0x3ea234,'args':_0x5c8a82[_0x170de9(0x1b4)]};}const _0x31682a=getServiceEntry(_0x3634aa),_0x5d5a7b=_0x5c273e[0x1]||_0x31682a[_0x170de9(0x1ac)];if(!_0x5d5a7b)throw CliErrors[_0x170de9(0x1ad)](_0x170de9(0x1a9)+_0x3634aa+'\x22.');const _0x312197=findDefinition(_0x3634aa,_0x5d5a7b);if(!_0x312197)throw CliErrors[_0x170de9(0x1ae)](_0x3634aa+'\x20'+_0x5d5a7b);return{'definition':_0x312197,'rawFlags':_0x3ea234,'args':_0x5c273e[_0x170de9(0x1a2)](0x2)};}async function correctFlags(_0x2e7fb4){const _0x51209c=a104_0x17c1;try{const {correctFlags:_0xe1f699}=await import('../framework/preparse.js'),{getAllDefinitions:_0x32b85e}=await import(_0x51209c(0x1b0)),_0x2cdc41=_0x32b85e()[_0x51209c(0x1aa)](_0x587a79=>_0x587a79[_0x51209c(0x1a3)]??[]),_0xa5ec84=_0xe1f699(_0x2e7fb4,_0x2cdc41);Object[_0x51209c(0x1b1)](_0x2e7fb4,_0xa5ec84[_0x51209c(0x1a3)]);}catch{}}function a104_0x33df(){const _0x2f71f3=['flags','2948844wxpwbd','1067590KgtBhD','3QwEhJe','963429WnCGqf','join','Lovrabet\x20argv\x20must\x20include\x20a\x20command\x20for\x20service\x20\x22','flatMap','input','defaultCommand','validation','unknownCommand','934356LbGLyJ','../commands/registry.js','assign','8306697DYVsYp','2581218BKVJkv','args','message','Lovrabet\x20argv\x20must\x20include\x20a\x20service\x20and\x20command.','hint','28153792qdTdeP','slice'];a104_0x33df=function(){return _0x2f71f3;};return a104_0x33df();}
|
|
@@ -4,8 +4,27 @@
|
|
|
4
4
|
* The runtime CLI currently only needs the `npx skills add <repo> -g -y`
|
|
5
5
|
* flow, so this module intentionally keeps the surface area narrow.
|
|
6
6
|
*/
|
|
7
|
+
import { type ResolveSkillPresenceOptions } from "../skills/skill-presence.js";
|
|
7
8
|
/** Source repository consumed by the public `skills` ecosystem. */
|
|
8
9
|
export declare const LOVRABET_SKILL_SOURCE: "lovrabet/lovrabet-cli";
|
|
10
|
+
/** Internal CodeUp Git source that installs the same global Skill. */
|
|
11
|
+
export declare const LOVRABET_SKILL_GIT_SOURCE: "git@codeup.aliyun.com:yuntoo/open/lovrabet-runtime-cli.git";
|
|
12
|
+
/** Global Skill directory name produced by installing {@link LOVRABET_SKILL_SOURCE}. */
|
|
13
|
+
export declare const LOVRABET_GLOBAL_SKILL_NAME: "lovrabet";
|
|
14
|
+
/**
|
|
15
|
+
* Resolves the global Skill name installed by a given source.
|
|
16
|
+
*
|
|
17
|
+
* Known sources (published shorthand and internal CodeUp Git remote) map to the same
|
|
18
|
+
* Skill name. Unknown sources return `undefined`, which skips install-state
|
|
19
|
+
* verification rather than guessing an artifact name.
|
|
20
|
+
*
|
|
21
|
+
* The lookup lives inside the function body (not a top-level const) so obfuscator
|
|
22
|
+
* statement reordering cannot trigger a TDZ error.
|
|
23
|
+
*
|
|
24
|
+
* @param source - Install source passed to `npx skills add`.
|
|
25
|
+
* @returns The global Skill name for known sources, otherwise `undefined`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveGlobalSkillName(source: string): string | undefined;
|
|
9
28
|
/** Skip flag used by tests or offline automation. */
|
|
10
29
|
export declare const LOVRABET_SKIP_NPX_SKILLS_ENV: string;
|
|
11
30
|
/**
|
|
@@ -14,6 +33,7 @@ export declare const LOVRABET_SKIP_NPX_SKILLS_ENV: string;
|
|
|
14
33
|
export interface RunNpxSkillsAddResult {
|
|
15
34
|
ok: boolean;
|
|
16
35
|
status: number | null;
|
|
36
|
+
code?: NpxSkillsErrorCode;
|
|
17
37
|
error?: string;
|
|
18
38
|
/** `true` when execution was intentionally skipped via env var. */
|
|
19
39
|
skipped?: boolean;
|
|
@@ -24,7 +44,17 @@ export interface RunNpxSkillsAddResult {
|
|
|
24
44
|
export interface RunNpxSkillsAddOptions {
|
|
25
45
|
/** Child stdio mode. `inherit` for local use, `pipe` for tests/CI. */
|
|
26
46
|
stdio?: "inherit" | "pipe";
|
|
47
|
+
/** Override how global Skill install state is probed (isolated environments or tests). */
|
|
48
|
+
presence?: ResolveSkillPresenceOptions;
|
|
27
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Failure classification.
|
|
52
|
+
*
|
|
53
|
+
* Prefers stable OS/Node signals and locally resolvable install state. The only
|
|
54
|
+
* output-derived classification is the installer's `Failed to install N` summary;
|
|
55
|
+
* all other installer text is attached to `error` as diagnostics.
|
|
56
|
+
*/
|
|
57
|
+
export type NpxSkillsErrorCode = "NPX_NOT_FOUND" | "PERMISSION_DENIED" | "SPAWN_FAILED" | "CHILD_TERMINATED" | "CHILD_EXIT_NONZERO" | "INSTALL_PARTIAL" | "SKILL_NOT_INSTALLED";
|
|
28
58
|
/**
|
|
29
59
|
* Returns whether the external `skills` invocation should be skipped.
|
|
30
60
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a106_0x11dc23=a106_0x5dcd;(function(_0x2fab7d,_0x254b68){const _0x79876f=a106_0x5dcd,_0x58c355=_0x2fab7d();while(!![]){try{const _0x4c3af0=-parseInt(_0x79876f(0x18b))/0x1+-parseInt(_0x79876f(0x191))/0x2+parseInt(_0x79876f(0x182))/0x3+-parseInt(_0x79876f(0x18f))/0x4+parseInt(_0x79876f(0x16f))/0x5+-parseInt(_0x79876f(0x17c))/0x6*(-parseInt(_0x79876f(0x185))/0x7)+parseInt(_0x79876f(0x174))/0x8;if(_0x4c3af0===_0x254b68)break;else _0x58c355['push'](_0x58c355['shift']());}catch(_0x5561ff){_0x58c355['push'](_0x58c355['shift']());}}}(a106_0x1de5,0x9ac5f));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a106_0x4f088d}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a106_0x1de5(){const _0x35ca12=['PERMISSION_DENIED','871639mDOWLu','unverifiable','add','signal','1269852IAFphS','CHILD_EXIT_NONZERO','2119910ZqubPJ','NPX_NOT_FOUND','log','SPAWN_FAILED','code','\x20failed\x20target(s)','EACCES','checked','absent','trim','\x22\x20install\x20state:\x20','EPERM','5261875CFJsMA','unknown','state','reason','match','9016272ncHytm','npx','stderr','stdout','join','presence','INSTALL_PARTIAL','message','12024qTvvOb','skills','stdio','internalSkillSource','pipe','error','1834245rSGZpc','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','exit\x20','322QCPuJE','toString','status','npx\x20terminated\x20by\x20signal\x20','skipNpxSkillsEnvSuffix'];a106_0x1de5=function(){return _0x35ca12;};return a106_0x1de5();}export const LOVRABET_SKILL_SOURCE=a106_0x4f088d;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a106_0x11dc23(0x17f)];function a106_0x5dcd(_0x3ec4c8,_0x1a4abc){_0x3ec4c8=_0x3ec4c8-0x168;const _0x1de536=a106_0x1de5();let _0x5dcd89=_0x1de536[_0x3ec4c8];return _0x5dcd89;}export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x22d616){const _0x12349c=a106_0x11dc23;switch(_0x22d616[_0x12349c(0x16c)]()){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[a106_0x11dc23(0x189)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x29bad3,_0xa368d7,_0x176b1e){return{'ok':![],'status':_0xa368d7,'code':_0x29bad3,'error':'['+_0x29bad3+']\x20'+_0x176b1e};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x3ff68e,_0x27956f=LOVRABET_SKILL_SOURCE,_0x5741f1){const _0x54d40d=a106_0x11dc23;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x380391=resolveNpmBin(_0x54d40d(0x175)),_0x279416=[_0x54d40d(0x17d),_0x54d40d(0x18d),_0x27956f,'-g','-y'],_0x53398e=[_0x380391,..._0x279416][_0x54d40d(0x178)]('\x20');console['log']('*\x20'+_0x53398e);const _0x3d69bb=spawnSync(_0x380391,_0x279416,{'cwd':_0x3ff68e,'stdio':_0x54d40d(0x180),'env':process.env,'shell':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x5bb746=[_0x3d69bb[_0x54d40d(0x177)]?_0x3d69bb[_0x54d40d(0x177)][_0x54d40d(0x186)]():'',_0x3d69bb[_0x54d40d(0x176)]?_0x3d69bb[_0x54d40d(0x176)]['toString']():'']['filter'](Boolean)[_0x54d40d(0x178)]('\x0a')[_0x54d40d(0x16c)]();_0x5741f1?.[_0x54d40d(0x17e)]!==_0x54d40d(0x180)&&_0x5bb746&&console[_0x54d40d(0x193)](_0x5bb746);if(_0x3d69bb['error']){const _0x2dd6bb=_0x3d69bb[_0x54d40d(0x181)],_0xa6f294=_0x2dd6bb[_0x54d40d(0x195)]==='ENOENT'?_0x54d40d(0x192):_0x2dd6bb[_0x54d40d(0x195)]===_0x54d40d(0x16e)||_0x2dd6bb[_0x54d40d(0x195)]===_0x54d40d(0x169)?_0x54d40d(0x18a):_0x54d40d(0x194);return failure(_0xa6f294,_0x3d69bb[_0x54d40d(0x187)],_0x2dd6bb[_0x54d40d(0x17b)]);}if(_0x3d69bb[_0x54d40d(0x18e)])return failure('CHILD_TERMINATED',_0x3d69bb[_0x54d40d(0x187)],_0x54d40d(0x188)+_0x3d69bb['signal']);if(_0x3d69bb[_0x54d40d(0x187)]!==0x0)return failure(_0x54d40d(0x190),_0x3d69bb['status'],_0x5bb746||_0x54d40d(0x184)+(_0x3d69bb['status']??_0x54d40d(0x170)));const _0x49d04=_0x5bb746[_0x54d40d(0x173)](/Failed to install\s+(\d+)/i);if(_0x49d04&&Number(_0x49d04[0x1])>0x0)return failure(_0x54d40d(0x17a),0x0,'Installer\x20reported\x20'+_0x49d04[0x1]+_0x54d40d(0x168)+(_0x5bb746?':\x0a'+_0x5bb746:''));const _0x4ec82d=resolveGlobalSkillName(_0x27956f);if(_0x4ec82d){const _0x6b4fba=resolveInstalledSkill(_0x4ec82d,_0x5741f1?.[_0x54d40d(0x179)]);if(_0x6b4fba[_0x54d40d(0x171)]===_0x54d40d(0x16b))return failure('SKILL_NOT_INSTALLED',0x0,'Skill\x20\x22'+_0x4ec82d+_0x54d40d(0x183)+_0x6b4fba[_0x54d40d(0x16a)][_0x54d40d(0x178)](',\x20')+')');_0x6b4fba[_0x54d40d(0x171)]===_0x54d40d(0x18c)&&console['warn']('!\x20Could\x20not\x20verify\x20\x22'+_0x4ec82d+_0x54d40d(0x16d)+_0x6b4fba[_0x54d40d(0x172)]);}return{'ok':!![],'status':0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a107_0xbee8(_0x49e38b,_0x55bbc0){_0x49e38b=_0x49e38b-0x91;const _0x42f6bf=a107_0x42f6();let _0xbee8b9=_0x42f6bf[_0x49e38b];return _0xbee8b9;}const a107_0x5b37bc=a107_0xbee8;(function(_0x879bae,_0x2437a5){const _0x9ebacb=a107_0xbee8,_0x47a888=_0x879bae();while(!![]){try{const _0x3b5906=-parseInt(_0x9ebacb(0x95))/0x1+-parseInt(_0x9ebacb(0x9f))/0x2+-parseInt(_0x9ebacb(0x9c))/0x3+-parseInt(_0x9ebacb(0x9a))/0x4+parseInt(_0x9ebacb(0x9e))/0x5*(-parseInt(_0x9ebacb(0x99))/0x6)+-parseInt(_0x9ebacb(0x93))/0x7+-parseInt(_0x9ebacb(0x97))/0x8*(-parseInt(_0x9ebacb(0xa1))/0x9);if(_0x3b5906===_0x2437a5)break;else _0x47a888['push'](_0x47a888['shift']());}catch(_0x142450){_0x47a888['push'](_0x47a888['shift']());}}}(a107_0x42f6,0x55004));export const METADATA_FILE=a107_0x5b37bc(0x91);function a107_0x42f6(){const _0x49eb71=['54Qxsmnp','856980RaSmho','.hg','283119ROKAvQ','.DS_Store','105265CeQBHw','1152774nmffkB','node_modules','9GzfuZT','lovrabet.skill.json','.cache','3964751WDfRDJ','.next','58390HGutQD','.turbo','16379432uShjgw','.svn'];a107_0x42f6=function(){return _0x49eb71;};return a107_0x42f6();}export const SKILL_FILE='SKILL.md';export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a107_0x5b37bc(0x9d)]);export const IGNORED_DIR_NAMES=new Set(['.git',a107_0x5b37bc(0x9b),a107_0x5b37bc(0x98),a107_0x5b37bc(0xa0),a107_0x5b37bc(0x94),'dist','build','coverage',a107_0x5b37bc(0x96),a107_0x5b37bc(0x92)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x157849,_0x2424dc){const _0x20e99f=a108_0x3b05,_0xf7b8bc=_0x157849();while(!![]){try{const _0x417ad7=-parseInt(_0x20e99f(0x1d9))/0x1*(parseInt(_0x20e99f(0x1d5))/0x2)+-parseInt(_0x20e99f(0x1cf))/0x3*(parseInt(_0x20e99f(0x1dd))/0x4)+-parseInt(_0x20e99f(0x1cb))/0x5+parseInt(_0x20e99f(0x1d6))/0x6*(parseInt(_0x20e99f(0x1ca))/0x7)+-parseInt(_0x20e99f(0x1d0))/0x8*(parseInt(_0x20e99f(0x1d7))/0x9)+parseInt(_0x20e99f(0x1dc))/0xa*(-parseInt(_0x20e99f(0x1cc))/0xb)+parseInt(_0x20e99f(0x1cd))/0xc;if(_0x417ad7===_0x2424dc)break;else _0xf7b8bc['push'](_0xf7b8bc['shift']());}catch(_0x5322af){_0xf7b8bc['push'](_0xf7b8bc['shift']());}}}(a108_0x4c77,0xbd24b));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';function a108_0x4c77(){const _0x401c2e=['16FSTpcs','isSymbolicLink','from','.tmp','utf8','10aewRHv','1974JlQKMd','4315833AoIhkB','split','94669CzMBhb','endsWith','stringify','172690YTuuff','561764mdzasC','Unsafe\x20Skill\x20file\x20path:\x20','22036lDMksI','7111645PxiKFg','583EFFSkn','58961448CeSxWs','validation','30AtGqAO'];a108_0x4c77=function(){return _0x401c2e;};return a108_0x4c77();}import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x39fd48,_0x9cc58a){const _0x295662=a108_0x3b05,_0x3c96c8=normalizeSkillRelativePath(_0x9cc58a),_0x586fb7=realOrResolved(_0x39fd48),_0x522934=resolve(_0x586fb7,..._0x3c96c8['split']('/'));if(!isPathInside(_0x522934,_0x586fb7))throw CliErrors[_0x295662(0x1ce)](_0x295662(0x1de)+_0x9cc58a);return ensureNoSymlinkInManagedPath(_0x586fb7,_0x3c96c8),_0x522934;}export function ensureNoSymlinkInManagedPath(_0x44bb86,_0x4cfbbb){const _0x26f310=a108_0x3b05;let _0x19836e=_0x44bb86;for(const _0x1114a3 of _0x4cfbbb[_0x26f310(0x1d8)]('/')){_0x19836e=resolve(_0x19836e,_0x1114a3);const _0x2bb3fe=lstatIfPresent(_0x19836e);if(_0x2bb3fe?.[_0x26f310(0x1d1)]())throw CliErrors['validation']('Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'+_0x4cfbbb);}}export function isDanglingSymlink(_0x24df66){const _0x1e70d9=a108_0x3b05;try{return lstatSync(_0x24df66)[_0x1e70d9(0x1d1)]();}catch{return![];}}export function resolveSymlinkTarget(_0x366c27){const _0x2e2b45=readlinkSync(_0x366c27);return isAbsolute(_0x2e2b45)?_0x2e2b45:resolve(dirname(_0x366c27),_0x2e2b45);}export function isPathInside(_0x4e5f29,_0x21e688){const _0x5483b0=a108_0x3b05,_0x54a0fd=_0x4e5f29[_0x5483b0(0x1da)](sep)?_0x4e5f29:''+_0x4e5f29+sep,_0x539326=_0x21e688[_0x5483b0(0x1da)](sep)?_0x21e688:''+_0x21e688+sep;return _0x4e5f29===_0x21e688||_0x54a0fd['startsWith'](_0x539326);}function a108_0x3b05(_0x3b0565,_0x28b692){_0x3b0565=_0x3b0565-0x1ca;const _0x4c7794=a108_0x4c77();let _0x3b05c0=_0x4c7794[_0x3b0565];return _0x3b05c0;}export function realOrResolved(_0x234f91){try{return realpathSync(_0x234f91);}catch{return resolve(_0x234f91);}}export function lstatIfPresent(_0x1b7950){try{return lstatSync(_0x1b7950);}catch{return undefined;}}export function writeTextAtomic(_0x599e23,_0x1a9bd2,_0x63af1e){const _0xe39986=a108_0x3b05;writeBytesAtomic(_0x599e23,Buffer[_0xe39986(0x1d2)](_0x1a9bd2,_0xe39986(0x1d4)),_0x63af1e);}export function writeBytesAtomic(_0xa94f0d,_0x1ec328,_0x178db1){const _0xc91b5a=a108_0x3b05,_0xa1fa58=_0xa94f0d+_0xc91b5a(0x1d3);try{writeFileSync(_0xa1fa58,_0x1ec328,{'mode':_0x178db1}),renameSync(_0xa1fa58,_0xa94f0d);}catch(_0x1af306){try{rmSync(_0xa1fa58,{'force':!![]});}catch{}throw _0x1af306;}}export function writeJsonAtomic(_0x47318d,_0x21d5f7){const _0x3074fe=a108_0x3b05;writeTextAtomic(_0x47318d,JSON[_0x3074fe(0x1db)](_0x21d5f7,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4627a1,_0x38187b){const _0xcb3689=a109_0x1d5a,_0xf03ac9=_0x4627a1();while(!![]){try{const _0x2c63a4=-parseInt(_0xcb3689(0xde))/0x1+-parseInt(_0xcb3689(0xd6))/0x2+-parseInt(_0xcb3689(0xda))/0x3*(parseInt(_0xcb3689(0xd7))/0x4)+-parseInt(_0xcb3689(0xd8))/0x5+parseInt(_0xcb3689(0xd4))/0x6+-parseInt(_0xcb3689(0xd9))/0x7*(parseInt(_0xcb3689(0xd3))/0x8)+parseInt(_0xcb3689(0xd5))/0x9*(parseInt(_0xcb3689(0xd1))/0xa);if(_0x2c63a4===_0x38187b)break;else _0xf03ac9['push'](_0xf03ac9['shift']());}catch(_0x516b21){_0xf03ac9['push'](_0xf03ac9['shift']());}}}(a109_0x50ef,0x70985));import{createHash}from'node:crypto';function a109_0x50ef(){const _0x574a89=['1629476dFjCGv','493965mGxcnx','35FxicjQ','6znLoZW','path','update','sha256','182621JlfaPI','digest','size','18739580QrxZJT','hex','116728WUtJFt','2914410wyTtYR','9RhAonh','1458794qgjfQf'];a109_0x50ef=function(){return _0x574a89;};return a109_0x50ef();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x36de90){const _0x40cb42=a109_0x1d5a;return createHash(_0x40cb42(0xdd))[_0x40cb42(0xdc)](_0x36de90)['digest'](_0x40cb42(0xd2));}function a109_0x1d5a(_0x63bb8e,_0x2d08df){_0x63bb8e=_0x63bb8e-0xcf;const _0x50efcc=a109_0x50ef();let _0x1d5a07=_0x50efcc[_0x63bb8e];return _0x1d5a07;}export function fileHash(_0x204c4e){return bufferSha256(fileContent(_0x204c4e));}export function bufferSha256(_0xa6f7ac){const _0x577ca1=a109_0x1d5a;return createHash(_0x577ca1(0xdd))[_0x577ca1(0xdc)](_0xa6f7ac)['digest'](_0x577ca1(0xd2));}export function fileTreeHash(_0x1716c1){const _0x33ccf8=a109_0x1d5a,_0x2c3c38=createHash(_0x33ccf8(0xdd));for(const _0x3050be of normalizeManifestFiles(_0x1716c1)){_0x2c3c38[_0x33ccf8(0xdc)](_0x3050be[_0x33ccf8(0xdb)]),_0x2c3c38[_0x33ccf8(0xdc)]('\x00'),_0x2c3c38['update'](_0x3050be[_0x33ccf8(0xdd)]),_0x2c3c38['update']('\x00'),_0x2c3c38['update'](String(_0x3050be[_0x33ccf8(0xd0)])),_0x2c3c38[_0x33ccf8(0xdc)]('\x00');}return _0x2c3c38[_0x33ccf8(0xcf)]('hex');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a110_0x38ed(){const _0x3d7620=['5enFmIj','156pDeeSb','10xxphNv','cwd','1172048GMinRf','skills','30359PxrpAI','appCode','managedRoot','2024466IFxoNa','project','396QxBBet','4VIIIRL','1645049ByAhKr','.agents','70230ZgWIyN','freeze','700579IHMYqx','158328emHmat'];a110_0x38ed=function(){return _0x3d7620;};return a110_0x38ed();}(function(_0x27e3b1,_0x2a26b4){const _0x2f9f9b=a110_0x55e1,_0x411724=_0x27e3b1();while(!![]){try{const _0x106169=-parseInt(_0x2f9f9b(0xf8))/0x1*(parseInt(_0x2f9f9b(0xf4))/0x2)+-parseInt(_0x2f9f9b(0x104))/0x3*(-parseInt(_0x2f9f9b(0xfe))/0x4)+-parseInt(_0x2f9f9b(0x105))/0x5*(parseInt(_0x2f9f9b(0xfb))/0x6)+parseInt(_0x2f9f9b(0xff))/0x7+-parseInt(_0x2f9f9b(0xf6))/0x8+-parseInt(_0x2f9f9b(0xfd))/0x9*(parseInt(_0x2f9f9b(0x101))/0xa)+-parseInt(_0x2f9f9b(0x103))/0xb*(-parseInt(_0x2f9f9b(0xf3))/0xc);if(_0x106169===_0x2a26b4)break;else _0x411724['push'](_0x411724['shift']());}catch(_0x131117){_0x411724['push'](_0x411724['shift']());}}}(a110_0x38ed,0x29c08));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a110_0x55e1(_0x283283,_0x1d3d51){_0x283283=_0x283283-0xf3;const _0x38edea=a110_0x38ed();let _0x55e16f=_0x38edea[_0x283283];return _0x55e16f;}export function resolveRuntimeSkillInstallTarget(_0x46231b,_0x53c25b='global',_0x3d92c6={}){const _0x4f73c6=a110_0x55e1,_0x1a07cc=resolveSkillSyncPaths(_0x3d92c6),_0x48bb06=safePathSegment(_0x46231b,_0x4f73c6(0xf9)),_0x1548cb=_0x53c25b===_0x4f73c6(0xfc)?[resolve(_0x3d92c6[_0x4f73c6(0xf5)]??process[_0x4f73c6(0xf5)](),_0x4f73c6(0x100),_0x4f73c6(0xf7))]:runtimeAgentSkillRoots(_0x1a07cc);return Object[_0x4f73c6(0x102)]({'scope':_0x53c25b,'appCode':_0x48bb06,'skillRoots':Object[_0x4f73c6(0x102)](_0x1548cb),'managedRoot':_0x1a07cc[_0x4f73c6(0xfa)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a111_0x12bca1=a111_0x3c48;(function(_0xf116c0,_0x342140){const _0x22498e=a111_0x3c48,_0x3e0991=_0xf116c0();while(!![]){try{const _0x254521=-parseInt(_0x22498e(0x112))/0x1*(-parseInt(_0x22498e(0xfb))/0x2)+-parseInt(_0x22498e(0xe0))/0x3+-parseInt(_0x22498e(0x10d))/0x4+-parseInt(_0x22498e(0x106))/0x5+parseInt(_0x22498e(0xea))/0x6+-parseInt(_0x22498e(0x111))/0x7*(-parseInt(_0x22498e(0x108))/0x8)+-parseInt(_0x22498e(0xf3))/0x9;if(_0x254521===_0x342140)break;else _0x3e0991['push'](_0x3e0991['shift']());}catch(_0x227648){_0x3e0991['push'](_0x3e0991['shift']());}}}(a111_0x4459,0xdaa96));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a111_0x2c0a61 from'fs-extra';function a111_0x4459(){const _0x3e82ea=['Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','env','2992851FjRNef','dir','pruneSkillCodes','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','scope','accessKey','has','values','10rLWnFT','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','external-symlink','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','managedRoot','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','isSymbolicLink','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','skillCode','trim','removed','3268895XCAxcB','slice','72392aIIntn','not-managed-symlink','unchanged','secret-retriever','set','1928700smJsNZ','skipped','validation','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','217VkLrmN','356563xiASXP','updated','created','builtin','metadataPath','3049206TRnBQN','appCode','filter','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','metadata-mismatch','runtime-observe','push','name','skill','map','7903194yJhPOj','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','contentHash','isDirectory','startsWith','project','linked-from-protected-root'];a111_0x4459=function(){return _0x3e82ea;};return a111_0x4459();}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}=a111_0x2c0a61,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a111_0x12bca1(0xe5),a111_0x12bca1(0x10b)]);export function linkEffectiveRuntimeSkills(_0x133e13,_0x1d2637){const _0x5a4596=a111_0x12bca1,_0x3cdbc6=new Map();for(const _0x203ed9 of _0x133e13){const _0x279a0e=_0x203ed9[_0x5a4596(0xe8)][_0x5a4596(0x103)];if(!_0x279a0e)continue;const _0x573fe5=_0x3cdbc6['get'](_0x279a0e);(!_0x573fe5||_0x203ed9[_0x5a4596(0xf7)]==='personal')&&_0x3cdbc6[_0x5a4596(0x10c)](_0x279a0e,_0x203ed9);}const _0xdbaaca=[];for(const _0x4eba35 of _0x3cdbc6[_0x5a4596(0xfa)]()){const _0x120933=requireSkillCode(_0x4eba35[_0x5a4596(0xe8)]),_0x5492e=readMetadataIfPresent(_0x4eba35[_0x5a4596(0xdf)]);if(_0x5492e?.['appCode']!==_0x1d2637[_0x5a4596(0xe1)]||_0x5492e[_0x5a4596(0x103)]!==_0x120933)throw CliErrors[_0x5a4596(0x10f)](_0x5a4596(0x100)+_0x1d2637[_0x5a4596(0xe1)]+':\x20'+_0x4eba35[_0x5a4596(0xdf)]);const _0x498f78=runtimeSkillLinkName(_0x1d2637,_0x120933);for(const _0x79b285 of _0x1d2637['skillRoots']){_0xdbaaca['push'](ensureManagedSymlink(resolve(_0x79b285,_0x498f78),_0x4eba35[_0x5a4596(0xf4)],_0x1d2637,_0x120933));}}return _0xdbaaca;}export function pruneStaleRuntimeSkillLinks(_0x1bc293,_0x3ad6c5,_0x3b527c){const _0x2145e4=a111_0x12bca1,_0x31e2da=new Set([..._0x3ad6c5][_0x2145e4(0xe9)](_0x3f8527=>_0x3f8527['trim']())[_0x2145e4(0xe2)](Boolean)),_0x4fa77e=_0x3b527c?new Set([..._0x3b527c][_0x2145e4(0xe9)](_0xaa39c=>_0xaa39c['trim']())[_0x2145e4(0xe2)](Boolean)):undefined,_0x26317c=[];for(const _0x2dfd2b of _0x1bc293['skillRoots']){for(const _0x37fe91 of managedTargetSkillLinkPaths(_0x2dfd2b,_0x1bc293)){const _0x14f6f6=runtimeSkillCodeFromLink(_0x1bc293,_0x37fe91);if(_0x4fa77e&&!_0x4fa77e['has'](_0x14f6f6))continue;if(_0x31e2da['has'](_0x14f6f6))continue;_0x26317c[_0x2145e4(0xe6)](removeManagedSkillLink(_0x37fe91,_0x1bc293,_0x14f6f6));}}return _0x26317c;}export function pruneStaleRuntimeSkillCache(_0x236c95,_0x351ae0={}){const _0x13fbdb=a111_0x12bca1,_0x4cb238=new Set([..._0x236c95['activeSkillCodes']][_0x13fbdb(0xe9)](_0x93d5fc=>_0x93d5fc[_0x13fbdb(0x104)]())[_0x13fbdb(0xe2)](Boolean)),_0x4bde5e=_0x236c95[_0x13fbdb(0xf5)]?new Set([..._0x236c95['pruneSkillCodes']][_0x13fbdb(0xe9)](_0xbad96=>_0xbad96[_0x13fbdb(0x104)]())[_0x13fbdb(0xe2)](Boolean)):undefined,_0x2661cd=_0x236c95['scopes']??['personal','company'],_0x2a6c30=resolve(getRuntimeSkillCacheRoot(_0x236c95[_0x13fbdb(0xf2)],_0x236c95[_0x13fbdb(0xf8)],_0x351ae0),safePathSegment(_0x236c95[_0x13fbdb(0xe1)],_0x13fbdb(0xe1))),_0x31179f=[];for(const _0x284502 of _0x2661cd){const _0x2d9262=resolve(_0x2a6c30,_0x284502);if(!existsSync(_0x2d9262))continue;for(const _0x296094 of readdirSync(_0x2d9262,{'withFileTypes':!![]})){if(!_0x296094[_0x13fbdb(0xed)]())continue;const _0x3d0a8b=_0x296094[_0x13fbdb(0xe7)];if(_0x4bde5e&&!_0x4bde5e[_0x13fbdb(0xf9)](_0x3d0a8b))continue;if(_0x4cb238[_0x13fbdb(0xf9)](_0x3d0a8b))continue;const _0x37f03f=resolve(_0x2d9262,_0x3d0a8b),_0x16befa=readMetadataIfPresent(resolve(_0x37f03f,METADATA_FILE));if(_0x16befa?.[_0x13fbdb(0xe1)]!==_0x236c95[_0x13fbdb(0xe1)]||_0x16befa[_0x13fbdb(0xf7)]!==_0x284502||_0x16befa[_0x13fbdb(0x103)]!==_0x3d0a8b){_0x31179f[_0x13fbdb(0xe6)]({'path':_0x37f03f,'action':_0x13fbdb(0x10e),'reason':_0x13fbdb(0xe4)});continue;}if(isLinkedFromAnyRoot(_0x37f03f,_0x236c95['protectedLinkRoots']??[])){_0x31179f[_0x13fbdb(0xe6)]({'path':_0x37f03f,'action':_0x13fbdb(0x10e),'reason':_0x13fbdb(0xf0)});continue;}removeSync(_0x37f03f),_0x31179f[_0x13fbdb(0xe6)]({'path':_0x37f03f,'action':_0x13fbdb(0x105)});}}return _0x31179f;}export function linkGlobalRuntimeSkills(_0x23cdd1,_0x246de7={}){const _0x48f071=a111_0x12bca1,_0x2d5291=resolveSkillSyncPaths(_0x246de7),_0x146e43=[];for(const _0xaf160f of _0x23cdd1){if(_0xaf160f['scope']!==_0x48f071(0xde))throw CliErrors[_0x48f071(0x10f)](_0x48f071(0xfc)+_0xaf160f[_0x48f071(0xf7)]);const _0x233af1=requireSkillCode(_0xaf160f[_0x48f071(0xe8)]),_0x477cf1=copyManagedSkillDirectory(_0xaf160f[_0x48f071(0xf4)],resolve(_0x2d5291['agentsSkillsDir'],_0x233af1));_0x146e43[_0x48f071(0xe6)]({..._0x477cf1,'contentHash':_0xaf160f['contentHash']});}return _0x146e43;}function ensureManagedSymlink(_0x2d20eb,_0x5f4a09,_0x1eaab9,_0x34d1ca){const _0x50cfeb=a111_0x12bca1;mkdirSync(dirname(_0x2d20eb),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x2d20eb)||isDanglingSymlink(_0x2d20eb)){const _0x2d28ed=lstatSync(_0x2d20eb);if(!_0x2d28ed[_0x50cfeb(0x101)]())throw CliErrors['validation'](_0x50cfeb(0xe3)+_0x2d20eb);const _0x435588=resolveSymlinkTarget(_0x2d20eb);if(!isPathInside(realOrResolved(_0x435588),realOrResolved(_0x1eaab9[_0x50cfeb(0xff)])))throw CliErrors['validation'](_0x50cfeb(0xfe)+_0x2d20eb);if(realOrResolved(_0x435588)===realOrResolved(_0x5f4a09))return{'path':_0x2d20eb,'target':_0x5f4a09,'action':_0x50cfeb(0x10a)};const _0x53ea56=readMetadataIfPresent(resolve(_0x435588,METADATA_FILE));if(_0x1eaab9['scope']===_0x50cfeb(0xef)&&(_0x53ea56?.[_0x50cfeb(0xe1)]!==_0x1eaab9[_0x50cfeb(0xe1)]||_0x53ea56[_0x50cfeb(0x103)]!==_0x34d1ca))throw CliErrors[_0x50cfeb(0x10f)](_0x50cfeb(0xeb)+_0x2d20eb);return unlinkSync(_0x2d20eb),symlinkSync(_0x5f4a09,_0x2d20eb,_0x50cfeb(0xf4)),{'path':_0x2d20eb,'target':_0x5f4a09,'action':_0x50cfeb(0xdc)};}return symlinkSync(_0x5f4a09,_0x2d20eb,_0x50cfeb(0xf4)),{'path':_0x2d20eb,'target':_0x5f4a09,'action':'created'};}function managedTargetSkillLinkPaths(_0x4b22dd,_0x1bd21a){const _0x4c523e=a111_0x12bca1;if(!existsSync(_0x4b22dd))return[];const _0x52591f=_0x1bd21a[_0x4c523e(0xe1)]+'--';return readdirSync(_0x4b22dd,{'withFileTypes':!![]})['filter'](_0x52ee5e=>_0x1bd21a['scope']===_0x4c523e(0xef)||_0x52ee5e['name'][_0x4c523e(0xee)](_0x52591f))[_0x4c523e(0xe9)](_0x371c9e=>resolve(_0x4b22dd,_0x371c9e[_0x4c523e(0xe7)]));}function removeManagedSkillLink(_0x50b936,_0x2d8859,_0x3d6023){const _0x1fbe8b=a111_0x12bca1,_0x4b87d5=lstatIfPresent(_0x50b936);if(!_0x4b87d5?.['isSymbolicLink']())return{'path':_0x50b936,'action':_0x1fbe8b(0x10e),'reason':_0x1fbe8b(0x109)};const _0x4c0197=resolveSymlinkTarget(_0x50b936);if(!isPathInside(realOrResolved(_0x4c0197),realOrResolved(_0x2d8859[_0x1fbe8b(0xff)])))return{'path':_0x50b936,'action':'skipped','reason':_0x1fbe8b(0xfd)};const _0x3c156c=readMetadataIfPresent(resolve(_0x4c0197,METADATA_FILE));if(_0x2d8859[_0x1fbe8b(0xf7)]===_0x1fbe8b(0xef)&&(_0x3c156c?.[_0x1fbe8b(0xe1)]!==_0x2d8859['appCode']||_0x3c156c[_0x1fbe8b(0x103)]!==_0x3d6023))return{'path':_0x50b936,'action':_0x1fbe8b(0x10e),'reason':'metadata-mismatch'};return unlinkSync(_0x50b936),{'path':_0x50b936,'action':_0x1fbe8b(0x105)};}function a111_0x3c48(_0x57761e,_0x2d1e9f){_0x57761e=_0x57761e-0xdc;const _0x44595e=a111_0x4459();let _0x3c48e7=_0x44595e[_0x57761e];return _0x3c48e7;}function isLinkedFromAnyRoot(_0x3a1c31,_0x105461){const _0x38cefc=a111_0x12bca1,_0x41af61=realOrResolved(_0x3a1c31);for(const _0x2545c9 of _0x105461){if(!existsSync(_0x2545c9))continue;for(const _0x531291 of readdirSync(_0x2545c9,{'withFileTypes':!![]})){if(!_0x531291[_0x38cefc(0x101)]())continue;const _0x4aafe4=resolve(_0x2545c9,_0x531291[_0x38cefc(0xe7)]);if(realOrResolved(resolveSymlinkTarget(_0x4aafe4))===_0x41af61)return!![];}}return![];}function runtimeSkillLinkName(_0x30de39,_0x163eb6){const _0x5e2b3b=a111_0x12bca1,_0x3036ac=safePathSegment(_0x163eb6,'skillCode');if(_0x30de39[_0x5e2b3b(0xf7)]==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x5e2b3b(0xf9)](_0x3036ac))throw CliErrors['validation'](_0x5e2b3b(0x102)+_0x3036ac);return _0x30de39['scope']==='project'?_0x3036ac:_0x30de39[_0x5e2b3b(0xe1)]+'--'+_0x3036ac;}function runtimeSkillCodeFromLink(_0x3f718e,_0x56d075){const _0x55cfc9=a111_0x12bca1,_0xb9c2d5=basename(_0x56d075);return _0x3f718e[_0x55cfc9(0xf7)]===_0x55cfc9(0xef)?_0xb9c2d5:_0xb9c2d5[_0x55cfc9(0x107)]((_0x3f718e[_0x55cfc9(0xe1)]+'--')['length']);}export function copyManagedSkillDirectory(_0x1e9381,_0x4ed0cf){const _0x306d53=a111_0x12bca1,_0x22ccad=resolve(_0x4ed0cf,METADATA_FILE),_0x1a8277=existsSync(_0x4ed0cf);if(_0x1a8277){const _0x5e4307=lstatSync(_0x4ed0cf);if(_0x5e4307['isSymbolicLink']())throw CliErrors[_0x306d53(0x10f)](_0x306d53(0xf6)+_0x4ed0cf);if(!_0x5e4307['isDirectory']())throw CliErrors[_0x306d53(0x10f)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x4ed0cf);const _0x1d29a5=readMetadataIfPresent(_0x22ccad);if(_0x1d29a5?.['scope']!==_0x306d53(0xde))throw CliErrors[_0x306d53(0x10f)](_0x306d53(0x110)+_0x4ed0cf);}ensureDirSync(dirname(_0x4ed0cf));const _0x349e9b=_0x1a8277?readMetadataIfPresent(_0x22ccad)?.[_0x306d53(0xec)]:undefined,_0x25a40d=readMetadataIfPresent(resolve(_0x1e9381,METADATA_FILE))?.[_0x306d53(0xec)];return _0x1a8277&&removeSync(_0x4ed0cf),copySkillDirectory(_0x1e9381,_0x4ed0cf),{'path':_0x4ed0cf,'target':_0x1e9381,'action':!_0x1a8277?_0x306d53(0xdd):_0x349e9b===_0x25a40d?_0x306d53(0x10a):'updated'};}function copySkillDirectory(_0x11d466,_0x17fb46){copySync(_0x11d466,_0x17fb46,{'dereference':![],'overwrite':!![],'filter'(_0x2ea030){const _0x3b4bf0=a111_0x3c48;if(lstatSync(_0x2ea030)[_0x3b4bf0(0x101)]())throw CliErrors['validation'](_0x3b4bf0(0xf1)+_0x2ea030);return!![];}});}
|
|
1
|
+
const a111_0x4b2fee=a111_0x3040;(function(_0x5b7bde,_0x2bda19){const _0x29b6e7=a111_0x3040,_0x1b35c8=_0x5b7bde();while(!![]){try{const _0x35ba14=-parseInt(_0x29b6e7(0x1d1))/0x1+-parseInt(_0x29b6e7(0x1db))/0x2*(parseInt(_0x29b6e7(0x1cd))/0x3)+parseInt(_0x29b6e7(0x1c7))/0x4*(parseInt(_0x29b6e7(0x1c5))/0x5)+-parseInt(_0x29b6e7(0x1f2))/0x6+parseInt(_0x29b6e7(0x1ce))/0x7*(parseInt(_0x29b6e7(0x1c4))/0x8)+-parseInt(_0x29b6e7(0x1e6))/0x9+parseInt(_0x29b6e7(0x1e3))/0xa;if(_0x35ba14===_0x2bda19)break;else _0x1b35c8['push'](_0x1b35c8['shift']());}catch(_0x3cfe2a){_0x1b35c8['push'](_0x1b35c8['shift']());}}}(a111_0x474b,0x25a93));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a111_0x445c91 from'fs-extra';import{CliErrors}from'../../errors.js';function a111_0x474b(){const _0x1a8142=['appCode','skipped','filter','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','has','activeSkillCodes','6cpdqGi','metadataPath','skill','isSymbolicLink','skillCode','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','created','personal','5226580tzVLiO','accessKey','metadata-mismatch','824706KfurUd','scope','dir','pruneSkillCodes','validation','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','project','values','updated','contentHash','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','length','1412982hoFUXn','isDirectory','secret-retriever','removed','runtime-observe','external-symlink','trim','agentsSkillsDir','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','name','lovrabet','1257864pTkQoE','23210qIXPwn','map','188RIuCtA','startsWith','env','managedRoot','builtin','set','277674NIHAVs','7KwuGOu','push','unchanged','139001lubTnL','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','slice','scopes'];a111_0x474b=function(){return _0x1a8142;};return a111_0x474b();}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}=a111_0x445c91,RESERVED_PROJECT_SKILL_CODES=new Set([a111_0x4b2fee(0x1c3),a111_0x4b2fee(0x1bd),a111_0x4b2fee(0x1f4)]);export function linkEffectiveRuntimeSkills(_0x56d39a,_0xdf5747){const _0x5aa808=a111_0x4b2fee,_0xc5c708=new Map();for(const _0x4f2fab of _0x56d39a){const _0x4992a6=_0x4f2fab['skill'][_0x5aa808(0x1df)];if(!_0x4992a6)continue;const _0x16d9ae=_0xc5c708['get'](_0x4992a6);(!_0x16d9ae||_0x4f2fab['scope']===_0x5aa808(0x1e2))&&_0xc5c708[_0x5aa808(0x1cc)](_0x4992a6,_0x4f2fab);}const _0x47ed21=[];for(const _0x532e7c of _0xc5c708[_0x5aa808(0x1ed)]()){const _0x3a0443=requireSkillCode(_0x532e7c['skill']),_0x1c867f=readMetadataIfPresent(_0x532e7c[_0x5aa808(0x1dc)]);if(_0x1c867f?.[_0x5aa808(0x1d5)]!==_0xdf5747[_0x5aa808(0x1d5)]||_0x1c867f[_0x5aa808(0x1df)]!==_0x3a0443)throw CliErrors[_0x5aa808(0x1ea)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0xdf5747['appCode']+':\x20'+_0x532e7c[_0x5aa808(0x1dc)]);const _0xae67e=runtimeSkillLinkName(_0xdf5747,_0x3a0443);for(const _0x34f9e3 of _0xdf5747['skillRoots']){_0x47ed21[_0x5aa808(0x1cf)](ensureManagedSymlink(resolve(_0x34f9e3,_0xae67e),_0x532e7c[_0x5aa808(0x1e8)],_0xdf5747,_0x3a0443));}}return _0x47ed21;}export function pruneStaleRuntimeSkillLinks(_0x333220,_0x54a1bd,_0x346c1d){const _0x11355e=a111_0x4b2fee,_0x5a6261=new Set([..._0x54a1bd]['map'](_0x546281=>_0x546281[_0x11355e(0x1bf)]())[_0x11355e(0x1d7)](Boolean)),_0x48eea4=_0x346c1d?new Set([..._0x346c1d]['map'](_0x53452e=>_0x53452e[_0x11355e(0x1bf)]())[_0x11355e(0x1d7)](Boolean)):undefined,_0x3e9c69=[];for(const _0x565975 of _0x333220['skillRoots']){for(const _0x12b390 of managedTargetSkillLinkPaths(_0x565975,_0x333220)){const _0x2c2ca0=runtimeSkillCodeFromLink(_0x333220,_0x12b390);if(_0x48eea4&&!_0x48eea4[_0x11355e(0x1d9)](_0x2c2ca0))continue;if(_0x5a6261['has'](_0x2c2ca0))continue;_0x3e9c69['push'](removeManagedSkillLink(_0x12b390,_0x333220,_0x2c2ca0));}}return _0x3e9c69;}export function pruneStaleRuntimeSkillCache(_0x4c0d2e,_0x144e4e={}){const _0x402960=a111_0x4b2fee,_0x27cb7c=new Set([..._0x4c0d2e[_0x402960(0x1da)]][_0x402960(0x1c6)](_0x794cad=>_0x794cad['trim']())[_0x402960(0x1d7)](Boolean)),_0x5b0d9d=_0x4c0d2e[_0x402960(0x1e9)]?new Set([..._0x4c0d2e[_0x402960(0x1e9)]][_0x402960(0x1c6)](_0x1a9220=>_0x1a9220[_0x402960(0x1bf)]())[_0x402960(0x1d7)](Boolean)):undefined,_0x4477b2=_0x4c0d2e[_0x402960(0x1d4)]??[_0x402960(0x1e2),'company'],_0x5599de=resolve(getRuntimeSkillCacheRoot(_0x4c0d2e[_0x402960(0x1c9)],_0x4c0d2e[_0x402960(0x1e4)],_0x144e4e),safePathSegment(_0x4c0d2e[_0x402960(0x1d5)],_0x402960(0x1d5))),_0x50d5dc=[];for(const _0x498d7b of _0x4477b2){const _0x1e86d1=resolve(_0x5599de,_0x498d7b);if(!existsSync(_0x1e86d1))continue;for(const _0x4a6584 of readdirSync(_0x1e86d1,{'withFileTypes':!![]})){if(!_0x4a6584[_0x402960(0x1f3)]())continue;const _0x21ed51=_0x4a6584[_0x402960(0x1c2)];if(_0x5b0d9d&&!_0x5b0d9d['has'](_0x21ed51))continue;if(_0x27cb7c[_0x402960(0x1d9)](_0x21ed51))continue;const _0x52fc24=resolve(_0x1e86d1,_0x21ed51),_0x47e01f=readMetadataIfPresent(resolve(_0x52fc24,METADATA_FILE));if(_0x47e01f?.['appCode']!==_0x4c0d2e[_0x402960(0x1d5)]||_0x47e01f[_0x402960(0x1e7)]!==_0x498d7b||_0x47e01f[_0x402960(0x1df)]!==_0x21ed51){_0x50d5dc[_0x402960(0x1cf)]({'path':_0x52fc24,'action':'skipped','reason':_0x402960(0x1e5)});continue;}if(isLinkedFromAnyRoot(_0x52fc24,_0x4c0d2e['protectedLinkRoots']??[])){_0x50d5dc['push']({'path':_0x52fc24,'action':_0x402960(0x1d6),'reason':'linked-from-protected-root'});continue;}removeSync(_0x52fc24),_0x50d5dc[_0x402960(0x1cf)]({'path':_0x52fc24,'action':'removed'});}}return _0x50d5dc;}export function linkGlobalRuntimeSkills(_0x41e6c4,_0x2707c6={}){const _0x19d7a=a111_0x4b2fee,_0x540ca6=resolveSkillSyncPaths(_0x2707c6),_0x5eb473=[];for(const _0x3a5dc7 of _0x41e6c4){if(_0x3a5dc7[_0x19d7a(0x1e7)]!==_0x19d7a(0x1cb))throw CliErrors[_0x19d7a(0x1ea)](_0x19d7a(0x1e0)+_0x3a5dc7[_0x19d7a(0x1e7)]);const _0x13768c=requireSkillCode(_0x3a5dc7[_0x19d7a(0x1dd)]),_0x3544d3=copyManagedSkillDirectory(_0x3a5dc7[_0x19d7a(0x1e8)],resolve(_0x540ca6[_0x19d7a(0x1c0)],_0x13768c));_0x5eb473[_0x19d7a(0x1cf)]({..._0x3544d3,'contentHash':_0x3a5dc7['contentHash']});}return _0x5eb473;}function ensureManagedSymlink(_0x3211c6,_0x1f943b,_0x4fdce4,_0xb8cb32){const _0x523850=a111_0x4b2fee;mkdirSync(dirname(_0x3211c6),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3211c6)||isDanglingSymlink(_0x3211c6)){const _0x1dbb7b=lstatSync(_0x3211c6);if(!_0x1dbb7b[_0x523850(0x1de)]())throw CliErrors[_0x523850(0x1ea)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x3211c6);const _0xe721c7=resolveSymlinkTarget(_0x3211c6);if(!isPathInside(realOrResolved(_0xe721c7),realOrResolved(_0x4fdce4['managedRoot'])))throw CliErrors['validation'](_0x523850(0x1d2)+_0x3211c6);if(realOrResolved(_0xe721c7)===realOrResolved(_0x1f943b))return{'path':_0x3211c6,'target':_0x1f943b,'action':_0x523850(0x1d0)};const _0xf4ff81=readMetadataIfPresent(resolve(_0xe721c7,METADATA_FILE));if(_0x4fdce4['scope']==='project'&&(_0xf4ff81?.[_0x523850(0x1d5)]!==_0x4fdce4[_0x523850(0x1d5)]||_0xf4ff81[_0x523850(0x1df)]!==_0xb8cb32))throw CliErrors[_0x523850(0x1ea)](_0x523850(0x1d8)+_0x3211c6);return unlinkSync(_0x3211c6),symlinkSync(_0x1f943b,_0x3211c6,'dir'),{'path':_0x3211c6,'target':_0x1f943b,'action':_0x523850(0x1ee)};}return symlinkSync(_0x1f943b,_0x3211c6,_0x523850(0x1e8)),{'path':_0x3211c6,'target':_0x1f943b,'action':_0x523850(0x1e1)};}function managedTargetSkillLinkPaths(_0x5445cd,_0x420379){const _0x56316c=a111_0x4b2fee;if(!existsSync(_0x5445cd))return[];const _0x3f1826=_0x420379['appCode']+'--';return readdirSync(_0x5445cd,{'withFileTypes':!![]})[_0x56316c(0x1d7)](_0x239ec4=>_0x420379[_0x56316c(0x1e7)]===_0x56316c(0x1ec)||_0x239ec4[_0x56316c(0x1c2)][_0x56316c(0x1c8)](_0x3f1826))[_0x56316c(0x1c6)](_0x5abc7b=>resolve(_0x5445cd,_0x5abc7b[_0x56316c(0x1c2)]));}function removeManagedSkillLink(_0xc2a237,_0x6bbb3e,_0x1f7d29){const _0x19d8b6=a111_0x4b2fee,_0x5753f7=lstatIfPresent(_0xc2a237);if(!_0x5753f7?.[_0x19d8b6(0x1de)]())return{'path':_0xc2a237,'action':_0x19d8b6(0x1d6),'reason':'not-managed-symlink'};const _0x2af3bb=resolveSymlinkTarget(_0xc2a237);if(!isPathInside(realOrResolved(_0x2af3bb),realOrResolved(_0x6bbb3e[_0x19d8b6(0x1ca)])))return{'path':_0xc2a237,'action':_0x19d8b6(0x1d6),'reason':_0x19d8b6(0x1be)};const _0x443c94=readMetadataIfPresent(resolve(_0x2af3bb,METADATA_FILE));if(_0x6bbb3e['scope']===_0x19d8b6(0x1ec)&&(_0x443c94?.[_0x19d8b6(0x1d5)]!==_0x6bbb3e[_0x19d8b6(0x1d5)]||_0x443c94[_0x19d8b6(0x1df)]!==_0x1f7d29))return{'path':_0xc2a237,'action':_0x19d8b6(0x1d6),'reason':_0x19d8b6(0x1e5)};return unlinkSync(_0xc2a237),{'path':_0xc2a237,'action':_0x19d8b6(0x1f5)};}function isLinkedFromAnyRoot(_0x46d349,_0x5860e2){const _0x400475=a111_0x4b2fee,_0x4ff74d=realOrResolved(_0x46d349);for(const _0x1e02fc of _0x5860e2){if(!existsSync(_0x1e02fc))continue;for(const _0xa1f298 of readdirSync(_0x1e02fc,{'withFileTypes':!![]})){if(!_0xa1f298[_0x400475(0x1de)]())continue;const _0x1ad833=resolve(_0x1e02fc,_0xa1f298['name']);if(realOrResolved(resolveSymlinkTarget(_0x1ad833))===_0x4ff74d)return!![];}}return![];}function runtimeSkillLinkName(_0x53de97,_0x1bfe3a){const _0x34df8d=a111_0x4b2fee,_0x567f1e=safePathSegment(_0x1bfe3a,_0x34df8d(0x1df));if(_0x53de97['scope']==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x34df8d(0x1d9)](_0x567f1e))throw CliErrors[_0x34df8d(0x1ea)](_0x34df8d(0x1c1)+_0x567f1e);return _0x53de97[_0x34df8d(0x1e7)]===_0x34df8d(0x1ec)?_0x567f1e:_0x53de97[_0x34df8d(0x1d5)]+'--'+_0x567f1e;}function runtimeSkillCodeFromLink(_0x3bceb1,_0x189d39){const _0x516106=a111_0x4b2fee,_0x56fb80=basename(_0x189d39);return _0x3bceb1[_0x516106(0x1e7)]==='project'?_0x56fb80:_0x56fb80[_0x516106(0x1d3)]((_0x3bceb1[_0x516106(0x1d5)]+'--')[_0x516106(0x1f1)]);}function a111_0x3040(_0x17f30b,_0x15a853){_0x17f30b=_0x17f30b-0x1bd;const _0x474b84=a111_0x474b();let _0x3040ba=_0x474b84[_0x17f30b];return _0x3040ba;}export function copyManagedSkillDirectory(_0x437ed3,_0x249bd8){const _0x5d8367=a111_0x4b2fee,_0xae593f=resolve(_0x249bd8,METADATA_FILE),_0x38f6af=existsSync(_0x249bd8);if(_0x38f6af){const _0x12e77d=lstatSync(_0x249bd8);if(_0x12e77d[_0x5d8367(0x1de)]())throw CliErrors[_0x5d8367(0x1ea)](_0x5d8367(0x1f0)+_0x249bd8);if(!_0x12e77d['isDirectory']())throw CliErrors[_0x5d8367(0x1ea)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x249bd8);const _0x26a2c2=readMetadataIfPresent(_0xae593f);if(_0x26a2c2?.[_0x5d8367(0x1e7)]!==_0x5d8367(0x1cb))throw CliErrors[_0x5d8367(0x1ea)](_0x5d8367(0x1eb)+_0x249bd8);}ensureDirSync(dirname(_0x249bd8));const _0x4db899=_0x38f6af?readMetadataIfPresent(_0xae593f)?.[_0x5d8367(0x1ef)]:undefined,_0x102dc6=readMetadataIfPresent(resolve(_0x437ed3,METADATA_FILE))?.[_0x5d8367(0x1ef)];return _0x38f6af&&removeSync(_0x249bd8),copySkillDirectory(_0x437ed3,_0x249bd8),{'path':_0x249bd8,'target':_0x437ed3,'action':!_0x38f6af?_0x5d8367(0x1e1):_0x4db899===_0x102dc6?'unchanged':_0x5d8367(0x1ee)};}function copySkillDirectory(_0x1394d4,_0x248a14){copySync(_0x1394d4,_0x248a14,{'dereference':![],'overwrite':!![],'filter'(_0x258b81){const _0x16e3ba=a111_0x3040;if(lstatSync(_0x258b81)[_0x16e3ba(0x1de)]())throw CliErrors[_0x16e3ba(0x1ea)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x258b81);return!![];}});}
|