@lovrabet/lovrabet-cli 2.3.7 → 2.3.8-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
- package/skills/lovrabet/SKILL.md +2 -2
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a146_0x117efd=a146_0x3899;(function(_0x4c80a2,_0x317885){const _0x3e8d0f=a146_0x3899,_0x5b8bc5=_0x4c80a2();while(!![]){try{const _0x13a452=-parseInt(_0x3e8d0f(0x14b))/0x1+parseInt(_0x3e8d0f(0x159))/0x2+parseInt(_0x3e8d0f(0x11a))/0x3+-parseInt(_0x3e8d0f(0x14f))/0x4+parseInt(_0x3e8d0f(0x107))/0x5*(-parseInt(_0x3e8d0f(0x14c))/0x6)+parseInt(_0x3e8d0f(0x123))/0x7*(-parseInt(_0x3e8d0f(0x13b))/0x8)+parseInt(_0x3e8d0f(0x135))/0x9;if(_0x13a452===_0x317885)break;else _0x5b8bc5['push'](_0x5b8bc5['shift']());}catch(_0x132971){_0x5b8bc5['push'](_0x5b8bc5['shift']());}}}(a146_0x2e71,0x3eb0b));import{randomBytes,randomUUID}from'node:crypto';import{lstat,open,readFile,realpath,rename,unlink}from'node:fs/promises';import{resolve,dirname,basename}from'node:path';export function canonical(_0x67a174){const _0x829d86=a146_0x3899;if(Array['isArray'](_0x67a174))return'['+_0x67a174['map'](canonical)[_0x829d86(0x10e)](',')+']';if(_0x67a174&&typeof _0x67a174===_0x829d86(0xf9))return'{'+Object[_0x829d86(0x166)](_0x67a174)['sort']()[_0x829d86(0x150)](_0xab818a=>JSON['stringify'](_0xab818a)+':'+canonical(_0x67a174[_0xab818a]))[_0x829d86(0x10e)](',')+'}';return JSON[_0x829d86(0x165)](_0x67a174)??_0x829d86(0x12c);}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a146_0x117efd(0x144),a146_0x117efd(0x102),'districtAdcode','district',a146_0x117efd(0x132),'road',a146_0x117efd(0x154),a146_0x117efd(0x172),a146_0x117efd(0x15c),a146_0x117efd(0x14e),a146_0x117efd(0x156),a146_0x117efd(0x146),a146_0x117efd(0x116),a146_0x117efd(0x14a),a146_0x117efd(0x131),a146_0x117efd(0x125),a146_0x117efd(0x16e),'errorMessage','address',a146_0x117efd(0x122)]);export function sameImportValue(_0x17fe22,_0x492d6d,_0x3cf2ac=![]){const _0xe17288=a146_0x117efd;if(_0x3cf2ac){const _0x4f5212=_0xea73e0=>Array[_0xe17288(0xfa)](_0xea73e0)?_0xea73e0[_0xe17288(0x150)](_0x12033e=>{const _0xe7bae=_0xe17288;if(!_0x12033e||typeof _0x12033e!=='object'||Array['isArray'](_0x12033e))return _0x12033e;const _0x4fe552={..._0x12033e};delete _0x4fe552[_0xe7bae(0x126)],delete _0x4fe552[_0xe7bae(0x11d)];if(_0x4fe552[_0xe7bae(0x133)]==='')delete _0x4fe552['dingTalkUrl'];if(_0x4fe552[_0xe7bae(0x141)]==null)delete _0x4fe552['createUserId'];if(_0x4fe552[_0xe7bae(0x173)]==null)delete _0x4fe552[_0xe7bae(0x173)];if(_0x4fe552['geolocation']==null||typeof _0x4fe552[_0xe7bae(0x10d)]===_0xe7bae(0xf9)&&!Array['isArray'](_0x4fe552[_0xe7bae(0x10d)])&&Object[_0xe7bae(0x11f)](_0x4fe552[_0xe7bae(0x10d)])['every'](([_0x1c95dd,_0x2cb939])=>EMPTY_IMAGE_LOCATION_FIELDS[_0xe7bae(0x12f)](_0x1c95dd)&&_0x2cb939===null))delete _0x4fe552[_0xe7bae(0x10d)];for(const _0x23c3ce of[_0xe7bae(0x139),_0xe7bae(0x115),'key'])if(!(_0x23c3ce in _0x4fe552))_0x4fe552[_0x23c3ce]='';if(_0x4fe552['size']==null)_0x4fe552[_0xe7bae(0x127)]=0x0;return _0x4fe552;}):_0xea73e0;return canonical(_0x4f5212(_0x17fe22))===canonical(_0x4f5212(_0x492d6d));}return _0x17fe22===null?_0x492d6d===null||_0x492d6d===undefined:canonical(_0x492d6d)===canonical(_0x17fe22);}async function rejectSymlink(_0x573bea){const _0x501b7a=a146_0x117efd;try{if((await lstat(_0x573bea))[_0x501b7a(0xfe)]())throw Error(_0x501b7a(0x170));}catch(_0x455700){if(_0x455700[_0x501b7a(0x151)]!=='ENOENT')throw _0x455700;}}function a146_0x2e71(){const _0x505d63=['map','code','maxBatchSize','pid','country','uploadFields','city','schemaHash','isSafeInteger','726262FtKmiW','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','province','Excel\x20contains\x20no\x20valid\x20data\x20rows.','EEXIST','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','fileHash','appCode','Invalid\x20import\x20batch\x20size.','unknown','some','stringify','keys','ESRCH','runtimeDomain','push','values','binding','toString','Import\x20lock\x20changed;\x20retry\x20recovery.','cityAdcode','importId','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','emptyRows','countryCode','createUserName','Invalid\x20write\x20result.','length','byteLength','isInteger','mappingHash','readback','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','succeeded','now','ids','slice','filter','Incomplete\x20readback.','object','isArray','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','errors','strategy','isSymbolicLink','source','elapsedMs','.lock','operatorType','schemaVersion','incomplete','get','status','12815wBtoYR','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','rowNumber','sheet','resume','utf8','geolocation','join','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','pending','imageFields','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','checkpoint','Excel\x20row\x20','type','resultCode','set','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','datasetCode','1089408qUiOUm','close','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','previewUrl','forEach','entries','write','token','lbswuaCacheId','7028KTIEeE','batchSize','longitude','url','size','Invalid\x20import\x20readback\x20response.','sync','fixed-negative-id','.recovery','undefined','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','conflict','has','message','accuracy','pois','dingTalkUrl','rows','3677040pSRepc','includes','maxBatchBytes','ENOENT','name','every','2336nBmHmo','schemaFingerprint','report','.lock.recovery','actorId','writeFile','createUserId','unsent','hex','time','auto-id-task-marker','netType','parse','string','completed','streetNumber','187898NOMjlN','852wSKOJD','Cannot\x20read\x20the\x20import\x20checkpoint.','latitude','132144HpGaDp'];a146_0x2e71=function(){return _0x505d63;};return a146_0x2e71();}export async function resolveImportOutputPath(_0x2e03a2){return await rejectSymlink(_0x2e03a2),resolve(await realpath(dirname(resolve(_0x2e03a2))),basename(_0x2e03a2));}export function assertImportPaths(_0x4c6f96,_0x40e75a,_0x358bea=[]){const _0x343e63=a146_0x117efd,_0x291140=[..._0x358bea,_0x4c6f96,_0x40e75a,_0x4c6f96+_0x343e63(0x101),_0x4c6f96+_0x343e63(0x13e)][_0x343e63(0x150)](_0x2748bd=>resolve(_0x2748bd));if(new Set(_0x291140)[_0x343e63(0x127)]!==_0x291140[_0x343e63(0x175)])throw Error(_0x343e63(0x118));}export async function saveImportJson(_0x25c958,_0x52bc07){const _0x5b0447=a146_0x117efd;await rejectSymlink(_0x25c958);const _0x3edb58=_0x25c958+'.tmp-'+randomUUID(),_0xc395a4=await open(_0x3edb58,'wx',0x180);try{await _0xc395a4[_0x5b0447(0x140)](JSON[_0x5b0447(0x165)](_0x52bc07,null,0x2)),await _0xc395a4[_0x5b0447(0x129)]();}finally{await _0xc395a4['close']();}try{await rename(_0x3edb58,_0x25c958);}catch(_0x14088c){await unlink(_0x3edb58)['catch'](()=>{});throw _0x14088c;}}export async function acquireLock(_0x10f6d1){const _0x15be26=a146_0x117efd,_0x52157a=_0x10f6d1+_0x15be26(0x101),_0x2ee0b7=randomUUID();await rejectSymlink(_0x52157a);const _0x33dccf=_0x52157a+_0x15be26(0x12b);let _0x1516bc,_0x2ac1cf;try{try{_0x1516bc=await open(_0x52157a,'wx',0x180);}catch(_0x34f20b){if(_0x34f20b[_0x15be26(0x151)]!==_0x15be26(0x15e))throw _0x34f20b;try{_0x2ac1cf=await open(_0x33dccf,'wx',0x180);}catch(_0xbf6c70){if(_0xbf6c70[_0x15be26(0x151)]===_0x15be26(0x15e))throw Error(_0x15be26(0x12d));throw _0xbf6c70;}await _0x2ac1cf[_0x15be26(0x140)](JSON['stringify']({'pid':process['pid'],'token':_0x2ee0b7})),await _0x2ac1cf['sync'](),await rejectSymlink(_0x52157a);let _0x52e0be;try{_0x52e0be=await readFile(_0x52157a,_0x15be26(0x10c));}catch(_0x49cd65){if(_0x49cd65['code']!==_0x15be26(0x138))throw _0x49cd65;}if(_0x52e0be!==undefined){let _0xaa0ad2;try{_0xaa0ad2=JSON['parse'](_0x52e0be);}catch{throw Error('Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.');}if(!_0xaa0ad2||!Number[_0x15be26(0x158)](_0xaa0ad2['pid'])||_0xaa0ad2[_0x15be26(0x153)]<=0x0)throw Error('Invalid\x20import\x20lock\x20owner.');try{process['kill'](_0xaa0ad2['pid'],0x0);throw Error('The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.');}catch(_0x2b9aa3){if(_0x2b9aa3[_0x15be26(0x151)]!==_0x15be26(0x167))throw _0x2b9aa3;}if(await readFile(_0x52157a,_0x15be26(0x10c))!==_0x52e0be)throw Error(_0x15be26(0x16d));await unlink(_0x52157a);}_0x1516bc=await open(_0x52157a,'wx',0x180);}await _0x1516bc['writeFile'](JSON[_0x15be26(0x165)]({'pid':process[_0x15be26(0x153)],'token':_0x2ee0b7})),await _0x1516bc[_0x15be26(0x129)]();}finally{try{await _0x1516bc?.[_0x15be26(0x11b)]();}finally{if(_0x2ac1cf)try{await _0x2ac1cf[_0x15be26(0x11b)]();}finally{await unlink(_0x33dccf);}}}return async()=>{const _0x4893e5=_0x15be26;if(JSON[_0x4893e5(0x147)](await readFile(_0x52157a,_0x4893e5(0x10c)))[_0x4893e5(0x121)]===_0x2ee0b7)await unlink(_0x52157a);};}export function assertImportContract(_0xec915d,_0x989aab,_0x412051){const _0xe0ad9e=a146_0x117efd;if(!_0xec915d||!(_0xec915d[_0xe0ad9e(0x103)]===0x1&&_0xec915d['strategy']===_0xe0ad9e(0x12a)||_0xec915d[_0xe0ad9e(0x103)]===0x2&&_0xec915d[_0xe0ad9e(0xfd)]===_0xe0ad9e(0x145))||_0xec915d[_0xe0ad9e(0xff)]!=='METADATA'||_0xec915d[_0xe0ad9e(0x161)]!==_0x989aab||_0xec915d[_0xe0ad9e(0x119)]!==_0x412051||typeof _0xec915d[_0xe0ad9e(0x13f)]!==_0xe0ad9e(0x148)||!_0xec915d[_0xe0ad9e(0x13f)]||typeof _0xec915d[_0xe0ad9e(0x13c)]!==_0xe0ad9e(0x148)||!_0xec915d['schemaFingerprint']||!Number[_0xe0ad9e(0x158)](_0xec915d[_0xe0ad9e(0x152)])||_0xec915d[_0xe0ad9e(0x152)]<0x1||_0xec915d[_0xe0ad9e(0x152)]>0x3e8||!Number[_0xe0ad9e(0x158)](_0xec915d[_0xe0ad9e(0x137)])||_0xec915d[_0xe0ad9e(0x137)]<0x1||_0xec915d[_0xe0ad9e(0x137)]>0x14*0x400*0x400)throw Error(_0xe0ad9e(0x108));}function a146_0x3899(_0x4a0e06,_0x310382){_0x4a0e06=_0x4a0e06-0xf1;const _0x2e71c3=a146_0x2e71();let _0x3899e5=_0x2e71c3[_0x4a0e06];return _0x3899e5;}export async function runExcelImport(_0x3d80d6){const _0x96c336=a146_0x117efd;_0x3d80d6={..._0x3d80d6,'checkpoint':await resolveImportOutputPath(_0x3d80d6['checkpoint']),'report':await resolveImportOutputPath(_0x3d80d6['report'])};const {manifest:_0x5efe29,contract:_0x129e3f,api:_0xc33b9c}=_0x3d80d6;assertImportContract(_0x129e3f,_0x3d80d6[_0x96c336(0x161)],_0x3d80d6[_0x96c336(0x119)]);if(_0x129e3f[_0x96c336(0x103)]!==0x1)throw Error(_0x96c336(0x11c));if(_0x5efe29[_0x96c336(0xfc)]['length'])throw Error(_0x96c336(0xfb));if(!_0x5efe29[_0x96c336(0x134)][_0x96c336(0x175)])throw Error(_0x96c336(0x15d));if(!Number[_0x96c336(0x177)](_0x3d80d6[_0x96c336(0x124)])||_0x3d80d6[_0x96c336(0x124)]<0x1||_0x3d80d6[_0x96c336(0x124)]>_0x129e3f['maxBatchSize'])throw Error(_0x96c336(0x162));for(const _0x381483 of _0x5efe29[_0x96c336(0x134)]){if(Buffer[_0x96c336(0x176)](JSON[_0x96c336(0x165)]({'schemaFingerprint':_0x129e3f[_0x96c336(0x13c)],'items':[{..._0x381483[_0x96c336(0x16a)],'id':-0x1fffffffffffff}]}),_0x96c336(0x10c))>_0x129e3f[_0x96c336(0x137)])throw Error(_0x96c336(0x114)+_0x381483[_0x96c336(0x109)]+'\x20exceeds\x20the\x20import\x20request\x20size\x20limit.');}assertImportPaths(_0x3d80d6[_0x96c336(0x113)],_0x3d80d6[_0x96c336(0x13d)]);const _0x105981={'appCode':_0x3d80d6[_0x96c336(0x161)],'datasetCode':_0x3d80d6[_0x96c336(0x119)],'runtimeDomain':_0x3d80d6[_0x96c336(0x168)],'actorId':_0x129e3f[_0x96c336(0x13f)],'fileHash':_0x5efe29[_0x96c336(0x160)],'mappingHash':_0x5efe29[_0x96c336(0x178)],'schemaHash':_0x5efe29[_0x96c336(0x157)],'remoteSchemaHash':_0x129e3f[_0x96c336(0x13c)],'batchSize':_0x3d80d6['batchSize'],'sheet':_0x5efe29[_0x96c336(0x10a)]},_0x2cb6ba=await acquireLock(_0x3d80d6[_0x96c336(0x113)]);let _0x2add93;const _0x2865db=Date[_0x96c336(0xf4)]();let _0x189098=0x0;const _0x89dbcf=[],_0x3886d3=()=>({'importId':_0x2add93?.[_0x96c336(0x16f)],'sourceRows':_0x5efe29[_0x96c336(0x134)][_0x96c336(0x175)],'emptyRows':_0x5efe29[_0x96c336(0x171)][_0x96c336(0x175)],'succeeded':_0x2add93?.[_0x96c336(0x134)]['filter'](_0x2c2e89=>_0x2c2e89[_0x96c336(0x106)]===_0x96c336(0xf3))[_0x96c336(0x175)]??0x0,'unknown':_0x2add93?.[_0x96c336(0x134)][_0x96c336(0xf7)](_0xeaf677=>_0xeaf677[_0x96c336(0x106)]==='pending')[_0x96c336(0x175)]??0x0,'conflicts':_0x2add93?.[_0x96c336(0x134)][_0x96c336(0xf7)](_0x195737=>_0x195737[_0x96c336(0x106)]==='conflict')['length']??0x0,'notAttempted':_0x2add93?.[_0x96c336(0x134)][_0x96c336(0xf7)](_0x58efa0=>_0x58efa0[_0x96c336(0x106)]===_0x96c336(0x142))[_0x96c336(0x175)]??_0x5efe29[_0x96c336(0x134)][_0x96c336(0x175)],'batches':_0x189098,'batchResults':_0x89dbcf,'elapsedMs':Date[_0x96c336(0xf4)]()-_0x2865db,'checkpoint':resolve(_0x3d80d6[_0x96c336(0x113)]),'report':resolve(_0x3d80d6[_0x96c336(0x13d)]),'warnings':_0x5efe29['warnings']});try{await rejectSymlink(_0x3d80d6[_0x96c336(0x113)]);if(_0x3d80d6[_0x96c336(0x10b)]){try{_0x2add93=JSON[_0x96c336(0x147)](await readFile(_0x3d80d6[_0x96c336(0x113)],_0x96c336(0x10c)));}catch{throw Error(_0x96c336(0x14d));}if(!_0x2add93||_0x2add93['version']!==0x1||typeof _0x2add93[_0x96c336(0x16f)]!=='string'||canonical(_0x2add93[_0x96c336(0x16b)])!==canonical(_0x105981)||!Array['isArray'](_0x2add93[_0x96c336(0x134)])||_0x2add93['rows'][_0x96c336(0x175)]!==_0x5efe29[_0x96c336(0x134)][_0x96c336(0x175)]||new Set(_0x2add93['rows'][_0x96c336(0x150)](_0x535a11=>_0x535a11['id']))[_0x96c336(0x127)]!==_0x2add93[_0x96c336(0x134)]['length']||_0x2add93[_0x96c336(0x134)][_0x96c336(0x164)]((_0x283570,_0x35c941)=>!Number[_0x96c336(0x158)](_0x283570['id'])||_0x283570['id']>=0x0||_0x283570[_0x96c336(0x109)]!==_0x5efe29[_0x96c336(0x134)][_0x35c941][_0x96c336(0x109)]||!['unsent',_0x96c336(0x110),_0x96c336(0xf3),_0x96c336(0x12e)][_0x96c336(0x136)](_0x283570[_0x96c336(0x106)])))throw Error(_0x96c336(0x10f));}else{try{await lstat(_0x3d80d6[_0x96c336(0x113)]);throw Error(_0x96c336(0x15b));}catch(_0x1ddd53){if(_0x1ddd53[_0x96c336(0x151)]!=='ENOENT')throw _0x1ddd53;}const _0x48069f=new Set();_0x2add93={'version':0x1,'importId':randomUUID(),'binding':_0x105981,'rows':_0x5efe29['rows']['map'](_0x4e4af9=>{const _0x366be2=_0x96c336;let _0x18453b;do{_0x18453b=-(Number(BigInt('0x'+randomBytes(0x7)[_0x366be2(0x16c)](_0x366be2(0x143)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x48069f['has'](_0x18453b));return _0x48069f['add'](_0x18453b),{'id':_0x18453b,'rowNumber':_0x4e4af9['rowNumber'],'status':_0x366be2(0x142)};})},await saveImportJson(_0x3d80d6[_0x96c336(0x113)],_0x2add93);}await _0x3d80d6['onCheckpointReady']?.();const _0x489260=_0x2add93;if(_0x489260[_0x96c336(0x134)]['some'](_0x5d99fd=>_0x5d99fd['status']===_0x96c336(0x12e)))throw Error('Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.');const _0x2ec577=async _0x58aa25=>{const _0x386e65=_0x96c336,_0x58adc5=await _0xc33b9c[_0x386e65(0xf1)](_0x58aa25['map'](_0x2b236d=>_0x489260['rows'][_0x2b236d]['id']));if(!Array['isArray'](_0x58adc5))throw Error('Invalid\x20import\x20readback\x20response.');const _0x143e51=new Set(_0x58aa25[_0x386e65(0x150)](_0x5c77ae=>_0x489260[_0x386e65(0x134)][_0x5c77ae]['id'])),_0x17e0e5=new Map();for(const _0xed7aba of _0x58adc5){const _0x273388=Number(_0xed7aba?.['id']);if(!_0x143e51[_0x386e65(0x12f)](_0x273388)||_0x17e0e5['has'](_0x273388))throw Error('Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.');_0x17e0e5[_0x386e65(0x117)](_0x273388,_0xed7aba);}for(const _0x3c72e9 of _0x58aa25){const _0x2f8240=_0x17e0e5[_0x386e65(0x105)](_0x489260[_0x386e65(0x134)][_0x3c72e9]['id']);if(!_0x2f8240)continue;if(_0x489260[_0x386e65(0x134)][_0x3c72e9][_0x386e65(0x106)]==='unsent'){_0x489260[_0x386e65(0x134)][_0x3c72e9][_0x386e65(0x106)]='conflict',await saveImportJson(_0x3d80d6[_0x386e65(0x113)],_0x489260);throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}const _0x369548=_0x5efe29['rows'][_0x3c72e9][_0x386e65(0x16a)];if(Object[_0x386e65(0x166)](_0x369548)['some'](_0x39c073=>!sameImportValue(_0x369548[_0x39c073],_0x2f8240[_0x39c073],_0x5efe29[_0x386e65(0x111)]?.[_0x386e65(0x136)](_0x39c073)&&!_0x5efe29[_0x386e65(0x155)]?.['includes'](_0x39c073)))){_0x489260[_0x386e65(0x134)][_0x3c72e9][_0x386e65(0x106)]='conflict',await saveImportJson(_0x3d80d6[_0x386e65(0x113)],_0x489260);throw Error(_0x386e65(0x112)+_0x489260['rows'][_0x3c72e9][_0x386e65(0x109)]+'.');}_0x489260['rows'][_0x3c72e9][_0x386e65(0x106)]='succeeded';}return await saveImportJson(_0x3d80d6[_0x386e65(0x113)],_0x489260),_0x17e0e5;};if(_0x3d80d6[_0x96c336(0x10b)])for(let _0x509817=0x0;_0x509817<_0x489260[_0x96c336(0x134)]['length'];_0x509817+=_0x3d80d6[_0x96c336(0x124)]){const _0x25ef4a=_0x489260[_0x96c336(0x134)][_0x96c336(0xf6)](_0x509817,_0x509817+_0x3d80d6[_0x96c336(0x124)])['map']((_0x1386da,_0x1f1aed)=>_0x509817+_0x1f1aed),_0x141b58=_0x25ef4a[_0x96c336(0xf7)](_0x261bef=>_0x489260[_0x96c336(0x134)][_0x261bef][_0x96c336(0x106)]===_0x96c336(0xf3)),_0x256f10=await _0x2ec577(_0x25ef4a),_0x18f27c=_0x141b58[_0x96c336(0xf7)](_0x122413=>!_0x256f10[_0x96c336(0x12f)](_0x489260[_0x96c336(0x134)][_0x122413]['id']));if(_0x18f27c[_0x96c336(0x175)]){_0x18f27c[_0x96c336(0x11e)](_0x5dfbc5=>{const _0x5f5d58=_0x96c336;_0x489260[_0x5f5d58(0x134)][_0x5dfbc5][_0x5f5d58(0x106)]=_0x5f5d58(0x12e);}),await saveImportJson(_0x3d80d6['checkpoint'],_0x489260);throw Error(_0x96c336(0x15a));}}for(let _0x10ec5e=0x0;_0x10ec5e<_0x489260[_0x96c336(0x134)][_0x96c336(0x175)];){const _0x44630a=[],_0x11eb10=[];while(_0x10ec5e<_0x489260[_0x96c336(0x134)]['length']&&_0x11eb10[_0x96c336(0x175)]<_0x3d80d6['batchSize']){const _0x3344b6=_0x10ec5e++;if(_0x489260[_0x96c336(0x134)][_0x3344b6]['status']===_0x96c336(0xf3))continue;const _0x5d9e3d={..._0x5efe29[_0x96c336(0x134)][_0x3344b6][_0x96c336(0x16a)],'id':_0x489260[_0x96c336(0x134)][_0x3344b6]['id']};if(Buffer['byteLength'](JSON['stringify']({'schemaFingerprint':_0x129e3f['schemaFingerprint'],'items':[..._0x11eb10,_0x5d9e3d]}),_0x96c336(0x10c))>_0x129e3f[_0x96c336(0x137)]){if(!_0x11eb10[_0x96c336(0x175)])throw Error(_0x96c336(0x114)+_0x489260[_0x96c336(0x134)][_0x3344b6][_0x96c336(0x109)]+_0x96c336(0xf2));_0x10ec5e--;break;}_0x44630a[_0x96c336(0x169)](_0x3344b6),_0x11eb10[_0x96c336(0x169)](_0x5d9e3d);}if(!_0x11eb10[_0x96c336(0x175)])continue;const _0x391cf3=_0x44630a[_0x96c336(0xf7)](_0x418056=>_0x489260[_0x96c336(0x134)][_0x418056][_0x96c336(0x106)]===_0x96c336(0x142));if(_0x391cf3[_0x96c336(0x175)]){const _0x292e6d=await _0xc33b9c['readback'](_0x391cf3[_0x96c336(0x150)](_0x29ba1e=>_0x489260[_0x96c336(0x134)][_0x29ba1e]['id']));if(!Array[_0x96c336(0xfa)](_0x292e6d))throw Error(_0x96c336(0x128));if(_0x292e6d[_0x96c336(0x175)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x44630a[_0x96c336(0x11e)](_0x258fa0=>{const _0x39802a=_0x96c336;_0x489260[_0x39802a(0x134)][_0x258fa0]['status']=_0x39802a(0x110);}),await saveImportJson(_0x3d80d6[_0x96c336(0x113)],_0x489260),_0x189098++;const _0x430b64=Date[_0x96c336(0xf4)](),_0x4ca1df={'batch':_0x189098,'rowStart':_0x489260[_0x96c336(0x134)][_0x44630a[0x0]]['rowNumber'],'rowEnd':_0x489260[_0x96c336(0x134)][_0x44630a[_0x44630a['length']-0x1]]['rowNumber'],'count':_0x11eb10[_0x96c336(0x175)],'bytes':Buffer[_0x96c336(0x176)](JSON[_0x96c336(0x165)]({'schemaFingerprint':_0x129e3f[_0x96c336(0x13c)],'items':_0x11eb10}),'utf8'),'elapsedMs':0x0,'status':_0x96c336(0x163)};_0x89dbcf['push'](_0x4ca1df);try{const _0x284479=await _0xc33b9c[_0x96c336(0x120)](_0x11eb10);if(!_0x284479||_0x284479['count']!==_0x11eb10[_0x96c336(0x175)]||!Array[_0x96c336(0xfa)](_0x284479[_0x96c336(0xf5)])||_0x284479[_0x96c336(0xf5)][_0x96c336(0x175)]!==_0x11eb10[_0x96c336(0x175)]||_0x284479[_0x96c336(0xf5)][_0x96c336(0x164)]((_0x3c108a,_0x37469a)=>Number(_0x3c108a)!==_0x489260[_0x96c336(0x134)][_0x44630a[_0x37469a]]['id']))throw Error(_0x96c336(0x174));await _0x2ec577(_0x44630a);if(_0x44630a[_0x96c336(0x164)](_0x3d72cb=>_0x489260[_0x96c336(0x134)][_0x3d72cb][_0x96c336(0x106)]!=='succeeded'))throw Error(_0x96c336(0xf8));}catch(_0x2cf344){if(_0x489260['rows'][_0x96c336(0x164)](_0x5cc104=>_0x5cc104[_0x96c336(0x106)]==='conflict'))throw _0x2cf344;try{await _0x2ec577(_0x44630a);}catch(_0x2735f5){if(_0x489260[_0x96c336(0x134)][_0x96c336(0x164)](_0x47ef6c=>_0x47ef6c[_0x96c336(0x106)]===_0x96c336(0x12e)))throw _0x2735f5;}if(_0x44630a[_0x96c336(0x164)](_0x24dab7=>_0x489260[_0x96c336(0x134)][_0x24dab7][_0x96c336(0x106)]!=='succeeded'))throw Error(_0x96c336(0x15f));}finally{_0x4ca1df[_0x96c336(0x100)]=Date[_0x96c336(0xf4)]()-_0x430b64;if(_0x44630a[_0x96c336(0x13a)](_0x91b618=>_0x489260[_0x96c336(0x134)][_0x91b618][_0x96c336(0x106)]==='succeeded'))_0x4ca1df[_0x96c336(0x106)]='succeeded';else{if(_0x44630a[_0x96c336(0x164)](_0x40dc2b=>_0x489260['rows'][_0x40dc2b][_0x96c336(0x106)]==='conflict'))_0x4ca1df['status']='conflict';}}}const _0x19594b={'status':_0x96c336(0x149),..._0x3886d3()};return await saveImportJson(_0x3d80d6[_0x96c336(0x13d)],_0x19594b),_0x19594b;}catch(_0x2d59b6){if(_0x2add93)await saveImportJson(_0x3d80d6['report'],{'status':_0x96c336(0x104),..._0x3886d3(),'message':_0x2d59b6[_0x96c336(0x130)]});throw _0x2d59b6;}finally{await _0x2cb6ba();}}
|
|
1
|
+
function a146_0x14b4(_0x4e071a,_0x26d609){_0x4e071a=_0x4e071a-0x1eb;const _0x595b8f=a146_0x595b();let _0x14b452=_0x595b8f[_0x4e071a];return _0x14b452;}const a146_0x4ea07f=a146_0x14b4;(function(_0xe08847,_0x1fcfe2){const _0x2d7a7f=a146_0x14b4,_0x48fbda=_0xe08847();while(!![]){try{const _0x53e0d3=parseInt(_0x2d7a7f(0x20f))/0x1*(parseInt(_0x2d7a7f(0x215))/0x2)+-parseInt(_0x2d7a7f(0x21f))/0x3+-parseInt(_0x2d7a7f(0x238))/0x4*(-parseInt(_0x2d7a7f(0x211))/0x5)+parseInt(_0x2d7a7f(0x24c))/0x6+parseInt(_0x2d7a7f(0x270))/0x7*(parseInt(_0x2d7a7f(0x207))/0x8)+parseInt(_0x2d7a7f(0x254))/0x9*(parseInt(_0x2d7a7f(0x25f))/0xa)+-parseInt(_0x2d7a7f(0x225))/0xb*(parseInt(_0x2d7a7f(0x232))/0xc);if(_0x53e0d3===_0x1fcfe2)break;else _0x48fbda['push'](_0x48fbda['shift']());}catch(_0x4fe0ae){_0x48fbda['push'](_0x48fbda['shift']());}}}(a146_0x595b,0x450d5));import{randomBytes,randomUUID}from'node:crypto';import{lstat,open,readFile,realpath,rename,unlink}from'node:fs/promises';import{resolve,dirname,basename}from'node:path';function a146_0x595b(){const _0x31f818=['The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','write','road','.tmp-','actorId','token','conflict','some','batchSize','stringify','maxBatchBytes','report','geolocation','streetNumber','count','filter','country','8mxrlDU','unknown','accuracy','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','unsent','length','schemaFingerprint','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','1090SxDfxY','Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','1525FyWfde','fixed-negative-id','rowNumber','Invalid\x20import\x20lock\x20owner.','592rusBAp','importId','byteLength','string','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','mappingHash','checkpoint','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','parse','ids','400665QKXznt','succeeded','pois','pid','sort','dingTalkUrl','11hsTAXs','forEach','set','Excel\x20contains\x20no\x20valid\x20data\x20rows.','Invalid\x20import\x20batch\x20size.','get','.lock.recovery','url','completed','longitude','errors','schemaVersion','keys','12272280idzGsL','undefined','values','resume','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','3308fjaYjT','key','object','isSafeInteger','message','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','emptyRows','Cannot\x20read\x20the\x20import\x20checkpoint.','operatorType','has','code','sync','uploadFields','version','province','now','strategy','utf8','schemaHash','hex','2706708cSddsX','ESRCH','add','isArray','time','readback','createUserId','Invalid\x20import\x20readback\x20response.','21591FLFrLB','appCode','kill','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','isSymbolicLink','warnings','every','maxBatchSize','slice','map','status','970cQFsmi','.recovery','.lock','elapsedMs','district','toString','previewUrl','Excel\x20row\x20','districtAdcode','includes','imageFields','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','EEXIST','close','writeFile','runtimeDomain','type','1262702UYavlp','errorMessage','countryCode','netType','size','join','ENOENT','push','METADATA','name','rows','datasetCode','fileHash','pending','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','resultCode'];a146_0x595b=function(){return _0x31f818;};return a146_0x595b();}export function canonical(_0x5901de){const _0x5427e8=a146_0x14b4;if(Array[_0x5427e8(0x24f)](_0x5901de))return'['+_0x5901de[_0x5427e8(0x25d)](canonical)['join'](',')+']';if(_0x5901de&&typeof _0x5901de===_0x5427e8(0x23a))return'{'+Object[_0x5427e8(0x231)](_0x5901de)[_0x5427e8(0x223)]()[_0x5427e8(0x25d)](_0x482933=>JSON[_0x5427e8(0x1ff)](_0x482933)+':'+canonical(_0x5901de[_0x482933]))[_0x5427e8(0x275)](',')+'}';return JSON[_0x5427e8(0x1ff)](_0x5901de)??_0x5427e8(0x233);}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a146_0x4ea07f(0x250),a146_0x4ea07f(0x240),a146_0x4ea07f(0x267),a146_0x4ea07f(0x263),a146_0x4ea07f(0x221),a146_0x4ea07f(0x1f8),a146_0x4ea07f(0x206),a146_0x4ea07f(0x272),a146_0x4ea07f(0x246),'latitude','city',a146_0x4ea07f(0x273),a146_0x4ea07f(0x1f4),a146_0x4ea07f(0x203),a146_0x4ea07f(0x209),a146_0x4ea07f(0x22e),'cityAdcode',a146_0x4ea07f(0x271),'address','lbswuaCacheId']);export function sameImportValue(_0x10f5d0,_0x528335,_0x2a698a=![]){if(_0x2a698a){const _0x48cbf3=_0x31d398=>Array['isArray'](_0x31d398)?_0x31d398['map'](_0x32a32a=>{const _0x2c9930=a146_0x14b4;if(!_0x32a32a||typeof _0x32a32a!==_0x2c9930(0x23a)||Array[_0x2c9930(0x24f)](_0x32a32a))return _0x32a32a;const _0x16bbf5={..._0x32a32a};delete _0x16bbf5[_0x2c9930(0x22c)],delete _0x16bbf5[_0x2c9930(0x265)];if(_0x16bbf5[_0x2c9930(0x224)]==='')delete _0x16bbf5[_0x2c9930(0x224)];if(_0x16bbf5[_0x2c9930(0x252)]==null)delete _0x16bbf5['createUserId'];if(_0x16bbf5['createUserName']==null)delete _0x16bbf5['createUserName'];if(_0x16bbf5['geolocation']==null||typeof _0x16bbf5[_0x2c9930(0x202)]===_0x2c9930(0x23a)&&!Array[_0x2c9930(0x24f)](_0x16bbf5[_0x2c9930(0x202)])&&Object['entries'](_0x16bbf5[_0x2c9930(0x202)])[_0x2c9930(0x25a)](([_0x11cbe3,_0x13b8ca])=>EMPTY_IMAGE_LOCATION_FIELDS['has'](_0x11cbe3)&&_0x13b8ca===null))delete _0x16bbf5[_0x2c9930(0x202)];for(const _0x4d6da8 of[_0x2c9930(0x1ee),_0x2c9930(0x26f),_0x2c9930(0x239)])if(!(_0x4d6da8 in _0x16bbf5))_0x16bbf5[_0x4d6da8]='';if(_0x16bbf5[_0x2c9930(0x274)]==null)_0x16bbf5[_0x2c9930(0x274)]=0x0;return _0x16bbf5;}):_0x31d398;return canonical(_0x48cbf3(_0x10f5d0))===canonical(_0x48cbf3(_0x528335));}return _0x10f5d0===null?_0x528335===null||_0x528335===undefined:canonical(_0x528335)===canonical(_0x10f5d0);}async function rejectSymlink(_0x46c365){const _0x33b256=a146_0x4ea07f;try{if((await lstat(_0x46c365))[_0x33b256(0x258)]())throw Error('Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.');}catch(_0x136200){if(_0x136200[_0x33b256(0x242)]!==_0x33b256(0x1eb))throw _0x136200;}}export async function resolveImportOutputPath(_0x1223f8){return await rejectSymlink(_0x1223f8),resolve(await realpath(dirname(resolve(_0x1223f8))),basename(_0x1223f8));}export function assertImportPaths(_0x39f72c,_0x50a3d2,_0x100fb6=[]){const _0x19f8a3=a146_0x4ea07f,_0x522da0=[..._0x100fb6,_0x39f72c,_0x50a3d2,_0x39f72c+_0x19f8a3(0x261),_0x39f72c+_0x19f8a3(0x22b)][_0x19f8a3(0x25d)](_0xa5e1e=>resolve(_0xa5e1e));if(new Set(_0x522da0)[_0x19f8a3(0x274)]!==_0x522da0['length'])throw Error(_0x19f8a3(0x236));}export async function saveImportJson(_0x150ac5,_0x56d45b){const _0x2ff199=a146_0x4ea07f;await rejectSymlink(_0x150ac5);const _0x165959=_0x150ac5+_0x2ff199(0x1f9)+randomUUID(),_0x210895=await open(_0x165959,'wx',0x180);try{await _0x210895[_0x2ff199(0x26d)](JSON['stringify'](_0x56d45b,null,0x2)),await _0x210895['sync']();}finally{await _0x210895[_0x2ff199(0x26c)]();}try{await rename(_0x165959,_0x150ac5);}catch(_0x88cc3e){await unlink(_0x165959)['catch'](()=>{});throw _0x88cc3e;}}export async function acquireLock(_0x19ef1c){const _0x2544f6=a146_0x4ea07f,_0x990b28=_0x19ef1c+_0x2544f6(0x261),_0x17a91f=randomUUID();await rejectSymlink(_0x990b28);const _0x164215=_0x990b28+_0x2544f6(0x260);let _0x4327f2,_0x31de2e;try{try{_0x4327f2=await open(_0x990b28,'wx',0x180);}catch(_0x39da66){if(_0x39da66['code']!==_0x2544f6(0x26b))throw _0x39da66;try{_0x31de2e=await open(_0x164215,'wx',0x180);}catch(_0xbd3b9){if(_0xbd3b9['code']==='EEXIST')throw Error(_0x2544f6(0x20e));throw _0xbd3b9;}await _0x31de2e[_0x2544f6(0x26d)](JSON['stringify']({'pid':process['pid'],'token':_0x17a91f})),await _0x31de2e[_0x2544f6(0x243)](),await rejectSymlink(_0x990b28);let _0x3a835f;try{_0x3a835f=await readFile(_0x990b28,'utf8');}catch(_0x5d8c36){if(_0x5d8c36[_0x2544f6(0x242)]!==_0x2544f6(0x1eb))throw _0x5d8c36;}if(_0x3a835f!==undefined){let _0x5cb0e0;try{_0x5cb0e0=JSON['parse'](_0x3a835f);}catch{throw Error(_0x2544f6(0x20a));}if(!_0x5cb0e0||!Number[_0x2544f6(0x23b)](_0x5cb0e0[_0x2544f6(0x222)])||_0x5cb0e0[_0x2544f6(0x222)]<=0x0)throw Error(_0x2544f6(0x214));try{process[_0x2544f6(0x256)](_0x5cb0e0[_0x2544f6(0x222)],0x0);throw Error('The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.');}catch(_0x58e07c){if(_0x58e07c[_0x2544f6(0x242)]!==_0x2544f6(0x24d))throw _0x58e07c;}if(await readFile(_0x990b28,'utf8')!==_0x3a835f)throw Error('Import\x20lock\x20changed;\x20retry\x20recovery.');await unlink(_0x990b28);}_0x4327f2=await open(_0x990b28,'wx',0x180);}await _0x4327f2[_0x2544f6(0x26d)](JSON[_0x2544f6(0x1ff)]({'pid':process[_0x2544f6(0x222)],'token':_0x17a91f})),await _0x4327f2[_0x2544f6(0x243)]();}finally{try{await _0x4327f2?.[_0x2544f6(0x26c)]();}finally{if(_0x31de2e)try{await _0x31de2e['close']();}finally{await unlink(_0x164215);}}}return async()=>{const _0x588874=_0x2544f6;if(JSON['parse'](await readFile(_0x990b28,'utf8'))[_0x588874(0x1fb)]===_0x17a91f)await unlink(_0x990b28);};}export function assertImportContract(_0x2890f4,_0x1c267d,_0x39fe83){const _0x22edc6=a146_0x4ea07f;if(!_0x2890f4||!(_0x2890f4[_0x22edc6(0x230)]===0x1&&_0x2890f4[_0x22edc6(0x248)]===_0x22edc6(0x212)||_0x2890f4['schemaVersion']===0x2&&_0x2890f4[_0x22edc6(0x248)]==='auto-id-task-marker')||_0x2890f4['source']!==_0x22edc6(0x1ed)||_0x2890f4[_0x22edc6(0x255)]!==_0x1c267d||_0x2890f4[_0x22edc6(0x1f0)]!==_0x39fe83||typeof _0x2890f4[_0x22edc6(0x1fa)]!==_0x22edc6(0x218)||!_0x2890f4['actorId']||typeof _0x2890f4[_0x22edc6(0x20d)]!=='string'||!_0x2890f4[_0x22edc6(0x20d)]||!Number[_0x22edc6(0x23b)](_0x2890f4['maxBatchSize'])||_0x2890f4['maxBatchSize']<0x1||_0x2890f4[_0x22edc6(0x25b)]>0x3e8||!Number['isSafeInteger'](_0x2890f4[_0x22edc6(0x200)])||_0x2890f4[_0x22edc6(0x200)]<0x1||_0x2890f4[_0x22edc6(0x200)]>0x14*0x400*0x400)throw Error(_0x22edc6(0x26a));}export async function runExcelImport(_0x5e87cf){const _0x4d70f3=a146_0x4ea07f;_0x5e87cf={..._0x5e87cf,'checkpoint':await resolveImportOutputPath(_0x5e87cf['checkpoint']),'report':await resolveImportOutputPath(_0x5e87cf[_0x4d70f3(0x201)])};const {manifest:_0x61e112,contract:_0x35c933,api:_0xd091ea}=_0x5e87cf;assertImportContract(_0x35c933,_0x5e87cf['appCode'],_0x5e87cf[_0x4d70f3(0x1f0)]);if(_0x35c933['schemaVersion']!==0x1)throw Error(_0x4d70f3(0x219));if(_0x61e112[_0x4d70f3(0x22f)]['length'])throw Error('Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.');if(!_0x61e112[_0x4d70f3(0x1ef)][_0x4d70f3(0x20c)])throw Error(_0x4d70f3(0x228));if(!Number['isInteger'](_0x5e87cf['batchSize'])||_0x5e87cf['batchSize']<0x1||_0x5e87cf[_0x4d70f3(0x1fe)]>_0x35c933[_0x4d70f3(0x25b)])throw Error(_0x4d70f3(0x229));for(const _0xaeeb4a of _0x61e112[_0x4d70f3(0x1ef)]){if(Buffer[_0x4d70f3(0x217)](JSON[_0x4d70f3(0x1ff)]({'schemaFingerprint':_0x35c933[_0x4d70f3(0x20d)],'items':[{..._0xaeeb4a[_0x4d70f3(0x234)],'id':-0x1fffffffffffff}]}),_0x4d70f3(0x249))>_0x35c933['maxBatchBytes'])throw Error('Excel\x20row\x20'+_0xaeeb4a[_0x4d70f3(0x213)]+_0x4d70f3(0x257));}assertImportPaths(_0x5e87cf[_0x4d70f3(0x21b)],_0x5e87cf['report']);const _0x4ca74f={'appCode':_0x5e87cf[_0x4d70f3(0x255)],'datasetCode':_0x5e87cf[_0x4d70f3(0x1f0)],'runtimeDomain':_0x5e87cf[_0x4d70f3(0x26e)],'actorId':_0x35c933[_0x4d70f3(0x1fa)],'fileHash':_0x61e112[_0x4d70f3(0x1f1)],'mappingHash':_0x61e112[_0x4d70f3(0x21a)],'schemaHash':_0x61e112[_0x4d70f3(0x24a)],'remoteSchemaHash':_0x35c933['schemaFingerprint'],'batchSize':_0x5e87cf[_0x4d70f3(0x1fe)],'sheet':_0x61e112['sheet']},_0x168d54=await acquireLock(_0x5e87cf[_0x4d70f3(0x21b)]);let _0x501d4c;const _0x9766d4=Date['now']();let _0x4d47fd=0x0;const _0x5ac2a9=[],_0x1c7203=()=>({'importId':_0x501d4c?.[_0x4d70f3(0x216)],'sourceRows':_0x61e112[_0x4d70f3(0x1ef)][_0x4d70f3(0x20c)],'emptyRows':_0x61e112[_0x4d70f3(0x23e)][_0x4d70f3(0x20c)],'succeeded':_0x501d4c?.[_0x4d70f3(0x1ef)][_0x4d70f3(0x205)](_0x331954=>_0x331954[_0x4d70f3(0x25e)]===_0x4d70f3(0x220))[_0x4d70f3(0x20c)]??0x0,'unknown':_0x501d4c?.[_0x4d70f3(0x1ef)]['filter'](_0x5ce694=>_0x5ce694['status']===_0x4d70f3(0x1f2))[_0x4d70f3(0x20c)]??0x0,'conflicts':_0x501d4c?.[_0x4d70f3(0x1ef)][_0x4d70f3(0x205)](_0x53bf13=>_0x53bf13[_0x4d70f3(0x25e)]===_0x4d70f3(0x1fc))[_0x4d70f3(0x20c)]??0x0,'notAttempted':_0x501d4c?.[_0x4d70f3(0x1ef)]['filter'](_0x475701=>_0x475701[_0x4d70f3(0x25e)]===_0x4d70f3(0x20b))[_0x4d70f3(0x20c)]??_0x61e112[_0x4d70f3(0x1ef)][_0x4d70f3(0x20c)],'batches':_0x4d47fd,'batchResults':_0x5ac2a9,'elapsedMs':Date[_0x4d70f3(0x247)]()-_0x9766d4,'checkpoint':resolve(_0x5e87cf['checkpoint']),'report':resolve(_0x5e87cf[_0x4d70f3(0x201)]),'warnings':_0x61e112[_0x4d70f3(0x259)]});try{await rejectSymlink(_0x5e87cf[_0x4d70f3(0x21b)]);if(_0x5e87cf[_0x4d70f3(0x235)]){try{_0x501d4c=JSON[_0x4d70f3(0x21d)](await readFile(_0x5e87cf[_0x4d70f3(0x21b)],_0x4d70f3(0x249)));}catch{throw Error(_0x4d70f3(0x23f));}if(!_0x501d4c||_0x501d4c[_0x4d70f3(0x245)]!==0x1||typeof _0x501d4c['importId']!=='string'||canonical(_0x501d4c['binding'])!==canonical(_0x4ca74f)||!Array['isArray'](_0x501d4c[_0x4d70f3(0x1ef)])||_0x501d4c[_0x4d70f3(0x1ef)]['length']!==_0x61e112[_0x4d70f3(0x1ef)]['length']||new Set(_0x501d4c[_0x4d70f3(0x1ef)]['map'](_0x2a4340=>_0x2a4340['id']))[_0x4d70f3(0x274)]!==_0x501d4c[_0x4d70f3(0x1ef)]['length']||_0x501d4c[_0x4d70f3(0x1ef)][_0x4d70f3(0x1fd)]((_0x381cbf,_0xbaeb13)=>!Number[_0x4d70f3(0x23b)](_0x381cbf['id'])||_0x381cbf['id']>=0x0||_0x381cbf[_0x4d70f3(0x213)]!==_0x61e112[_0x4d70f3(0x1ef)][_0xbaeb13][_0x4d70f3(0x213)]||![_0x4d70f3(0x20b),_0x4d70f3(0x1f2),_0x4d70f3(0x220),_0x4d70f3(0x1fc)][_0x4d70f3(0x268)](_0x381cbf[_0x4d70f3(0x25e)])))throw Error(_0x4d70f3(0x1f3));}else{try{await lstat(_0x5e87cf['checkpoint']);throw Error(_0x4d70f3(0x237));}catch(_0x3da4c){if(_0x3da4c['code']!==_0x4d70f3(0x1eb))throw _0x3da4c;}const _0x5f54be=new Set();_0x501d4c={'version':0x1,'importId':randomUUID(),'binding':_0x4ca74f,'rows':_0x61e112[_0x4d70f3(0x1ef)][_0x4d70f3(0x25d)](_0x4d0d00=>{const _0x1997d4=_0x4d70f3;let _0x50e074;do{_0x50e074=-(Number(BigInt('0x'+randomBytes(0x7)[_0x1997d4(0x264)](_0x1997d4(0x24b)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x5f54be[_0x1997d4(0x241)](_0x50e074));return _0x5f54be[_0x1997d4(0x24e)](_0x50e074),{'id':_0x50e074,'rowNumber':_0x4d0d00[_0x1997d4(0x213)],'status':_0x1997d4(0x20b)};})},await saveImportJson(_0x5e87cf['checkpoint'],_0x501d4c);}await _0x5e87cf['onCheckpointReady']?.();const _0x335329=_0x501d4c;if(_0x335329[_0x4d70f3(0x1ef)][_0x4d70f3(0x1fd)](_0x5b0665=>_0x5b0665[_0x4d70f3(0x25e)]===_0x4d70f3(0x1fc)))throw Error(_0x4d70f3(0x210));const _0x5cc2cf=async _0x315edc=>{const _0x8de53d=_0x4d70f3,_0x518999=await _0xd091ea[_0x8de53d(0x251)](_0x315edc[_0x8de53d(0x25d)](_0x1ccc7b=>_0x335329[_0x8de53d(0x1ef)][_0x1ccc7b]['id']));if(!Array[_0x8de53d(0x24f)](_0x518999))throw Error(_0x8de53d(0x253));const _0x549961=new Set(_0x315edc[_0x8de53d(0x25d)](_0x19f2aa=>_0x335329[_0x8de53d(0x1ef)][_0x19f2aa]['id'])),_0x54a70b=new Map();for(const _0x1eb474 of _0x518999){const _0x21c82b=Number(_0x1eb474?.['id']);if(!_0x549961[_0x8de53d(0x241)](_0x21c82b)||_0x54a70b['has'](_0x21c82b))throw Error(_0x8de53d(0x1f6));_0x54a70b[_0x8de53d(0x227)](_0x21c82b,_0x1eb474);}for(const _0xce02af of _0x315edc){const _0x209b40=_0x54a70b[_0x8de53d(0x22a)](_0x335329[_0x8de53d(0x1ef)][_0xce02af]['id']);if(!_0x209b40)continue;if(_0x335329[_0x8de53d(0x1ef)][_0xce02af][_0x8de53d(0x25e)]===_0x8de53d(0x20b)){_0x335329['rows'][_0xce02af]['status']=_0x8de53d(0x1fc),await saveImportJson(_0x5e87cf['checkpoint'],_0x335329);throw Error(_0x8de53d(0x23d));}const _0x4e1f30=_0x61e112[_0x8de53d(0x1ef)][_0xce02af][_0x8de53d(0x234)];if(Object['keys'](_0x4e1f30)[_0x8de53d(0x1fd)](_0x2199fd=>!sameImportValue(_0x4e1f30[_0x2199fd],_0x209b40[_0x2199fd],_0x61e112[_0x8de53d(0x269)]?.[_0x8de53d(0x268)](_0x2199fd)&&!_0x61e112[_0x8de53d(0x244)]?.['includes'](_0x2199fd)))){_0x335329[_0x8de53d(0x1ef)][_0xce02af]['status']=_0x8de53d(0x1fc),await saveImportJson(_0x5e87cf[_0x8de53d(0x21b)],_0x335329);throw Error(_0x8de53d(0x21c)+_0x335329[_0x8de53d(0x1ef)][_0xce02af][_0x8de53d(0x213)]+'.');}_0x335329[_0x8de53d(0x1ef)][_0xce02af]['status']=_0x8de53d(0x220);}return await saveImportJson(_0x5e87cf[_0x8de53d(0x21b)],_0x335329),_0x54a70b;};if(_0x5e87cf[_0x4d70f3(0x235)])for(let _0x4dacce=0x0;_0x4dacce<_0x335329[_0x4d70f3(0x1ef)][_0x4d70f3(0x20c)];_0x4dacce+=_0x5e87cf['batchSize']){const _0x361a40=_0x335329['rows'][_0x4d70f3(0x25c)](_0x4dacce,_0x4dacce+_0x5e87cf[_0x4d70f3(0x1fe)])['map']((_0x4a7a7d,_0x248966)=>_0x4dacce+_0x248966),_0x391f75=_0x361a40[_0x4d70f3(0x205)](_0x2c2517=>_0x335329['rows'][_0x2c2517]['status']===_0x4d70f3(0x220)),_0x2ff814=await _0x5cc2cf(_0x361a40),_0x2423d4=_0x391f75[_0x4d70f3(0x205)](_0x3ebb06=>!_0x2ff814[_0x4d70f3(0x241)](_0x335329[_0x4d70f3(0x1ef)][_0x3ebb06]['id']));if(_0x2423d4[_0x4d70f3(0x20c)]){_0x2423d4[_0x4d70f3(0x226)](_0x7eaa9b=>{const _0x11c095=_0x4d70f3;_0x335329[_0x11c095(0x1ef)][_0x7eaa9b][_0x11c095(0x25e)]=_0x11c095(0x1fc);}),await saveImportJson(_0x5e87cf[_0x4d70f3(0x21b)],_0x335329);throw Error('Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.');}}for(let _0x1c5a1e=0x0;_0x1c5a1e<_0x335329[_0x4d70f3(0x1ef)][_0x4d70f3(0x20c)];){const _0x52e72a=[],_0x498ffa=[];while(_0x1c5a1e<_0x335329[_0x4d70f3(0x1ef)][_0x4d70f3(0x20c)]&&_0x498ffa[_0x4d70f3(0x20c)]<_0x5e87cf[_0x4d70f3(0x1fe)]){const _0x5f54a8=_0x1c5a1e++;if(_0x335329[_0x4d70f3(0x1ef)][_0x5f54a8][_0x4d70f3(0x25e)]===_0x4d70f3(0x220))continue;const _0x71ee23={..._0x61e112[_0x4d70f3(0x1ef)][_0x5f54a8][_0x4d70f3(0x234)],'id':_0x335329[_0x4d70f3(0x1ef)][_0x5f54a8]['id']};if(Buffer[_0x4d70f3(0x217)](JSON['stringify']({'schemaFingerprint':_0x35c933[_0x4d70f3(0x20d)],'items':[..._0x498ffa,_0x71ee23]}),_0x4d70f3(0x249))>_0x35c933[_0x4d70f3(0x200)]){if(!_0x498ffa[_0x4d70f3(0x20c)])throw Error(_0x4d70f3(0x266)+_0x335329[_0x4d70f3(0x1ef)][_0x5f54a8][_0x4d70f3(0x213)]+_0x4d70f3(0x257));_0x1c5a1e--;break;}_0x52e72a[_0x4d70f3(0x1ec)](_0x5f54a8),_0x498ffa[_0x4d70f3(0x1ec)](_0x71ee23);}if(!_0x498ffa[_0x4d70f3(0x20c)])continue;const _0x3bd226=_0x52e72a[_0x4d70f3(0x205)](_0x22e6c4=>_0x335329[_0x4d70f3(0x1ef)][_0x22e6c4]['status']===_0x4d70f3(0x20b));if(_0x3bd226[_0x4d70f3(0x20c)]){const _0x37fc0c=await _0xd091ea[_0x4d70f3(0x251)](_0x3bd226[_0x4d70f3(0x25d)](_0x481b70=>_0x335329['rows'][_0x481b70]['id']));if(!Array['isArray'](_0x37fc0c))throw Error(_0x4d70f3(0x253));if(_0x37fc0c[_0x4d70f3(0x20c)])throw Error(_0x4d70f3(0x23d));}_0x52e72a[_0x4d70f3(0x226)](_0x31f95a=>{const _0x35db30=_0x4d70f3;_0x335329[_0x35db30(0x1ef)][_0x31f95a][_0x35db30(0x25e)]=_0x35db30(0x1f2);}),await saveImportJson(_0x5e87cf[_0x4d70f3(0x21b)],_0x335329),_0x4d47fd++;const _0x13cff9=Date['now'](),_0x5ee4a4={'batch':_0x4d47fd,'rowStart':_0x335329['rows'][_0x52e72a[0x0]][_0x4d70f3(0x213)],'rowEnd':_0x335329[_0x4d70f3(0x1ef)][_0x52e72a[_0x52e72a['length']-0x1]][_0x4d70f3(0x213)],'count':_0x498ffa['length'],'bytes':Buffer[_0x4d70f3(0x217)](JSON[_0x4d70f3(0x1ff)]({'schemaFingerprint':_0x35c933[_0x4d70f3(0x20d)],'items':_0x498ffa}),_0x4d70f3(0x249)),'elapsedMs':0x0,'status':_0x4d70f3(0x208)};_0x5ac2a9[_0x4d70f3(0x1ec)](_0x5ee4a4);try{const _0x46d286=await _0xd091ea[_0x4d70f3(0x1f7)](_0x498ffa);if(!_0x46d286||_0x46d286[_0x4d70f3(0x204)]!==_0x498ffa[_0x4d70f3(0x20c)]||!Array[_0x4d70f3(0x24f)](_0x46d286[_0x4d70f3(0x21e)])||_0x46d286[_0x4d70f3(0x21e)][_0x4d70f3(0x20c)]!==_0x498ffa[_0x4d70f3(0x20c)]||_0x46d286[_0x4d70f3(0x21e)][_0x4d70f3(0x1fd)]((_0x223573,_0x1444b0)=>Number(_0x223573)!==_0x335329['rows'][_0x52e72a[_0x1444b0]]['id']))throw Error('Invalid\x20write\x20result.');await _0x5cc2cf(_0x52e72a);if(_0x52e72a['some'](_0x558aaf=>_0x335329[_0x4d70f3(0x1ef)][_0x558aaf][_0x4d70f3(0x25e)]!==_0x4d70f3(0x220)))throw Error('Incomplete\x20readback.');}catch(_0x6e13e0){if(_0x335329['rows'][_0x4d70f3(0x1fd)](_0xcb1fbd=>_0xcb1fbd[_0x4d70f3(0x25e)]===_0x4d70f3(0x1fc)))throw _0x6e13e0;try{await _0x5cc2cf(_0x52e72a);}catch(_0x3ccf91){if(_0x335329['rows'][_0x4d70f3(0x1fd)](_0x54df57=>_0x54df57[_0x4d70f3(0x25e)]===_0x4d70f3(0x1fc)))throw _0x3ccf91;}if(_0x52e72a[_0x4d70f3(0x1fd)](_0x1c48d9=>_0x335329[_0x4d70f3(0x1ef)][_0x1c48d9][_0x4d70f3(0x25e)]!==_0x4d70f3(0x220)))throw Error(_0x4d70f3(0x1f5));}finally{_0x5ee4a4[_0x4d70f3(0x262)]=Date[_0x4d70f3(0x247)]()-_0x13cff9;if(_0x52e72a[_0x4d70f3(0x25a)](_0x169785=>_0x335329['rows'][_0x169785][_0x4d70f3(0x25e)]===_0x4d70f3(0x220)))_0x5ee4a4[_0x4d70f3(0x25e)]=_0x4d70f3(0x220);else{if(_0x52e72a[_0x4d70f3(0x1fd)](_0x4f8a36=>_0x335329[_0x4d70f3(0x1ef)][_0x4f8a36]['status']==='conflict'))_0x5ee4a4['status']='conflict';}}}const _0x35e0d6={'status':_0x4d70f3(0x22d),..._0x1c7203()};return await saveImportJson(_0x5e87cf[_0x4d70f3(0x201)],_0x35e0d6),_0x35e0d6;}catch(_0x5de964){if(_0x501d4c)await saveImportJson(_0x5e87cf[_0x4d70f3(0x201)],{'status':'incomplete',..._0x1c7203(),'message':_0x5de964[_0x4d70f3(0x23c)]});throw _0x5de964;}finally{await _0x168d54();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a148_0x3dacd1=a148_0x5522;(function(_0x17100b,_0x21c844){const _0x3221c9=a148_0x5522,_0x1a3c67=_0x17100b();while(!![]){try{const _0x1773da=parseInt(_0x3221c9(0x20c))/0x1+parseInt(_0x3221c9(0x1f6))/0x2*(-parseInt(_0x3221c9(0x1fa))/0x3)+parseInt(_0x3221c9(0x207))/0x4+-parseInt(_0x3221c9(0x21c))/0x5+-parseInt(_0x3221c9(0x212))/0x6*(parseInt(_0x3221c9(0x1f7))/0x7)+-parseInt(_0x3221c9(0x204))/0x8*(-parseInt(_0x3221c9(0x1ff))/0x9)+parseInt(_0x3221c9(0x22b))/0xa;if(_0x1773da===_0x21c844)break;else _0x1a3c67['push'](_0x1a3c67['shift']());}catch(_0x4be8dc){_0x1a3c67['push'](_0x1a3c67['shift']());}}}(a148_0x395a,0x4915c));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';function a148_0x5522(_0x4a0ab4,_0x5d0f0e){_0x4a0ab4=_0x4a0ab4-0x1e5;const _0x395aae=a148_0x395a();let _0x5522a2=_0x395aae[_0x4a0ab4];return _0x5522a2;}import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';function a148_0x395a(){const _0x5dc43e=['INSTALL_FAILED','290400bipBwD','every','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','Unsafe\x20manifest\x20path:\x20','Unsupported\x20Skill\x20entry:\x20','497605IglclC','\x20verified;\x20','skills@latest\x20exited\x20','skipped','home','isSymbolicLink','110628QGUkce','isFile','version_mismatch','CLI\x20Built-in\x20Skill\x20','sort','lovrabet\x20cli-skill\x20install','message','utf8','unverifiable','sha256','2522610xLsxSN','includes','isDirectory','manifest','parse','version','log','match','count','join','path','installedPath','reason','skills','error','3362160cUXesl','partialFailure','status','update','packageRoot','present','name','schemaVersion','root','unknown','split','Installed\x20Skill\x20state\x20is\x20','skillVersion','stdio','SOURCE_INVALID','state','packageVersion','hex','SKILL.md','16yeFLBX','35mgyLgV','length','files','10263gIGgIq','VERIFY_FAILED','Symbolic\x20link\x20is\x20not\x20allowed:\x20','missing','trim','9TrdpDJ','digest','startsWith','output','current','136120wDwMkW','flatMap'];a148_0x395a=function(){return _0x5dc43e;};return a148_0x395a();}import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a148_0x3dacd1(0x217),SKILL_NAME='lovrabet',debug=debuglog('lovrabet-skills');function frontmatterValue(_0x36afd7,_0x135db7){const _0x1917e4=a148_0x3dacd1;return _0x36afd7[_0x1917e4(0x223)](new RegExp('^'+_0x135db7+':\x5cs*(.+)$','m'))?.[0x1]?.[_0x1917e4(0x1fe)]()??'';}function listFiles(_0x4dab56,_0x2ff11b=_0x4dab56){const _0x1d268f=a148_0x3dacd1;return readdirSync(_0x2ff11b,{'withFileTypes':!![]})[_0x1d268f(0x205)](_0x5beb23=>{const _0x2b6be0=_0x1d268f,_0x100260=join(_0x2ff11b,_0x5beb23[_0x2b6be0(0x1e9)]),_0x373391=lstatSync(_0x100260);if(_0x373391[_0x2b6be0(0x211)]())throw new Error(_0x2b6be0(0x1fc)+_0x100260);if(_0x373391[_0x2b6be0(0x21e)]())return listFiles(_0x4dab56,_0x100260);if(!_0x373391[_0x2b6be0(0x213)]())throw new Error(_0x2b6be0(0x20b)+_0x100260);return[relative(_0x4dab56,_0x100260)[_0x2b6be0(0x1ed)](sep)[_0x2b6be0(0x225)]('/')];})[_0x1d268f(0x216)]((_0x3c9f88,_0x19e7da)=>_0x3c9f88<_0x19e7da?-0x1:_0x3c9f88>_0x19e7da?0x1:0x0);}function digestFiles(_0xd9cd06,_0xc4774d){const _0x2f6e7e=a148_0x3dacd1,_0x236f4e=createHash(_0x2f6e7e(0x21b));for(const _0x4ef865 of _0xc4774d){if(_0x4ef865[_0x2f6e7e(0x201)]('/')||_0x4ef865[_0x2f6e7e(0x1ed)]('/')['includes']('..')||_0x4ef865[_0x2f6e7e(0x21d)]('\x5c'))throw new Error(_0x2f6e7e(0x20a)+_0x4ef865);_0x236f4e[_0x2f6e7e(0x1e6)](_0x4ef865),_0x236f4e[_0x2f6e7e(0x1e6)]('\x00'),_0x236f4e[_0x2f6e7e(0x1e6)](readFileSync(join(_0xd9cd06,..._0x4ef865[_0x2f6e7e(0x1ed)]('/')))),_0x236f4e[_0x2f6e7e(0x1e6)]('\x00');}return _0x236f4e[_0x2f6e7e(0x200)](_0x2f6e7e(0x1f4));}function sameFiles(_0x1e091b,_0x2e474b){const _0x5ad7d0=a148_0x3dacd1;return _0x1e091b[_0x5ad7d0(0x1f8)]===_0x2e474b[_0x5ad7d0(0x1f8)]&&_0x1e091b[_0x5ad7d0(0x208)]((_0xc8a7bb,_0x418a7c)=>_0xc8a7bb===_0x2e474b[_0x418a7c]);}function readSource(_0x1ad3b3){const _0x373e0d=a148_0x3dacd1,_0x583b4c=JSON[_0x373e0d(0x220)](readFileSync(join(_0x1ad3b3,'package.json'),'utf8')),_0x3443e5=JSON[_0x373e0d(0x220)](readFileSync(join(_0x1ad3b3,'skills','lovrabet.manifest.json'),_0x373e0d(0x219))),_0x429ce8=join(_0x1ad3b3,_0x373e0d(0x229),SKILL_NAME),_0x46de79=frontmatterValue(readFileSync(join(_0x429ce8,_0x373e0d(0x1f5)),_0x373e0d(0x219)),'version'),_0x1ff7ed=listFiles(_0x429ce8);if(_0x3443e5[_0x373e0d(0x1ea)]!==0x1||_0x3443e5[_0x373e0d(0x1e9)]!==SKILL_NAME||!_0x583b4c[_0x373e0d(0x221)]||_0x3443e5[_0x373e0d(0x1f3)]!==_0x583b4c[_0x373e0d(0x221)]||_0x3443e5[_0x373e0d(0x1ef)]!==_0x583b4c[_0x373e0d(0x221)]||_0x46de79!==_0x583b4c[_0x373e0d(0x221)]||!sameFiles(_0x1ff7ed,_0x3443e5[_0x373e0d(0x1f9)])||digestFiles(_0x429ce8,_0x1ff7ed)!==_0x3443e5['digest'])throw new Error(_0x373e0d(0x209));return{'packageVersion':_0x583b4c[_0x373e0d(0x221)],'skillVersion':_0x46de79,'root':_0x429ce8,'manifest':_0x3443e5};}function installedSkillPath(_0x355289){const _0x49b7ff=a148_0x3dacd1,_0xb5f2ac=resolveInstalledSkill(SKILL_NAME,{'home':_0x355289});if(_0xb5f2ac[_0x49b7ff(0x1f2)]===_0x49b7ff(0x1e8))return{'state':_0x49b7ff(0x1e8),'path':dirname(_0xb5f2ac['path'])};if(_0xb5f2ac['state']==='absent')return{'state':_0x49b7ff(0x1fd)};return{'state':_0x49b7ff(0x21a),'reason':_0xb5f2ac[_0x49b7ff(0x228)]};}export function inspectInstalledBuiltinSkillVersion(_0x37733a,_0x57ad40={}){const _0x5a7fc8=a148_0x3dacd1,_0x40ab9a=installedSkillPath(_0x57ad40[_0x5a7fc8(0x210)]??homedir());if(_0x40ab9a[_0x5a7fc8(0x1f2)]===_0x5a7fc8(0x1fd))return{'state':_0x5a7fc8(0x1fd),'expectedVersion':_0x37733a,'repairCommand':REPAIR_COMMAND};if(_0x40ab9a['state']===_0x5a7fc8(0x21a))return{'state':_0x5a7fc8(0x21a),'expectedVersion':_0x37733a,'reason':_0x40ab9a[_0x5a7fc8(0x228)],'repairCommand':REPAIR_COMMAND};try{const _0x516e49=frontmatterValue(readFileSync(join(_0x40ab9a[_0x5a7fc8(0x226)],_0x5a7fc8(0x1f5)),_0x5a7fc8(0x219)),_0x5a7fc8(0x221));return{'state':_0x516e49===_0x37733a?_0x5a7fc8(0x203):_0x5a7fc8(0x214),'expectedVersion':_0x37733a,'skillVersion':_0x516e49,'installedPath':_0x40ab9a['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x253e70){return{'state':_0x5a7fc8(0x21a),'expectedVersion':_0x37733a,'installedPath':_0x40ab9a[_0x5a7fc8(0x226)],'reason':_0x253e70 instanceof Error?_0x253e70[_0x5a7fc8(0x218)]:String(_0x253e70),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x12786a={}){const _0x21abba=a148_0x3dacd1,_0x35324f=_0x12786a[_0x21abba(0x1e7)]??DEFAULT_PACKAGE_ROOT;let _0x47518f;try{_0x47518f=readSource(_0x35324f);}catch(_0x36321b){return{'state':_0x21abba(0x21a),'packageVersion':_0x21abba(0x1ec),'reason':_0x36321b instanceof Error?_0x36321b[_0x21abba(0x218)]:String(_0x36321b),'repairCommand':REPAIR_COMMAND};}const _0x57eed5=installedSkillPath(_0x12786a[_0x21abba(0x210)]??homedir());if(_0x57eed5[_0x21abba(0x1f2)]===_0x21abba(0x1fd))return{'state':_0x21abba(0x1fd),'packageVersion':_0x47518f[_0x21abba(0x1f3)],'repairCommand':REPAIR_COMMAND};if(_0x57eed5[_0x21abba(0x1f2)]===_0x21abba(0x21a))return{'state':_0x21abba(0x21a),'packageVersion':_0x47518f['packageVersion'],'reason':_0x57eed5[_0x21abba(0x228)],'repairCommand':REPAIR_COMMAND};try{const _0xc90ad=frontmatterValue(readFileSync(join(_0x57eed5[_0x21abba(0x226)],_0x21abba(0x1f5)),_0x21abba(0x219)),_0x21abba(0x221));if(_0xc90ad!==_0x47518f['skillVersion'])return{'state':_0x21abba(0x214),'packageVersion':_0x47518f[_0x21abba(0x1f3)],'skillVersion':_0xc90ad,'installedPath':_0x57eed5['path'],'repairCommand':REPAIR_COMMAND};const _0x18a108=listFiles(_0x57eed5[_0x21abba(0x226)]),_0x213503=digestFiles(_0x57eed5[_0x21abba(0x226)],_0x18a108);return{'state':sameFiles(_0x18a108,_0x47518f[_0x21abba(0x21f)][_0x21abba(0x1f9)])&&_0x213503===_0x47518f[_0x21abba(0x21f)][_0x21abba(0x200)]?'current':'content_mismatch','packageVersion':_0x47518f[_0x21abba(0x1f3)],'skillVersion':_0xc90ad,'installedPath':_0x57eed5[_0x21abba(0x226)],'digest':_0x213503,'repairCommand':REPAIR_COMMAND};}catch(_0x5eb104){return{'state':'unverifiable','packageVersion':_0x47518f[_0x21abba(0x1f3)],'installedPath':_0x57eed5['path'],'reason':_0x5eb104 instanceof Error?_0x5eb104[_0x21abba(0x218)]:String(_0x5eb104),'repairCommand':REPAIR_COMMAND};}}function failure(_0x1d9529,_0x13499c,_0x3d1b0b,_0x5eb07d){const _0xc811bc=a148_0x3dacd1;return{'ok':![],'code':_0x1d9529,'packageVersion':_0x13499c['packageVersion'],'skillVersion':_0x13499c['skillVersion'],'installedPath':_0x5eb07d,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x3d1b0b instanceof Error?_0x3d1b0b[_0xc811bc(0x218)]:String(_0x3d1b0b)};}export function installBuiltinSkill(_0x48c926={}){const _0x5c668c=a148_0x3dacd1,_0x41bf9f=_0x48c926['packageRoot']??DEFAULT_PACKAGE_ROOT,_0x4b6325=_0x48c926[_0x5c668c(0x210)]??homedir();let _0x10b18b;try{_0x10b18b=readSource(_0x41bf9f);}catch(_0x3d7c04){return failure(_0x5c668c(0x1f1),{'packageVersion':_0x5c668c(0x1ec),'skillVersion':'unknown'},_0x3d7c04);}const _0x398b40=inspectBuiltinSkill({'packageRoot':_0x41bf9f,'home':_0x4b6325}),_0xeecce2=runNpxSkillsAddGlobal(_0x41bf9f,_0x10b18b[_0x5c668c(0x1eb)],{'stdio':_0x48c926[_0x5c668c(0x1f0)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x4b6325}});if(_0xeecce2[_0x5c668c(0x20f)])return{'ok':!![],'packageVersion':_0x10b18b[_0x5c668c(0x1f3)],'skillVersion':_0x10b18b[_0x5c668c(0x1ef)],'installedPath':_0x398b40['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0xeecce2['ok'])return failure(_0x5c668c(0x206),_0x10b18b,_0xeecce2[_0x5c668c(0x22a)]??_0x5c668c(0x20e)+_0xeecce2[_0x5c668c(0x1e5)]);const _0x5ce2f0=inspectBuiltinSkill({'packageRoot':_0x41bf9f,'home':_0x4b6325});if(_0x5ce2f0['state']!==_0x5c668c(0x203)){const _0x350aa5=_0x5ce2f0[_0x5c668c(0x228)]??_0x5c668c(0x1ee)+_0x5ce2f0[_0x5c668c(0x1f2)];return failure(_0x5c668c(0x1fb),_0x10b18b,_0xeecce2[_0x5c668c(0x22c)]?_0x350aa5+'\x0a'+_0xeecce2[_0x5c668c(0x22c)][_0x5c668c(0x202)]:_0x350aa5,_0x5ce2f0[_0x5c668c(0x227)]);}return _0xeecce2[_0x5c668c(0x22c)]&&(debug('Installer\x20reported\x20partial\x20target\x20failures:\x0a%s',_0xeecce2[_0x5c668c(0x22c)]['output']),console[_0x5c668c(0x222)](_0x5c668c(0x215)+_0x10b18b['skillVersion']+_0x5c668c(0x20d)+_0xeecce2['partialFailure'][_0x5c668c(0x224)]+'\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.')),{'ok':!![],'packageVersion':_0x10b18b[_0x5c668c(0x1f3)],'skillVersion':_0x10b18b[_0x5c668c(0x1ef)],'installedPath':_0x5ce2f0[_0x5c668c(0x227)],'changed':_0x398b40[_0x5c668c(0x1f2)]!==_0x5c668c(0x203),'repairCommand':REPAIR_COMMAND};}
|
|
1
|
+
const a148_0x25b12b=a148_0x36e2;(function(_0x41eae6,_0xe72307){const _0x2e8e14=a148_0x36e2,_0x5c7caa=_0x41eae6();while(!![]){try{const _0x412579=-parseInt(_0x2e8e14(0x153))/0x1*(-parseInt(_0x2e8e14(0x14d))/0x2)+parseInt(_0x2e8e14(0x16c))/0x3+parseInt(_0x2e8e14(0x15e))/0x4+-parseInt(_0x2e8e14(0x17b))/0x5+parseInt(_0x2e8e14(0x161))/0x6*(parseInt(_0x2e8e14(0x17f))/0x7)+-parseInt(_0x2e8e14(0x177))/0x8*(-parseInt(_0x2e8e14(0x152))/0x9)+-parseInt(_0x2e8e14(0x17c))/0xa;if(_0x412579===_0xe72307)break;else _0x5c7caa['push'](_0x5c7caa['shift']());}catch(_0x54805c){_0x5c7caa['push'](_0x5c7caa['shift']());}}}(a148_0x10b4,0xd4175));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';function a148_0x36e2(_0x25cf7f,_0x3361c4){_0x25cf7f=_0x25cf7f-0x141;const _0x10b473=a148_0x10b4();let _0x36e26a=_0x10b473[_0x25cf7f];return _0x36e26a;}import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a148_0x25b12b(0x164),SKILL_NAME='lovrabet',debug=debuglog(a148_0x25b12b(0x146));function frontmatterValue(_0x2e6cc7,_0x46f8d7){const _0x1af837=a148_0x25b12b;return _0x2e6cc7[_0x1af837(0x18a)](new RegExp('^'+_0x46f8d7+_0x1af837(0x176),'m'))?.[0x1]?.[_0x1af837(0x14b)]()??'';}function listFiles(_0x4433c7,_0x17f982=_0x4433c7){const _0x3931b7=a148_0x25b12b;return readdirSync(_0x17f982,{'withFileTypes':!![]})[_0x3931b7(0x151)](_0x5efea5=>{const _0x2e38cf=_0x3931b7,_0x24e288=join(_0x17f982,_0x5efea5[_0x2e38cf(0x159)]),_0x2c62f0=lstatSync(_0x24e288);if(_0x2c62f0[_0x2e38cf(0x180)]())throw new Error(_0x2e38cf(0x144)+_0x24e288);if(_0x2c62f0[_0x2e38cf(0x15f)]())return listFiles(_0x4433c7,_0x24e288);if(!_0x2c62f0['isFile']())throw new Error('Unsupported\x20Skill\x20entry:\x20'+_0x24e288);return[relative(_0x4433c7,_0x24e288)[_0x2e38cf(0x179)](sep)['join']('/')];})[_0x3931b7(0x15d)]((_0x1169b9,_0x438e15)=>_0x1169b9<_0x438e15?-0x1:_0x1169b9>_0x438e15?0x1:0x0);}function a148_0x10b4(){const _0x3cfeda=['isSymbolicLink','SOURCE_INVALID','startsWith','Unsafe\x20manifest\x20path:\x20','sha256','includes','root','content_mismatch','error','lovrabet.manifest.json','match','stdio','version_mismatch','skillVersion','Symbolic\x20link\x20is\x20not\x20allowed:\x20','utf8','lovrabet-skills','CLI\x20Built-in\x20Skill\x20','status','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','skills@latest\x20exited\x20','trim','partialFailure','1425064xiglzm','Installed\x20Skill\x20state\x20is\x20','current','missing','flatMap','9xruJBp','2Inecnl','schemaVersion','output','SKILL.md','packageRoot','INSTALL_FAILED','name','hex','parse','\x20verified;\x20','sort','4510528htfXFR','isDirectory','package.json','12VPwlmg','installedPath','update','lovrabet\x20cli-skill\x20install','packageVersion','length','present','pipe','home','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','every','538965FyPTLP','version','state','skipped','manifest','reason','digest','skills','message','unknown',':\x5cs*(.+)$','4915864AJyDUY','unverifiable','split','path','7613655aGqjru','14082840aCjnOx','files','count','1585171GTmzoI'];a148_0x10b4=function(){return _0x3cfeda;};return a148_0x10b4();}function digestFiles(_0x49efd1,_0x58706e){const _0x382346=a148_0x25b12b,_0x5966f5=createHash(_0x382346(0x184));for(const _0x5cd51d of _0x58706e){if(_0x5cd51d[_0x382346(0x182)]('/')||_0x5cd51d[_0x382346(0x179)]('/')[_0x382346(0x185)]('..')||_0x5cd51d['includes']('\x5c'))throw new Error(_0x382346(0x183)+_0x5cd51d);_0x5966f5[_0x382346(0x163)](_0x5cd51d),_0x5966f5[_0x382346(0x163)]('\x00'),_0x5966f5[_0x382346(0x163)](readFileSync(join(_0x49efd1,..._0x5cd51d[_0x382346(0x179)]('/')))),_0x5966f5[_0x382346(0x163)]('\x00');}return _0x5966f5[_0x382346(0x172)](_0x382346(0x15a));}function sameFiles(_0x3cdd7c,_0x3fb77c){const _0x58d4ec=a148_0x25b12b;return _0x3cdd7c[_0x58d4ec(0x166)]===_0x3fb77c['length']&&_0x3cdd7c[_0x58d4ec(0x16b)]((_0x506693,_0x1281c5)=>_0x506693===_0x3fb77c[_0x1281c5]);}function readSource(_0x49d709){const _0x412299=a148_0x25b12b,_0x484a92=JSON[_0x412299(0x15b)](readFileSync(join(_0x49d709,_0x412299(0x160)),_0x412299(0x145))),_0x348cc2=JSON[_0x412299(0x15b)](readFileSync(join(_0x49d709,_0x412299(0x173),_0x412299(0x189)),_0x412299(0x145))),_0x8fb93c=join(_0x49d709,_0x412299(0x173),SKILL_NAME),_0x21e4d9=frontmatterValue(readFileSync(join(_0x8fb93c,_0x412299(0x156)),_0x412299(0x145)),_0x412299(0x16d)),_0x4d95b2=listFiles(_0x8fb93c);if(_0x348cc2[_0x412299(0x154)]!==0x1||_0x348cc2['name']!==SKILL_NAME||!_0x484a92[_0x412299(0x16d)]||_0x348cc2[_0x412299(0x165)]!==_0x484a92[_0x412299(0x16d)]||_0x348cc2[_0x412299(0x143)]!==_0x484a92['version']||_0x21e4d9!==_0x484a92['version']||!sameFiles(_0x4d95b2,_0x348cc2[_0x412299(0x17d)])||digestFiles(_0x8fb93c,_0x4d95b2)!==_0x348cc2[_0x412299(0x172)])throw new Error('Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest');return{'packageVersion':_0x484a92['version'],'skillVersion':_0x21e4d9,'root':_0x8fb93c,'manifest':_0x348cc2};}function installedSkillPath(_0x10eec1){const _0x4085ef=a148_0x25b12b,_0x116368=resolveInstalledSkill(SKILL_NAME,{'home':_0x10eec1});if(_0x116368[_0x4085ef(0x16e)]===_0x4085ef(0x167))return{'state':'present','path':dirname(_0x116368[_0x4085ef(0x17a)])};if(_0x116368['state']==='absent')return{'state':_0x4085ef(0x150)};return{'state':_0x4085ef(0x178),'reason':_0x116368['reason']};}export function inspectInstalledBuiltinSkillVersion(_0x409929,_0x345402={}){const _0x4cc3de=a148_0x25b12b,_0x3a7e09=installedSkillPath(_0x345402[_0x4cc3de(0x169)]??homedir());if(_0x3a7e09['state']===_0x4cc3de(0x150))return{'state':_0x4cc3de(0x150),'expectedVersion':_0x409929,'repairCommand':REPAIR_COMMAND};if(_0x3a7e09[_0x4cc3de(0x16e)]==='unverifiable')return{'state':_0x4cc3de(0x178),'expectedVersion':_0x409929,'reason':_0x3a7e09['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x3c6d1b=frontmatterValue(readFileSync(join(_0x3a7e09[_0x4cc3de(0x17a)],_0x4cc3de(0x156)),_0x4cc3de(0x145)),_0x4cc3de(0x16d));return{'state':_0x3c6d1b===_0x409929?_0x4cc3de(0x14f):_0x4cc3de(0x142),'expectedVersion':_0x409929,'skillVersion':_0x3c6d1b,'installedPath':_0x3a7e09[_0x4cc3de(0x17a)],'repairCommand':REPAIR_COMMAND};}catch(_0xa9fd8d){return{'state':_0x4cc3de(0x178),'expectedVersion':_0x409929,'installedPath':_0x3a7e09[_0x4cc3de(0x17a)],'reason':_0xa9fd8d instanceof Error?_0xa9fd8d[_0x4cc3de(0x174)]:String(_0xa9fd8d),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x1174fa={}){const _0x3d345a=a148_0x25b12b,_0x321115=_0x1174fa[_0x3d345a(0x157)]??DEFAULT_PACKAGE_ROOT;let _0x197ddb;try{_0x197ddb=readSource(_0x321115);}catch(_0x298d8d){return{'state':_0x3d345a(0x178),'packageVersion':'unknown','reason':_0x298d8d instanceof Error?_0x298d8d[_0x3d345a(0x174)]:String(_0x298d8d),'repairCommand':REPAIR_COMMAND};}const _0x49d76b=installedSkillPath(_0x1174fa[_0x3d345a(0x169)]??homedir());if(_0x49d76b[_0x3d345a(0x16e)]===_0x3d345a(0x150))return{'state':_0x3d345a(0x150),'packageVersion':_0x197ddb[_0x3d345a(0x165)],'repairCommand':REPAIR_COMMAND};if(_0x49d76b['state']==='unverifiable')return{'state':'unverifiable','packageVersion':_0x197ddb[_0x3d345a(0x165)],'reason':_0x49d76b[_0x3d345a(0x171)],'repairCommand':REPAIR_COMMAND};try{const _0xc3584f=frontmatterValue(readFileSync(join(_0x49d76b[_0x3d345a(0x17a)],_0x3d345a(0x156)),_0x3d345a(0x145)),_0x3d345a(0x16d));if(_0xc3584f!==_0x197ddb[_0x3d345a(0x143)])return{'state':'version_mismatch','packageVersion':_0x197ddb[_0x3d345a(0x165)],'skillVersion':_0xc3584f,'installedPath':_0x49d76b['path'],'repairCommand':REPAIR_COMMAND};const _0x562b70=listFiles(_0x49d76b[_0x3d345a(0x17a)]),_0x132076=digestFiles(_0x49d76b['path'],_0x562b70);return{'state':sameFiles(_0x562b70,_0x197ddb[_0x3d345a(0x170)][_0x3d345a(0x17d)])&&_0x132076===_0x197ddb['manifest'][_0x3d345a(0x172)]?'current':_0x3d345a(0x187),'packageVersion':_0x197ddb[_0x3d345a(0x165)],'skillVersion':_0xc3584f,'installedPath':_0x49d76b['path'],'digest':_0x132076,'repairCommand':REPAIR_COMMAND};}catch(_0x15fd26){return{'state':_0x3d345a(0x178),'packageVersion':_0x197ddb[_0x3d345a(0x165)],'installedPath':_0x49d76b['path'],'reason':_0x15fd26 instanceof Error?_0x15fd26[_0x3d345a(0x174)]:String(_0x15fd26),'repairCommand':REPAIR_COMMAND};}}function failure(_0x403171,_0x219c04,_0x64d91b,_0xfd2a54){const _0x21d775=a148_0x25b12b;return{'ok':![],'code':_0x403171,'packageVersion':_0x219c04[_0x21d775(0x165)],'skillVersion':_0x219c04[_0x21d775(0x143)],'installedPath':_0xfd2a54,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x64d91b instanceof Error?_0x64d91b[_0x21d775(0x174)]:String(_0x64d91b)};}export function installBuiltinSkill(_0x24035f={}){const _0x156ea1=a148_0x25b12b,_0x370941=_0x24035f['packageRoot']??DEFAULT_PACKAGE_ROOT,_0x589b3e=_0x24035f[_0x156ea1(0x169)]??homedir();let _0x13324d;try{_0x13324d=readSource(_0x370941);}catch(_0x459bfd){return failure(_0x156ea1(0x181),{'packageVersion':_0x156ea1(0x175),'skillVersion':_0x156ea1(0x175)},_0x459bfd);}const _0x2a0b7c=inspectBuiltinSkill({'packageRoot':_0x370941,'home':_0x589b3e}),_0x59f84c=runNpxSkillsAddGlobal(_0x370941,_0x13324d[_0x156ea1(0x186)],{'stdio':_0x24035f[_0x156ea1(0x141)]??_0x156ea1(0x168),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x589b3e}});if(_0x59f84c[_0x156ea1(0x16f)])return{'ok':!![],'packageVersion':_0x13324d[_0x156ea1(0x165)],'skillVersion':_0x13324d[_0x156ea1(0x143)],'installedPath':_0x2a0b7c['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x59f84c['ok'])return failure(_0x156ea1(0x158),_0x13324d,_0x59f84c[_0x156ea1(0x188)]??_0x156ea1(0x14a)+_0x59f84c[_0x156ea1(0x148)]);const _0x3bff71=inspectBuiltinSkill({'packageRoot':_0x370941,'home':_0x589b3e});if(_0x3bff71[_0x156ea1(0x16e)]!==_0x156ea1(0x14f)){const _0xa09e3b=_0x3bff71[_0x156ea1(0x171)]??_0x156ea1(0x14e)+_0x3bff71[_0x156ea1(0x16e)];return failure('VERIFY_FAILED',_0x13324d,_0x59f84c[_0x156ea1(0x14c)]?_0xa09e3b+'\x0a'+_0x59f84c['partialFailure'][_0x156ea1(0x155)]:_0xa09e3b,_0x3bff71[_0x156ea1(0x162)]);}return _0x59f84c['partialFailure']&&(debug(_0x156ea1(0x149),_0x59f84c['partialFailure']['output']),console['log'](_0x156ea1(0x147)+_0x13324d[_0x156ea1(0x143)]+_0x156ea1(0x15c)+_0x59f84c[_0x156ea1(0x14c)][_0x156ea1(0x17e)]+_0x156ea1(0x16a))),{'ok':!![],'packageVersion':_0x13324d['packageVersion'],'skillVersion':_0x13324d[_0x156ea1(0x143)],'installedPath':_0x3bff71[_0x156ea1(0x162)],'changed':_0x2a0b7c[_0x156ea1(0x16e)]!=='current','repairCommand':REPAIR_COMMAND};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a149_0x2e4c3e=a149_0x5570;(function(_0x4a29a9,_0x4c799d){const _0x153cbc=a149_0x5570,_0x458432=_0x4a29a9();while(!![]){try{const _0x105216=parseInt(_0x153cbc(0xa5))/0x1*(-parseInt(_0x153cbc(0xc9))/0x2)+parseInt(_0x153cbc(0xb4))/0x3+parseInt(_0x153cbc(0xca))/0x4+-parseInt(_0x153cbc(0xcd))/0x5*(-parseInt(_0x153cbc(0xd8))/0x6)+-parseInt(_0x153cbc(0xb8))/0x7*(-parseInt(_0x153cbc(0xd4))/0x8)+-parseInt(_0x153cbc(0xab))/0x9+-parseInt(_0x153cbc(0xb0))/0xa*(parseInt(_0x153cbc(0xc7))/0xb);if(_0x105216===_0x4c799d)break;else _0x458432['push'](_0x458432['shift']());}catch(_0x167aa4){_0x458432['push'](_0x458432['shift']());}}}(a149_0x5e2e,0xa525c));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a149_0x3bdae2}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';function a149_0x5e2e(){const _0x24c1d6=['checked','stderr','present','599355JLudhR','failed','stdio','SKILL_NOT_INSTALLED','7NdkYKo','trim','add','Installer\x20reported\x20','code','shortMessage','CHILD_TERMINATED','CHILD_EXIT_NONZERO','match','skills@latest','warn','absent','NPX_NOT_FOUND','presence','EPERM','3421vPOyNQ','message','13982kyjsWx','1168192KQacUf','\x20failed\x20target(s)','npx\x20terminated\x20by\x20signal\x20','4236010MbfQyF','npx\x20failed\x20to\x20start','join','pipe','skipNpxSkillsEnvSuffix','state','reason','5627112Krbfur','filter','PERMISSION_DENIED','SPAWN_FAILED','6ttAVLi','EACCES','log','122eqAOlE','npx','stdout','signal','\x22\x20install\x20state:\x20','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','1642365KHhdag','NPM_CONFIG_GLOBAL','exit\x20','unknown','npm_config_global','10630JbRzSe'];a149_0x5e2e=function(){return _0x24c1d6;};return a149_0x5e2e();}import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a149_0x3bdae2;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG['internalSkillSource'];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x5bc745){const _0x193377=a149_0x5570;switch(_0x5bc745[_0x193377(0xb9)]()){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[a149_0x2e4c3e(0xd1)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x3f494a,_0x26308b,_0x27c032){return{'ok':![],'status':_0x26308b,'code':_0x3f494a,'error':'['+_0x3f494a+']\x20'+_0x27c032};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a149_0x5570(_0x1e66c7,_0x2530f7){_0x1e66c7=_0x1e66c7-0xa5;const _0x5e2e56=a149_0x5e2e();let _0x5570b0=_0x5e2e56[_0x1e66c7];return _0x5570b0;}export function runNpxSkillsAddGlobal(_0xcc8247,_0x5e320a=LOVRABET_SKILL_SOURCE,_0x5d44d4){const _0x59e817=a149_0x2e4c3e;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x883f5=['-y',_0x59e817(0xc1),_0x59e817(0xba),_0x5e320a,'-g','-y'],_0x48bb46=[_0x59e817(0xa6),..._0x883f5][_0x59e817(0xcf)]('\x20');console[_0x59e817(0xda)]('*\x20'+_0x48bb46);const _0x1f7ae4={...process.env};delete _0x1f7ae4[_0x59e817(0xaf)],delete _0x1f7ae4[_0x59e817(0xac)];const _0x1ec191=execaSync(_0x59e817(0xa6),_0x883f5,{'cwd':_0xcc8247,'stdio':_0x59e817(0xd0),'env':_0x1f7ae4,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x1d9421=[_0x1ec191['stdout']?String(_0x1ec191[_0x59e817(0xa7)]):'',_0x1ec191[_0x59e817(0xb2)]?String(_0x1ec191[_0x59e817(0xb2)]):''][_0x59e817(0xd5)](Boolean)[_0x59e817(0xcf)]('\x0a')[_0x59e817(0xb9)](),_0x46516c=_0x1ec191['exitCode']??null,_0x19aa6c=_0x1c5b73=>{const _0x404af4=_0x59e817;return _0x5d44d4?.[_0x404af4(0xb6)]!==_0x404af4(0xd0)&&!_0x1c5b73['partialFailure']&&_0x1d9421&&console[_0x404af4(0xda)](_0x1d9421),_0x1c5b73;};if(_0x1ec191[_0x59e817(0xbc)]){const _0x115dab=_0x1ec191[_0x59e817(0xbc)]==='ENOENT'?_0x59e817(0xc4):_0x1ec191[_0x59e817(0xbc)]===_0x59e817(0xc6)||_0x1ec191[_0x59e817(0xbc)]===_0x59e817(0xd9)?_0x59e817(0xd6):_0x59e817(0xd7);return _0x19aa6c(failure(_0x115dab,_0x46516c,_0x1ec191['shortMessage']??_0x1ec191[_0x59e817(0xc8)]??_0x1ec191[_0x59e817(0xbc)]));}if(_0x1ec191[_0x59e817(0xa8)])return _0x19aa6c(failure(_0x59e817(0xbe),_0x46516c,_0x59e817(0xcc)+_0x1ec191[_0x59e817(0xa8)]));if(_0x1ec191[_0x59e817(0xb5)]&&_0x46516c===null)return _0x19aa6c(failure(_0x59e817(0xd7),_0x46516c,_0x1ec191[_0x59e817(0xbd)]??_0x1ec191[_0x59e817(0xc8)]??_0x59e817(0xce)));if(_0x46516c!==0x0)return _0x19aa6c(failure(_0x59e817(0xbf),_0x46516c,_0x1d9421||_0x1ec191[_0x59e817(0xbd)]||_0x59e817(0xad)+(_0x46516c??_0x59e817(0xae))));const _0x53da7f=_0x5d44d4?.['expectedSkillName']??resolveGlobalSkillName(_0x5e320a),_0x4ee0ae=_0x53da7f?resolveInstalledSkill(_0x53da7f,_0x5d44d4?.[_0x59e817(0xc5)]):undefined,_0x368981=_0x1d9421[_0x59e817(0xc0)](/Failed to install\s+(\d+)/i);if(_0x368981&&Number(_0x368981[0x1])>0x0){const _0x50f0ef=_0x59e817(0xbb)+_0x368981[0x1]+_0x59e817(0xcb)+(_0x1d9421?':\x0a'+_0x1d9421:'');if(_0x4ee0ae?.['state']===_0x59e817(0xb3))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x368981[0x1]),'output':_0x1d9421}};return _0x19aa6c(failure('INSTALL_PARTIAL',0x0,_0x50f0ef));}if(_0x53da7f&&_0x4ee0ae){if(_0x4ee0ae[_0x59e817(0xd2)]===_0x59e817(0xc3))return _0x19aa6c(failure(_0x59e817(0xb7),0x0,'Skill\x20\x22'+_0x53da7f+_0x59e817(0xaa)+_0x4ee0ae[_0x59e817(0xb1)][_0x59e817(0xcf)](',\x20')+')'));_0x4ee0ae['state']==='unverifiable'&&console[_0x59e817(0xc2)]('!\x20Could\x20not\x20verify\x20\x22'+_0x53da7f+_0x59e817(0xa9)+_0x4ee0ae[_0x59e817(0xd3)]);}return _0x19aa6c({'ok':!![],'status':0x0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a150_0x1f4b04=a150_0x2231;(function(_0x48013e,_0x370779){const _0x4712e1=a150_0x2231,_0x2378ec=_0x48013e();while(!![]){try{const _0x135144=-parseInt(_0x4712e1(0x187))/0x1*(-parseInt(_0x4712e1(0x18e))/0x2)+-parseInt(_0x4712e1(0x17c))/0x3*(-parseInt(_0x4712e1(0x18b))/0x4)+parseInt(_0x4712e1(0x184))/0x5*(-parseInt(_0x4712e1(0x190))/0x6)+-parseInt(_0x4712e1(0x180))/0x7*(parseInt(_0x4712e1(0x182))/0x8)+-parseInt(_0x4712e1(0x17d))/0x9*(parseInt(_0x4712e1(0x186))/0xa)+-parseInt(_0x4712e1(0x191))/0xb*(-parseInt(_0x4712e1(0x18f))/0xc)+parseInt(_0x4712e1(0x185))/0xd;if(_0x135144===_0x370779)break;else _0x2378ec['push'](_0x2378ec['shift']());}catch(_0x55cc01){_0x2378ec['push'](_0x2378ec['shift']());}}}(a150_0x3c55,0xb75a6));function a150_0x2231(_0x2b63b2,_0x391534){_0x2b63b2=_0x2b63b2-0x17b;const _0x3c55f8=a150_0x3c55();let _0x223195=_0x3c55f8[_0x2b63b2];return _0x223195;}export const METADATA_FILE='lovrabet.skill.json';function a150_0x3c55(){const _0x581395=['7hLWUfO','.next','9811856ZfIsWR','dist','254255IrjFzr','16001232qJXEfi','12076770vplyDi','1XQCHQk','SKILL.md','node_modules','.git','246032tAMvrL','.DS_Store','.hg','1556474gcMKFc','10236084iXNsUV','78qrbtoB','11DClmCX','coverage','.turbo','.svn','48PrNqHN','9FOuPVg','.cache','build'];a150_0x3c55=function(){return _0x581395;};return a150_0x3c55();}export const SKILL_FILE=a150_0x1f4b04(0x188);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a150_0x1f4b04(0x18c)]);export const IGNORED_DIR_NAMES=new Set([a150_0x1f4b04(0x18a),a150_0x1f4b04(0x18d),a150_0x1f4b04(0x17b),a150_0x1f4b04(0x189),a150_0x1f4b04(0x181),a150_0x1f4b04(0x183),a150_0x1f4b04(0x17f),a150_0x1f4b04(0x192),a150_0x1f4b04(0x193),a150_0x1f4b04(0x17e)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5a8af4,_0x9a062){const _0x4256a8=a151_0x1ff2,_0x420858=_0x5a8af4();while(!![]){try{const _0x312e26=parseInt(_0x4256a8(0x163))/0x1+-parseInt(_0x4256a8(0x15a))/0x2*(parseInt(_0x4256a8(0x162))/0x3)+-parseInt(_0x4256a8(0x15c))/0x4*(-parseInt(_0x4256a8(0x15d))/0x5)+-parseInt(_0x4256a8(0x158))/0x6*(-parseInt(_0x4256a8(0x153))/0x7)+parseInt(_0x4256a8(0x154))/0x8*(-parseInt(_0x4256a8(0x156))/0x9)+-parseInt(_0x4256a8(0x15b))/0xa*(-parseInt(_0x4256a8(0x159))/0xb)+-parseInt(_0x4256a8(0x15e))/0xc;if(_0x312e26===_0x9a062)break;else _0x420858['push'](_0x420858['shift']());}catch(_0x39115a){_0x420858['push'](_0x420858['shift']());}}}(a151_0x56ff,0xbe196));function a151_0x1ff2(_0x48a6f3,_0x350f05){_0x48a6f3=_0x48a6f3-0x152;const _0x56ff6c=a151_0x56ff();let _0x1ff2c4=_0x56ff6c[_0x48a6f3];return _0x1ff2c4;}function a151_0x56ff(){const _0x128719=['2194PluRvu','28950WvLpIr','1850668upsYGo','5SGjlEU','4997928cfaTLd','stringify','isSymbolicLink','split','3018IHlXJC','608977cAjnVe','endsWith','450751mmvhkx','836520oJDWil','validation','45peHiyT','utf8','36oAWYKm','5181MFGylf'];a151_0x56ff=function(){return _0x128719;};return a151_0x56ff();}import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x332d98,_0x362aa6){const _0x3f1910=a151_0x1ff2,_0x4a53f2=normalizeSkillRelativePath(_0x362aa6),_0x259606=realOrResolved(_0x332d98),_0x43ece3=resolve(_0x259606,..._0x4a53f2['split']('/'));if(!isPathInside(_0x43ece3,_0x259606))throw CliErrors[_0x3f1910(0x155)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x362aa6);return ensureNoSymlinkInManagedPath(_0x259606,_0x4a53f2),_0x43ece3;}export function ensureNoSymlinkInManagedPath(_0x11e501,_0x3a823c){const _0x561cec=a151_0x1ff2;let _0x361f93=_0x11e501;for(const _0x569071 of _0x3a823c[_0x561cec(0x161)]('/')){_0x361f93=resolve(_0x361f93,_0x569071);const _0x3a0c8e=lstatIfPresent(_0x361f93);if(_0x3a0c8e?.[_0x561cec(0x160)]())throw CliErrors[_0x561cec(0x155)]('Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'+_0x3a823c);}}export function isDanglingSymlink(_0x1ebb4c){try{return lstatSync(_0x1ebb4c)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x56bd15){const _0x58a390=readlinkSync(_0x56bd15);return isAbsolute(_0x58a390)?_0x58a390:resolve(dirname(_0x56bd15),_0x58a390);}export function isPathInside(_0x79bfdc,_0x27873b){const _0x3c1d4a=a151_0x1ff2,_0xf2b320=_0x79bfdc[_0x3c1d4a(0x152)](sep)?_0x79bfdc:''+_0x79bfdc+sep,_0x4ad7f2=_0x27873b['endsWith'](sep)?_0x27873b:''+_0x27873b+sep;return _0x79bfdc===_0x27873b||_0xf2b320['startsWith'](_0x4ad7f2);}export function realOrResolved(_0x357aea){try{return realpathSync(_0x357aea);}catch{return resolve(_0x357aea);}}export function lstatIfPresent(_0x34d573){try{return lstatSync(_0x34d573);}catch{return undefined;}}export function writeTextAtomic(_0x5a30d7,_0x4ac823,_0x5f000f){const _0x2b95ef=a151_0x1ff2;writeBytesAtomic(_0x5a30d7,Buffer['from'](_0x4ac823,_0x2b95ef(0x157)),_0x5f000f);}export function writeBytesAtomic(_0x3bf3f4,_0x1f5d52,_0x183535){const _0x5e0812=_0x3bf3f4+'.tmp';try{writeFileSync(_0x5e0812,_0x1f5d52,{'mode':_0x183535}),renameSync(_0x5e0812,_0x3bf3f4);}catch(_0x92cc07){try{rmSync(_0x5e0812,{'force':!![]});}catch{}throw _0x92cc07;}}export function writeJsonAtomic(_0x20f154,_0x35ee8e){const _0x6c4d65=a151_0x1ff2;writeTextAtomic(_0x20f154,JSON[_0x6c4d65(0x15f)](_0x35ee8e,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5aa150,_0x73cf6e){const _0x43c71d=a152_0xd925,_0x549361=_0x5aa150();while(!![]){try{const _0x384b66=parseInt(_0x43c71d(0x105))/0x1*(parseInt(_0x43c71d(0x101))/0x2)+-parseInt(_0x43c71d(0x100))/0x3*(-parseInt(_0x43c71d(0xfe))/0x4)+-parseInt(_0x43c71d(0x103))/0x5+parseInt(_0x43c71d(0xfd))/0x6+parseInt(_0x43c71d(0x108))/0x7+-parseInt(_0x43c71d(0xfc))/0x8*(parseInt(_0x43c71d(0xff))/0x9)+-parseInt(_0x43c71d(0x10a))/0xa;if(_0x384b66===_0x73cf6e)break;else _0x549361['push'](_0x549361['shift']());}catch(_0x4bacc3){_0x549361['push'](_0x549361['shift']());}}}(a152_0x56ed,0xb2eff));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x4306c7){const _0x375362=a152_0xd925;return createHash(_0x375362(0x107))[_0x375362(0x106)](_0x4306c7)['digest'](_0x375362(0x102));}export function fileHash(_0x1112b0){return bufferSha256(fileContent(_0x1112b0));}export function bufferSha256(_0xbb037b){const _0x5d7d43=a152_0xd925;return createHash(_0x5d7d43(0x107))[_0x5d7d43(0x106)](_0xbb037b)[_0x5d7d43(0x10b)](_0x5d7d43(0x102));}function a152_0xd925(_0x9d5b4,_0x291a81){_0x9d5b4=_0x9d5b4-0xfc;const _0x56eddf=a152_0x56ed();let _0xd925d6=_0x56eddf[_0x9d5b4];return _0xd925d6;}export function fileTreeHash(_0x420c64){const _0x50c8ad=a152_0xd925,_0x49c638=createHash(_0x50c8ad(0x107));for(const _0x492d53 of normalizeManifestFiles(_0x420c64)){_0x49c638['update'](_0x492d53[_0x50c8ad(0x109)]),_0x49c638[_0x50c8ad(0x106)]('\x00'),_0x49c638[_0x50c8ad(0x106)](_0x492d53[_0x50c8ad(0x107)]),_0x49c638['update']('\x00'),_0x49c638[_0x50c8ad(0x106)](String(_0x492d53[_0x50c8ad(0x104)])),_0x49c638[_0x50c8ad(0x106)]('\x00');}return _0x49c638[_0x50c8ad(0x10b)](_0x50c8ad(0x102));}function a152_0x56ed(){const _0x1e88a7=['4928706LZObCG','264kRcste','46000vYiVNY','hex','2886360ZvKMak','size','40AOlyAb','update','sha256','2942079gnwKLl','path','7884050VJFIGw','digest','8NPCioo','5490798XuImkQ','17764cKjlyz'];a152_0x56ed=function(){return _0x1e88a7;};return a152_0x56ed();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x7fe36a=a153_0x1608;(function(_0x19c814,_0x46dd43){const _0x2c4226=a153_0x1608,_0x3f1171=_0x19c814();while(!![]){try{const _0x590a74=parseInt(_0x2c4226(0x143))/0x1+parseInt(_0x2c4226(0x13e))/0x2+-parseInt(_0x2c4226(0x13a))/0x3*(-parseInt(_0x2c4226(0x13d))/0x4)+parseInt(_0x2c4226(0x137))/0x5+-parseInt(_0x2c4226(0x136))/0x6+-parseInt(_0x2c4226(0x140))/0x7+-parseInt(_0x2c4226(0x134))/0x8*(parseInt(_0x2c4226(0x13f))/0x9);if(_0x590a74===_0x46dd43)break;else _0x3f1171['push'](_0x3f1171['shift']());}catch(_0x2836e4){_0x3f1171['push'](_0x3f1171['shift']());}}}(a153_0x30d5,0x5ef49));function a153_0x1608(_0x40602d,_0x4760a0){_0x40602d=_0x40602d-0x134;const _0x30d538=a153_0x30d5();let _0x16081b=_0x30d538[_0x40602d];return _0x16081b;}function a153_0x30d5(){const _0x467b1a=['managedRoot','1437112dqbzBE','1425848yQQPYM','44793VNTijH','252525uEOaWc','appCode','cwd','508039oEvzsv','2456tOpGKm','skills','1459968bpfSRW','3080190kpQiNd','global','freeze','3xvbRJR','.agents'];a153_0x30d5=function(){return _0x467b1a;};return a153_0x30d5();}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x65c30c,_0x43b4fe=a153_0x7fe36a(0x138),_0x3ed4da={}){const _0x22f121=a153_0x7fe36a,_0x18a93c=resolveSkillSyncPaths(_0x3ed4da),_0x131399=safePathSegment(_0x65c30c,_0x22f121(0x141)),_0x142cff=_0x43b4fe==='project'?[resolve(_0x3ed4da[_0x22f121(0x142)]??process[_0x22f121(0x142)](),_0x22f121(0x13b),_0x22f121(0x135))]:runtimeAgentSkillRoots(_0x18a93c);return Object[_0x22f121(0x139)]({'scope':_0x43b4fe,'appCode':_0x131399,'skillRoots':Object['freeze'](_0x142cff),'managedRoot':_0x18a93c[_0x22f121(0x13c)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a154_0x302f20=a154_0x3efc;(function(_0x219b72,_0x2f037c){const _0xb26b91=a154_0x3efc,_0x5c4464=_0x219b72();while(!![]){try{const _0x237f47=-parseInt(_0xb26b91(0x9b))/0x1*(parseInt(_0xb26b91(0xad))/0x2)+parseInt(_0xb26b91(0xba))/0x3*(-parseInt(_0xb26b91(0xb0))/0x4)+-parseInt(_0xb26b91(0xa6))/0x5*(parseInt(_0xb26b91(0xce))/0x6)+-parseInt(_0xb26b91(0xb6))/0x7+parseInt(_0xb26b91(0xd3))/0x8*(-parseInt(_0xb26b91(0xcb))/0x9)+parseInt(_0xb26b91(0xc4))/0xa*(-parseInt(_0xb26b91(0x9c))/0xb)+-parseInt(_0xb26b91(0xb3))/0xc*(-parseInt(_0xb26b91(0xca))/0xd);if(_0x237f47===_0x2f037c)break;else _0x5c4464['push'](_0x5c4464['shift']());}catch(_0x408fd5){_0x5c4464['push'](_0x5c4464['shift']());}}}(a154_0x3710,0xb27a5));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';function a154_0x3efc(_0x107bc0,_0x3aaadf){_0x107bc0=_0x107bc0-0x9a;const _0x371096=a154_0x3710();let _0x3efc86=_0x371096[_0x107bc0];return _0x3efc86;}import a154_0x1f43e4 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a154_0x1f43e4,RESERVED_PROJECT_SKILL_CODES=new Set([a154_0x302f20(0xd5),a154_0x302f20(0xc5),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x4d741f,_0x593aaf){const _0x53c574=a154_0x302f20,_0x17f736=new Map();for(const _0x31eb8b of _0x4d741f){const _0x569d6c=_0x31eb8b[_0x53c574(0xc0)]['skillCode'];if(!_0x569d6c)continue;const _0x33d774=_0x17f736[_0x53c574(0x9f)](_0x569d6c);(!_0x33d774||_0x31eb8b['scope']===_0x53c574(0xa0))&&_0x17f736['set'](_0x569d6c,_0x31eb8b);}const _0x298545=[];for(const _0x1966a1 of _0x17f736[_0x53c574(0xbd)]()){const _0x33f150=requireSkillCode(_0x1966a1['skill']),_0x3d3a10=readMetadataIfPresent(_0x1966a1[_0x53c574(0x9d)]);if(_0x3d3a10?.[_0x53c574(0xcf)]!==_0x593aaf['appCode']||_0x3d3a10[_0x53c574(0xa3)]!==_0x33f150)throw CliErrors[_0x53c574(0xbf)](_0x53c574(0xc9)+_0x593aaf[_0x53c574(0xcf)]+':\x20'+_0x1966a1[_0x53c574(0x9d)]);const _0x2232ac=runtimeSkillLinkName(_0x593aaf,_0x33f150);for(const _0x13ee72 of _0x593aaf['skillRoots']){_0x298545[_0x53c574(0xd6)](ensureManagedSymlink(resolve(_0x13ee72,_0x2232ac),_0x1966a1[_0x53c574(0xcd)],_0x593aaf,_0x33f150));}}return _0x298545;}export function pruneStaleRuntimeSkillLinks(_0x20eb4e,_0x350549,_0x40d927){const _0x39d169=a154_0x302f20,_0x574ff0=new Set([..._0x350549][_0x39d169(0xd0)](_0x54531f=>_0x54531f[_0x39d169(0xbe)]())[_0x39d169(0xaf)](Boolean)),_0x1d060f=_0x40d927?new Set([..._0x40d927][_0x39d169(0xd0)](_0x1507ca=>_0x1507ca[_0x39d169(0xbe)]())[_0x39d169(0xaf)](Boolean)):undefined,_0x2f3151=[];for(const _0x4daff4 of _0x20eb4e['skillRoots']){for(const _0x2c77d4 of managedTargetSkillLinkPaths(_0x4daff4,_0x20eb4e)){const _0x441448=runtimeSkillCodeFromLink(_0x20eb4e,_0x2c77d4);if(_0x1d060f&&!_0x1d060f['has'](_0x441448))continue;if(_0x574ff0[_0x39d169(0xb8)](_0x441448))continue;_0x2f3151[_0x39d169(0xd6)](removeManagedSkillLink(_0x2c77d4,_0x20eb4e,_0x441448));}}return _0x2f3151;}export function pruneStaleRuntimeSkillCache(_0x240d4f,_0x59e44e={}){const _0x299993=a154_0x302f20,_0x366cb6=new Set([..._0x240d4f[_0x299993(0xbb)]][_0x299993(0xd0)](_0x1cfb0c=>_0x1cfb0c[_0x299993(0xbe)]())['filter'](Boolean)),_0x2ac149=_0x240d4f['pruneSkillCodes']?new Set([..._0x240d4f['pruneSkillCodes']][_0x299993(0xd0)](_0xee1259=>_0xee1259[_0x299993(0xbe)]())[_0x299993(0xaf)](Boolean)):undefined,_0x29ae76=_0x240d4f[_0x299993(0xc2)]??[_0x299993(0xa0),_0x299993(0xa7)],_0x2ebea1=resolve(getRuntimeSkillCacheRoot(_0x240d4f[_0x299993(0xa1)],_0x240d4f['accessKey'],_0x59e44e),safePathSegment(_0x240d4f[_0x299993(0xcf)],'appCode')),_0x3ae3b9=[];for(const _0x1e90b6 of _0x29ae76){const _0x387882=resolve(_0x2ebea1,_0x1e90b6);if(!existsSync(_0x387882))continue;for(const _0x3f6616 of readdirSync(_0x387882,{'withFileTypes':!![]})){if(!_0x3f6616[_0x299993(0xd8)]())continue;const _0x2b3145=_0x3f6616[_0x299993(0xb2)];if(_0x2ac149&&!_0x2ac149[_0x299993(0xb8)](_0x2b3145))continue;if(_0x366cb6[_0x299993(0xb8)](_0x2b3145))continue;const _0x56155d=resolve(_0x387882,_0x2b3145),_0x21ced8=readMetadataIfPresent(resolve(_0x56155d,METADATA_FILE));if(_0x21ced8?.[_0x299993(0xcf)]!==_0x240d4f[_0x299993(0xcf)]||_0x21ced8[_0x299993(0xaa)]!==_0x1e90b6||_0x21ced8[_0x299993(0xa3)]!==_0x2b3145){_0x3ae3b9[_0x299993(0xd6)]({'path':_0x56155d,'action':_0x299993(0xac),'reason':_0x299993(0xb7)});continue;}if(isLinkedFromAnyRoot(_0x56155d,_0x240d4f[_0x299993(0xc1)]??[])){_0x3ae3b9[_0x299993(0xd6)]({'path':_0x56155d,'action':_0x299993(0xac),'reason':_0x299993(0xa9)});continue;}removeSync(_0x56155d),_0x3ae3b9[_0x299993(0xd6)]({'path':_0x56155d,'action':_0x299993(0xb1)});}}return _0x3ae3b9;}export function linkGlobalRuntimeSkills(_0x5d32c1,_0x33ca0b={}){const _0x3a4c2c=a154_0x302f20,_0x5e1cde=resolveSkillSyncPaths(_0x33ca0b),_0x576f3c=[];for(const _0x47a729 of _0x5d32c1){if(_0x47a729[_0x3a4c2c(0xaa)]!==_0x3a4c2c(0xd2))throw CliErrors[_0x3a4c2c(0xbf)](_0x3a4c2c(0xcc)+_0x47a729[_0x3a4c2c(0xaa)]);const _0x71c9fa=requireSkillCode(_0x47a729[_0x3a4c2c(0xc0)]),_0x3b42e0=copyManagedSkillDirectory(_0x47a729['dir'],resolve(_0x5e1cde[_0x3a4c2c(0x9a)],_0x71c9fa));_0x576f3c[_0x3a4c2c(0xd6)]({..._0x3b42e0,'contentHash':_0x47a729[_0x3a4c2c(0xb5)]});}return _0x576f3c;}function ensureManagedSymlink(_0x57c0d1,_0x10f459,_0xd0932,_0x5b0edc){const _0x1f2c02=a154_0x302f20;mkdirSync(dirname(_0x57c0d1),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x57c0d1)||isDanglingSymlink(_0x57c0d1)){const _0x4e855d=lstatSync(_0x57c0d1);if(!_0x4e855d[_0x1f2c02(0xd4)]())throw CliErrors[_0x1f2c02(0xbf)](_0x1f2c02(0xa4)+_0x57c0d1);const _0x48a08c=resolveSymlinkTarget(_0x57c0d1);if(!isPathInside(realOrResolved(_0x48a08c),realOrResolved(_0xd0932[_0x1f2c02(0xd7)])))throw CliErrors[_0x1f2c02(0xbf)](_0x1f2c02(0xb9)+_0x57c0d1);if(realOrResolved(_0x48a08c)===realOrResolved(_0x10f459))return{'path':_0x57c0d1,'target':_0x10f459,'action':_0x1f2c02(0xc3)};const _0x54e05b=readMetadataIfPresent(resolve(_0x48a08c,METADATA_FILE));if(_0xd0932[_0x1f2c02(0xaa)]===_0x1f2c02(0xb4)&&(_0x54e05b?.[_0x1f2c02(0xcf)]!==_0xd0932[_0x1f2c02(0xcf)]||_0x54e05b[_0x1f2c02(0xa3)]!==_0x5b0edc))throw CliErrors[_0x1f2c02(0xbf)](_0x1f2c02(0xa8)+_0x57c0d1);return unlinkSync(_0x57c0d1),symlinkSync(_0x10f459,_0x57c0d1,'dir'),{'path':_0x57c0d1,'target':_0x10f459,'action':_0x1f2c02(0xd1)};}return symlinkSync(_0x10f459,_0x57c0d1,_0x1f2c02(0xcd)),{'path':_0x57c0d1,'target':_0x10f459,'action':_0x1f2c02(0xa5)};}function managedTargetSkillLinkPaths(_0x2dae14,_0x1cf1e5){const _0x59eeed=a154_0x302f20;if(!existsSync(_0x2dae14))return[];const _0x1c0a38=_0x1cf1e5[_0x59eeed(0xcf)]+'--';return readdirSync(_0x2dae14,{'withFileTypes':!![]})['filter'](_0x39fd79=>_0x1cf1e5['scope']===_0x59eeed(0xb4)||_0x39fd79[_0x59eeed(0xb2)]['startsWith'](_0x1c0a38))['map'](_0x87b1e2=>resolve(_0x2dae14,_0x87b1e2['name']));}function removeManagedSkillLink(_0x270db3,_0x40951e,_0x32db47){const _0x3c526e=a154_0x302f20,_0x568ff7=lstatIfPresent(_0x270db3);if(!_0x568ff7?.['isSymbolicLink']())return{'path':_0x270db3,'action':_0x3c526e(0xac),'reason':_0x3c526e(0xbc)};const _0x48d850=resolveSymlinkTarget(_0x270db3);if(!isPathInside(realOrResolved(_0x48d850),realOrResolved(_0x40951e[_0x3c526e(0xd7)])))return{'path':_0x270db3,'action':_0x3c526e(0xac),'reason':'external-symlink'};const _0x3ae252=readMetadataIfPresent(resolve(_0x48d850,METADATA_FILE));if(_0x40951e['scope']===_0x3c526e(0xb4)&&(_0x3ae252?.[_0x3c526e(0xcf)]!==_0x40951e[_0x3c526e(0xcf)]||_0x3ae252['skillCode']!==_0x32db47))return{'path':_0x270db3,'action':'skipped','reason':_0x3c526e(0xb7)};return unlinkSync(_0x270db3),{'path':_0x270db3,'action':_0x3c526e(0xb1)};}function isLinkedFromAnyRoot(_0xcc06e3,_0x1df173){const _0x2f02eb=a154_0x302f20,_0x470191=realOrResolved(_0xcc06e3);for(const _0x167cfe of _0x1df173){if(!existsSync(_0x167cfe))continue;for(const _0x1af311 of readdirSync(_0x167cfe,{'withFileTypes':!![]})){if(!_0x1af311[_0x2f02eb(0xd4)]())continue;const _0x5f1bf7=resolve(_0x167cfe,_0x1af311[_0x2f02eb(0xb2)]);if(realOrResolved(resolveSymlinkTarget(_0x5f1bf7))===_0x470191)return!![];}}return![];}function runtimeSkillLinkName(_0x2ebd9b,_0x4bd991){const _0x5c8998=a154_0x302f20,_0x265234=safePathSegment(_0x4bd991,_0x5c8998(0xa3));if(_0x2ebd9b[_0x5c8998(0xaa)]===_0x5c8998(0xb4)&&RESERVED_PROJECT_SKILL_CODES[_0x5c8998(0xb8)](_0x265234))throw CliErrors['validation'](_0x5c8998(0xc7)+_0x265234);return _0x2ebd9b[_0x5c8998(0xaa)]===_0x5c8998(0xb4)?_0x265234:_0x2ebd9b[_0x5c8998(0xcf)]+'--'+_0x265234;}function runtimeSkillCodeFromLink(_0x368fcc,_0x34a3c0){const _0xc9e558=a154_0x302f20,_0x3411a0=basename(_0x34a3c0);return _0x368fcc[_0xc9e558(0xaa)]===_0xc9e558(0xb4)?_0x3411a0:_0x3411a0[_0xc9e558(0x9e)]((_0x368fcc[_0xc9e558(0xcf)]+'--')[_0xc9e558(0xc8)]);}export function copyManagedSkillDirectory(_0x15a797,_0x1bbeb8){const _0x1e1f87=a154_0x302f20,_0x5a65ab=resolve(_0x1bbeb8,METADATA_FILE),_0x51554f=existsSync(_0x1bbeb8);if(_0x51554f){const _0xd9f328=lstatSync(_0x1bbeb8);if(_0xd9f328[_0x1e1f87(0xd4)]())throw CliErrors[_0x1e1f87(0xbf)](_0x1e1f87(0xae)+_0x1bbeb8);if(!_0xd9f328['isDirectory']())throw CliErrors[_0x1e1f87(0xbf)](_0x1e1f87(0xc6)+_0x1bbeb8);const _0x165e88=readMetadataIfPresent(_0x5a65ab);if(_0x165e88?.[_0x1e1f87(0xaa)]!==_0x1e1f87(0xd2))throw CliErrors['validation'](_0x1e1f87(0xa2)+_0x1bbeb8);}ensureDirSync(dirname(_0x1bbeb8));const _0x34d1d2=_0x51554f?readMetadataIfPresent(_0x5a65ab)?.['contentHash']:undefined,_0x5a16e5=readMetadataIfPresent(resolve(_0x15a797,METADATA_FILE))?.[_0x1e1f87(0xb5)];return _0x51554f&&removeSync(_0x1bbeb8),copySkillDirectory(_0x15a797,_0x1bbeb8),{'path':_0x1bbeb8,'target':_0x15a797,'action':!_0x51554f?_0x1e1f87(0xa5):_0x34d1d2===_0x5a16e5?'unchanged':_0x1e1f87(0xd1)};}function copySkillDirectory(_0x3f7633,_0x241ee8){copySync(_0x3f7633,_0x241ee8,{'dereference':![],'overwrite':!![],'filter'(_0x4ef5b3){const _0x2d27d6=a154_0x3efc;if(lstatSync(_0x4ef5b3)['isSymbolicLink']())throw CliErrors[_0x2d27d6(0xbf)](_0x2d27d6(0xab)+_0x4ef5b3);return!![];}});}function a154_0x3710(){const _0x4646da=['skillCode','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','created','215sFBcsx','company','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','linked-from-protected-root','scope','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','skipped','1041494bHSNmk','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','filter','212aVzkdw','removed','name','29868LbyGDV','project','contentHash','231490diOSQC','metadata-mismatch','has','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','47733FbXHlx','activeSkillCodes','not-managed-symlink','values','trim','validation','skill','protectedLinkRoots','scopes','unchanged','70SfiBrv','runtime-observe','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','length','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','23439DxNiBG','12060CqsulE','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','dir','45042CPEYWq','appCode','map','updated','builtin','8432pOijuD','isSymbolicLink','lovrabet','push','managedRoot','isDirectory','agentsSkillsDir','2mBMrMG','162822XPTNcL','metadataPath','slice','get','personal','env','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'];a154_0x3710=function(){return _0x4646da;};return a154_0x3710();}
|
|
1
|
+
const a154_0x3c9c4a=a154_0x4ef8;(function(_0x1f16a7,_0x50ce07){const _0x48c92d=a154_0x4ef8,_0x166516=_0x1f16a7();while(!![]){try{const _0x55dcc0=parseInt(_0x48c92d(0x188))/0x1+parseInt(_0x48c92d(0x184))/0x2*(parseInt(_0x48c92d(0x18a))/0x3)+-parseInt(_0x48c92d(0x1a6))/0x4*(parseInt(_0x48c92d(0x195))/0x5)+-parseInt(_0x48c92d(0x1a4))/0x6+parseInt(_0x48c92d(0x17c))/0x7+-parseInt(_0x48c92d(0x1ad))/0x8*(-parseInt(_0x48c92d(0x192))/0x9)+parseInt(_0x48c92d(0x18b))/0xa*(parseInt(_0x48c92d(0x1a3))/0xb);if(_0x55dcc0===_0x50ce07)break;else _0x166516['push'](_0x166516['shift']());}catch(_0x28b317){_0x166516['push'](_0x166516['shift']());}}}(a154_0xa21a,0xdd5b4));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a154_0x3ae89c from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a154_0x3ae89c,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet','runtime-observe',a154_0x3c9c4a(0x194)]);export function linkEffectiveRuntimeSkills(_0x14387b,_0xd80f6a){const _0x56b918=a154_0x3c9c4a,_0x4c04ce=new Map();for(const _0x919676 of _0x14387b){const _0x3499bc=_0x919676[_0x56b918(0x18e)]['skillCode'];if(!_0x3499bc)continue;const _0x50801f=_0x4c04ce[_0x56b918(0x1a9)](_0x3499bc);(!_0x50801f||_0x919676[_0x56b918(0x18c)]==='personal')&&_0x4c04ce[_0x56b918(0x17f)](_0x3499bc,_0x919676);}const _0x23a374=[];for(const _0x48cccf of _0x4c04ce[_0x56b918(0x19b)]()){const _0x94d0c6=requireSkillCode(_0x48cccf[_0x56b918(0x18e)]),_0x382b44=readMetadataIfPresent(_0x48cccf['metadataPath']);if(_0x382b44?.[_0x56b918(0x17b)]!==_0xd80f6a[_0x56b918(0x17b)]||_0x382b44[_0x56b918(0x1ac)]!==_0x94d0c6)throw CliErrors['validation'](_0x56b918(0x1a8)+_0xd80f6a['appCode']+':\x20'+_0x48cccf['metadataPath']);const _0x3cedc2=runtimeSkillLinkName(_0xd80f6a,_0x94d0c6);for(const _0x19df2c of _0xd80f6a[_0x56b918(0x187)]){_0x23a374[_0x56b918(0x179)](ensureManagedSymlink(resolve(_0x19df2c,_0x3cedc2),_0x48cccf[_0x56b918(0x183)],_0xd80f6a,_0x94d0c6));}}return _0x23a374;}export function pruneStaleRuntimeSkillLinks(_0x1ad39e,_0x1d138e,_0x5acaea){const _0x415f25=a154_0x3c9c4a,_0x2243ad=new Set([..._0x1d138e][_0x415f25(0x199)](_0x2dc3c8=>_0x2dc3c8[_0x415f25(0x1a1)]())['filter'](Boolean)),_0x25ab7d=_0x5acaea?new Set([..._0x5acaea][_0x415f25(0x199)](_0x209c7e=>_0x209c7e[_0x415f25(0x1a1)]())[_0x415f25(0x18f)](Boolean)):undefined,_0x5c95f4=[];for(const _0x393187 of _0x1ad39e[_0x415f25(0x187)]){for(const _0x405fc1 of managedTargetSkillLinkPaths(_0x393187,_0x1ad39e)){const _0x5cf097=runtimeSkillCodeFromLink(_0x1ad39e,_0x405fc1);if(_0x25ab7d&&!_0x25ab7d['has'](_0x5cf097))continue;if(_0x2243ad[_0x415f25(0x178)](_0x5cf097))continue;_0x5c95f4['push'](removeManagedSkillLink(_0x405fc1,_0x1ad39e,_0x5cf097));}}return _0x5c95f4;}export function pruneStaleRuntimeSkillCache(_0x88c4b5,_0xb3c0a0={}){const _0x36c14c=a154_0x3c9c4a,_0x1a9160=new Set([..._0x88c4b5[_0x36c14c(0x19c)]][_0x36c14c(0x199)](_0x18f6a8=>_0x18f6a8['trim']())[_0x36c14c(0x18f)](Boolean)),_0x2acfe6=_0x88c4b5[_0x36c14c(0x185)]?new Set([..._0x88c4b5[_0x36c14c(0x185)]]['map'](_0x3056c2=>_0x3056c2[_0x36c14c(0x1a1)]())['filter'](Boolean)):undefined,_0x3f77db=_0x88c4b5[_0x36c14c(0x1ab)]??[_0x36c14c(0x182),_0x36c14c(0x17a)],_0x58cb24=resolve(getRuntimeSkillCacheRoot(_0x88c4b5[_0x36c14c(0x176)],_0x88c4b5[_0x36c14c(0x19d)],_0xb3c0a0),safePathSegment(_0x88c4b5[_0x36c14c(0x17b)],_0x36c14c(0x17b))),_0x175fd5=[];for(const _0x26af46 of _0x3f77db){const _0x44e590=resolve(_0x58cb24,_0x26af46);if(!existsSync(_0x44e590))continue;for(const _0x5394e5 of readdirSync(_0x44e590,{'withFileTypes':!![]})){if(!_0x5394e5['isDirectory']())continue;const _0x1778c8=_0x5394e5['name'];if(_0x2acfe6&&!_0x2acfe6[_0x36c14c(0x178)](_0x1778c8))continue;if(_0x1a9160[_0x36c14c(0x178)](_0x1778c8))continue;const _0x109010=resolve(_0x44e590,_0x1778c8),_0xec22ab=readMetadataIfPresent(resolve(_0x109010,METADATA_FILE));if(_0xec22ab?.[_0x36c14c(0x17b)]!==_0x88c4b5[_0x36c14c(0x17b)]||_0xec22ab[_0x36c14c(0x18c)]!==_0x26af46||_0xec22ab['skillCode']!==_0x1778c8){_0x175fd5['push']({'path':_0x109010,'action':_0x36c14c(0x18d),'reason':_0x36c14c(0x1ae)});continue;}if(isLinkedFromAnyRoot(_0x109010,_0x88c4b5[_0x36c14c(0x175)]??[])){_0x175fd5[_0x36c14c(0x179)]({'path':_0x109010,'action':'skipped','reason':_0x36c14c(0x177)});continue;}removeSync(_0x109010),_0x175fd5[_0x36c14c(0x179)]({'path':_0x109010,'action':_0x36c14c(0x181)});}}return _0x175fd5;}export function linkGlobalRuntimeSkills(_0x342c54,_0x592f78={}){const _0x3bbd23=a154_0x3c9c4a,_0x2b170c=resolveSkillSyncPaths(_0x592f78),_0x9445ee=[];for(const _0x382431 of _0x342c54){if(_0x382431[_0x3bbd23(0x18c)]!==_0x3bbd23(0x180))throw CliErrors[_0x3bbd23(0x189)](_0x3bbd23(0x196)+_0x382431[_0x3bbd23(0x18c)]);const _0x52aebd=requireSkillCode(_0x382431['skill']),_0x4d4865=copyManagedSkillDirectory(_0x382431[_0x3bbd23(0x183)],resolve(_0x2b170c[_0x3bbd23(0x1a5)],_0x52aebd));_0x9445ee[_0x3bbd23(0x179)]({..._0x4d4865,'contentHash':_0x382431[_0x3bbd23(0x1a7)]});}return _0x9445ee;}function ensureManagedSymlink(_0x21616f,_0x1b4d1b,_0x510a68,_0x29e874){const _0x3f936b=a154_0x3c9c4a;mkdirSync(dirname(_0x21616f),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x21616f)||isDanglingSymlink(_0x21616f)){const _0x39e326=lstatSync(_0x21616f);if(!_0x39e326[_0x3f936b(0x1a0)]())throw CliErrors[_0x3f936b(0x189)](_0x3f936b(0x191)+_0x21616f);const _0x15bf7b=resolveSymlinkTarget(_0x21616f);if(!isPathInside(realOrResolved(_0x15bf7b),realOrResolved(_0x510a68[_0x3f936b(0x1a2)])))throw CliErrors[_0x3f936b(0x189)](_0x3f936b(0x190)+_0x21616f);if(realOrResolved(_0x15bf7b)===realOrResolved(_0x1b4d1b))return{'path':_0x21616f,'target':_0x1b4d1b,'action':'unchanged'};const _0x330661=readMetadataIfPresent(resolve(_0x15bf7b,METADATA_FILE));if(_0x510a68[_0x3f936b(0x18c)]===_0x3f936b(0x17e)&&(_0x330661?.[_0x3f936b(0x17b)]!==_0x510a68[_0x3f936b(0x17b)]||_0x330661[_0x3f936b(0x1ac)]!==_0x29e874))throw CliErrors[_0x3f936b(0x189)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x21616f);return unlinkSync(_0x21616f),symlinkSync(_0x1b4d1b,_0x21616f,'dir'),{'path':_0x21616f,'target':_0x1b4d1b,'action':_0x3f936b(0x1aa)};}return symlinkSync(_0x1b4d1b,_0x21616f,'dir'),{'path':_0x21616f,'target':_0x1b4d1b,'action':'created'};}function managedTargetSkillLinkPaths(_0x46acd2,_0x2ec944){const _0x5482d0=a154_0x3c9c4a;if(!existsSync(_0x46acd2))return[];const _0x508eb4=_0x2ec944['appCode']+'--';return readdirSync(_0x46acd2,{'withFileTypes':!![]})[_0x5482d0(0x18f)](_0x5aac9c=>_0x2ec944[_0x5482d0(0x18c)]===_0x5482d0(0x17e)||_0x5aac9c[_0x5482d0(0x17d)][_0x5482d0(0x186)](_0x508eb4))['map'](_0x3355a4=>resolve(_0x46acd2,_0x3355a4[_0x5482d0(0x17d)]));}function a154_0x4ef8(_0x2c28c1,_0x497752){_0x2c28c1=_0x2c28c1-0x175;const _0xa21add=a154_0xa21a();let _0x4ef8c7=_0xa21add[_0x2c28c1];return _0x4ef8c7;}function removeManagedSkillLink(_0x54aa56,_0x50ef32,_0x1e5d52){const _0x36242e=a154_0x3c9c4a,_0x2a5eb5=lstatIfPresent(_0x54aa56);if(!_0x2a5eb5?.[_0x36242e(0x1a0)]())return{'path':_0x54aa56,'action':'skipped','reason':_0x36242e(0x19f)};const _0x42334a=resolveSymlinkTarget(_0x54aa56);if(!isPathInside(realOrResolved(_0x42334a),realOrResolved(_0x50ef32[_0x36242e(0x1a2)])))return{'path':_0x54aa56,'action':'skipped','reason':'external-symlink'};const _0x2f038d=readMetadataIfPresent(resolve(_0x42334a,METADATA_FILE));if(_0x50ef32[_0x36242e(0x18c)]==='project'&&(_0x2f038d?.[_0x36242e(0x17b)]!==_0x50ef32[_0x36242e(0x17b)]||_0x2f038d[_0x36242e(0x1ac)]!==_0x1e5d52))return{'path':_0x54aa56,'action':_0x36242e(0x18d),'reason':_0x36242e(0x1ae)};return unlinkSync(_0x54aa56),{'path':_0x54aa56,'action':_0x36242e(0x181)};}function isLinkedFromAnyRoot(_0x5bebb8,_0x3c18cc){const _0x1019a1=a154_0x3c9c4a,_0x51413d=realOrResolved(_0x5bebb8);for(const _0x578e37 of _0x3c18cc){if(!existsSync(_0x578e37))continue;for(const _0x38081f of readdirSync(_0x578e37,{'withFileTypes':!![]})){if(!_0x38081f[_0x1019a1(0x1a0)]())continue;const _0x31e01a=resolve(_0x578e37,_0x38081f['name']);if(realOrResolved(resolveSymlinkTarget(_0x31e01a))===_0x51413d)return!![];}}return![];}function runtimeSkillLinkName(_0x5b32af,_0x2c2fea){const _0x47376d=a154_0x3c9c4a,_0x3f6fc3=safePathSegment(_0x2c2fea,_0x47376d(0x1ac));if(_0x5b32af['scope']==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x47376d(0x178)](_0x3f6fc3))throw CliErrors[_0x47376d(0x189)](_0x47376d(0x197)+_0x3f6fc3);return _0x5b32af[_0x47376d(0x18c)]===_0x47376d(0x17e)?_0x3f6fc3:_0x5b32af['appCode']+'--'+_0x3f6fc3;}function runtimeSkillCodeFromLink(_0x26709b,_0x559230){const _0x1e721b=a154_0x3c9c4a,_0x51d5d5=basename(_0x559230);return _0x26709b['scope']===_0x1e721b(0x17e)?_0x51d5d5:_0x51d5d5['slice']((_0x26709b[_0x1e721b(0x17b)]+'--')[_0x1e721b(0x19e)]);}export function copyManagedSkillDirectory(_0x260c9d,_0x4ed28f){const _0x363f23=a154_0x3c9c4a,_0x2d6ca2=resolve(_0x4ed28f,METADATA_FILE),_0xd947e=existsSync(_0x4ed28f);if(_0xd947e){const _0x55f133=lstatSync(_0x4ed28f);if(_0x55f133[_0x363f23(0x1a0)]())throw CliErrors[_0x363f23(0x189)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x4ed28f);if(!_0x55f133[_0x363f23(0x193)]())throw CliErrors[_0x363f23(0x189)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x4ed28f);const _0x1d0fd2=readMetadataIfPresent(_0x2d6ca2);if(_0x1d0fd2?.[_0x363f23(0x18c)]!=='builtin')throw CliErrors[_0x363f23(0x189)](_0x363f23(0x198)+_0x4ed28f);}ensureDirSync(dirname(_0x4ed28f));const _0x171336=_0xd947e?readMetadataIfPresent(_0x2d6ca2)?.[_0x363f23(0x1a7)]:undefined,_0x2a6b89=readMetadataIfPresent(resolve(_0x260c9d,METADATA_FILE))?.[_0x363f23(0x1a7)];return _0xd947e&&removeSync(_0x4ed28f),copySkillDirectory(_0x260c9d,_0x4ed28f),{'path':_0x4ed28f,'target':_0x260c9d,'action':!_0xd947e?'created':_0x171336===_0x2a6b89?'unchanged':_0x363f23(0x1aa)};}function copySkillDirectory(_0x5c012b,_0x1fcef1){copySync(_0x5c012b,_0x1fcef1,{'dereference':![],'overwrite':!![],'filter'(_0x48be37){const _0x1a07cf=a154_0x4ef8;if(lstatSync(_0x48be37)['isSymbolicLink']())throw CliErrors[_0x1a07cf(0x189)](_0x1a07cf(0x19a)+_0x48be37);return!![];}});}function a154_0xa21a(){const _0x2af9c1=['trim','managedRoot','23639GnsVHY','6020082hNLKHi','agentsSkillsDir','4OGZGIT','contentHash','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','get','updated','scopes','skillCode','1200rwzFGP','metadata-mismatch','protectedLinkRoots','env','linked-from-protected-root','has','push','company','appCode','1809367ZjaANb','name','project','set','builtin','removed','personal','dir','24AnHmHq','pruneSkillCodes','startsWith','skillRoots','703331ZZAvHo','validation','52461WEbWsp','6870CzrrHP','scope','skipped','skill','filter','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','25677lXKYlS','isDirectory','secret-retriever','5829730eGVMSl','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','map','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','values','activeSkillCodes','accessKey','length','not-managed-symlink','isSymbolicLink'];a154_0xa21a=function(){return _0x2af9c1;};return a154_0xa21a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x528c2e,_0x1f4bc6){const _0x194b41=a155_0x355b,_0xf6637a=_0x528c2e();while(!![]){try{const _0x5c3d6a=-parseInt(_0x194b41(0x93))/0x1+-parseInt(_0x194b41(0x6f))/0x2*(parseInt(_0x194b41(0x83))/0x3)+parseInt(_0x194b41(0x6b))/0x4*(parseInt(_0x194b41(0x6c))/0x5)+-parseInt(_0x194b41(0x7b))/0x6+parseInt(_0x194b41(0x79))/0x7+-parseInt(_0x194b41(0x85))/0x8+-parseInt(_0x194b41(0x7d))/0x9*(-parseInt(_0x194b41(0x73))/0xa);if(_0x5c3d6a===_0x1f4bc6)break;else _0xf6637a['push'](_0xf6637a['shift']());}catch(_0x22be11){_0xf6637a['push'](_0xf6637a['shift']());}}}(a155_0x1b71,0xd71a4));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0xd707f7,_0x5aa5ee,_0x5dd666={}){const _0x3b93a2=a155_0x355b,_0x322e3f=safePathSegment(_0xd707f7[_0x3b93a2(0x87)],'appCode');if(_0x5aa5ee['appCode']!==_0x322e3f)throw CliErrors['validation'](_0x3b93a2(0x7f)+_0x5aa5ee[_0x3b93a2(0x87)]+'\x20!=\x20'+_0x322e3f);const _0x1cdfa4=normalizeRuntimeSkillScopes(_0xd707f7[_0x3b93a2(0x8d)]),_0x1c9c97=new Set(_0x1cdfa4),_0x584cfe=_0xd707f7[_0x3b93a2(0x90)]?.[_0x3b93a2(0x77)](),_0x32e603=new Map(),_0x825ab9=resolve(getRuntimeSkillCacheRoot(_0xd707f7[_0x3b93a2(0x78)],_0xd707f7[_0x3b93a2(0x7c)],_0x5dd666),_0x322e3f);for(const _0x59bdb3 of _0x1cdfa4){for(const _0x2e84a8 of localSkillEntryDirs(resolve(_0x825ab9,_0x59bdb3))){collectLocalRuntimeSkill(_0x32e603,_0x2e84a8,{'appCode':_0x322e3f,'scopes':_0x1c9c97,'code':_0x584cfe,'source':'cache'});}}for(const _0x3f5f88 of _0x5aa5ee[_0x3b93a2(0x89)]){for(const _0x17f916 of localSkillLinkCandidates(_0x3f5f88,_0x5aa5ee,_0x1c9c97)){collectLocalRuntimeSkill(_0x32e603,_0x17f916,{'appCode':_0x322e3f,'scopes':_0x1c9c97,'code':_0x584cfe,'source':'link','linkedPath':_0x17f916});}}return Array[_0x3b93a2(0x92)](_0x32e603[_0x3b93a2(0x8c)]())[_0x3b93a2(0x70)](compareLocalRuntimeSkills);}function a155_0x1b71(){const _0x42c9b3=['local','code','source','from','167996pzJsFt','tags','localeCompare','skillCode','2732EXBiMv','8405xmfrXi','set','project','1464DrqpTn','sort','name','cache','564800qHuayC','isSymbolicLink','linkedPaths','filter','trim','env','3476557VNFdOm','cacheDir','654066OgbCdb','accessKey','144kogafP','get','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','has','linkedPath','isDirectory','5601jfQImV','startsWith','189944fvhbAT','map','appCode','dir','skillRoots','builtin','isArray','values','scopes','scope'];a155_0x1b71=function(){return _0x42c9b3;};return a155_0x1b71();}function localSkillEntryDirs(_0x54c566){const _0x529b37=a155_0x355b;if(!existsSync(_0x54c566))return[];return readdirSync(_0x54c566,{'withFileTypes':!![]})[_0x529b37(0x76)](_0x5e5350=>_0x5e5350[_0x529b37(0x82)]()||_0x5e5350[_0x529b37(0x74)]())[_0x529b37(0x86)](_0x38370e=>resolve(_0x54c566,_0x38370e[_0x529b37(0x71)]));}function localSkillLinkCandidates(_0x5ef057,_0x5de4bb,_0x5b3f70){const _0x2f53ae=a155_0x355b;if(!existsSync(_0x5ef057))return[];const _0x2442cb=_0x5de4bb[_0x2f53ae(0x87)]+'--';return readdirSync(_0x5ef057,{'withFileTypes':!![]})['filter'](_0x5c6cb5=>_0x5c6cb5['isDirectory']()||_0x5c6cb5[_0x2f53ae(0x74)]())['filter'](_0x2a8bf8=>_0x5de4bb['scope']===_0x2f53ae(0x6e)||_0x2a8bf8[_0x2f53ae(0x71)][_0x2f53ae(0x84)](_0x2442cb)||_0x5b3f70[_0x2f53ae(0x80)](_0x2f53ae(0x8a)))[_0x2f53ae(0x86)](_0x27c641=>resolve(_0x5ef057,_0x27c641[_0x2f53ae(0x71)]));}function collectLocalRuntimeSkill(_0x35225f,_0xa58dd6,_0x120b98){const _0x210c16=a155_0x355b,_0x5e7cab=resolve(_0xa58dd6,METADATA_FILE),_0xeaf1be=readMetadataIfPresent(_0x5e7cab);if(!_0xeaf1be)return;if(_0xeaf1be['appCode']!==_0x120b98[_0x210c16(0x87)])return;if(!isRuntimeSkillScope(_0xeaf1be[_0x210c16(0x8e)])||!_0x120b98['scopes']['has'](_0xeaf1be[_0x210c16(0x8e)]))return;const _0x4ad298=_0xeaf1be[_0x210c16(0x6a)]?.[_0x210c16(0x77)]();if(!_0x4ad298)return;if(_0x120b98[_0x210c16(0x90)]&&_0x4ad298!==_0x120b98[_0x210c16(0x90)])return;const _0x38a34a=_0xeaf1be[_0x210c16(0x8e)]+':'+_0x4ad298,_0x482a87=_0x120b98['linkedPath']?[_0x120b98[_0x210c16(0x81)]]:[],_0xfc0f2=_0x35225f[_0x210c16(0x7e)](_0x38a34a);if(_0xfc0f2){_0x120b98[_0x210c16(0x91)]==='cache'&&(_0xfc0f2[_0x210c16(0x88)]=_0xa58dd6,_0xfc0f2[_0x210c16(0x7a)]=_0xa58dd6,_0xfc0f2['skillMdPath']=resolve(_0xa58dd6,SKILL_FILE),_0xfc0f2['metadataPath']=_0x5e7cab);for(const _0x543707 of _0x482a87){!_0xfc0f2[_0x210c16(0x75)]['includes'](_0x543707)&&_0xfc0f2[_0x210c16(0x75)]['push'](_0x543707);}_0xfc0f2[_0x210c16(0x75)]['sort']();return;}_0x35225f[_0x210c16(0x6d)](_0x38a34a,{..._0xeaf1be,'tags':Array[_0x210c16(0x8b)](_0xeaf1be['tags'])?_0xeaf1be[_0x210c16(0x94)]:[],'scope':_0xeaf1be[_0x210c16(0x8e)],'source':_0x210c16(0x8f),'dir':_0xa58dd6,'cacheDir':_0x120b98[_0x210c16(0x91)]===_0x210c16(0x72)?_0xa58dd6:undefined,'skillMdPath':resolve(_0xa58dd6,SKILL_FILE),'metadataPath':_0x5e7cab,'linkedPaths':_0x482a87});}function a155_0x355b(_0x18feaa,_0x1e0d60){_0x18feaa=_0x18feaa-0x69;const _0x1b71d0=a155_0x1b71();let _0x355b25=_0x1b71d0[_0x18feaa];return _0x355b25;}function compareLocalRuntimeSkills(_0x169079,_0x27e13c){const _0x42696d=a155_0x355b,_0x3ef4e9={'personal':0x0,'company':0x1,'builtin':0x2};return _0x3ef4e9[_0x169079['scope']]-_0x3ef4e9[_0x27e13c[_0x42696d(0x8e)]]||_0x169079[_0x42696d(0x6a)][_0x42696d(0x69)](_0x27e13c[_0x42696d(0x6a)])||_0x169079[_0x42696d(0x88)][_0x42696d(0x69)](_0x27e13c['dir']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4673d9,_0x243a11){const _0x3d3c0e=a156_0x3a38,_0x5f336e=_0x4673d9();while(!![]){try{const _0x4f61ba=-parseInt(_0x3d3c0e(0x15c))/0x1+parseInt(_0x3d3c0e(0x154))/0x2+-parseInt(_0x3d3c0e(0x169))/0x3*(parseInt(_0x3d3c0e(0x146))/0x4)+-parseInt(_0x3d3c0e(0x148))/0x5*(-parseInt(_0x3d3c0e(0x16e))/0x6)+parseInt(_0x3d3c0e(0x155))/0x7+parseInt(_0x3d3c0e(0x150))/0x8*(parseInt(_0x3d3c0e(0x15f))/0x9)+-parseInt(_0x3d3c0e(0x15b))/0xa;if(_0x4f61ba===_0x243a11)break;else _0x5f336e['push'](_0x5f336e['shift']());}catch(_0x479ac3){_0x5f336e['push'](_0x5f336e['shift']());}}}(a156_0x47af,0xedbea));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x1b7090){const _0xbdd0c8=a156_0x3a38;return _0x1b7090[_0xbdd0c8(0x168)]??Buffer[_0xbdd0c8(0x14b)](_0x1b7090[_0xbdd0c8(0x151)]??'','utf8');}export function fileText(_0x5e4d44){const _0x52d437=a156_0x3a38;return fileContent(_0x5e4d44)[_0x52d437(0x163)](_0x52d437(0x16b));}export function normalizeLocalFiles(_0x4a01b0){const _0x55ca15=a156_0x3a38;if(!Array['isArray'](_0x4a01b0)||_0x4a01b0[_0x55ca15(0x14e)]===0x0)return[];const _0x45859a=new Map();for(const _0x51cb8c of _0x4a01b0){if(!_0x51cb8c||typeof _0x51cb8c!==_0x55ca15(0x16c)||typeof _0x51cb8c[_0x55ca15(0x16a)]!=='string')throw CliErrors['validation'](_0x55ca15(0x14d));const _0x335cb4=normalizeSkillRelativePath(_0x51cb8c[_0x55ca15(0x16a)]);if(_0x45859a['has'](_0x335cb4))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x335cb4);if(_0x51cb8c[_0x55ca15(0x168)]!==undefined&&!Buffer[_0x55ca15(0x15d)](_0x51cb8c['bytes']))throw CliErrors['validation']('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x335cb4);if(_0x51cb8c[_0x55ca15(0x168)]===undefined&&typeof _0x51cb8c[_0x55ca15(0x151)]!==_0x55ca15(0x167))throw CliErrors[_0x55ca15(0x16d)](_0x55ca15(0x156)+_0x335cb4);const _0x4976e0=fileContent(_0x51cb8c);_0x45859a[_0x55ca15(0x14a)](_0x335cb4,{'path':_0x335cb4,'bytes':_0x4976e0});}return Array[_0x55ca15(0x14b)](_0x45859a[_0x55ca15(0x143)]())[_0x55ca15(0x147)](compareSkillFiles);}export function normalizeManifestFiles(_0x4841ad){const _0x5b8abc=a156_0x3a38;if(!Array['isArray'](_0x4841ad)||_0x4841ad[_0x5b8abc(0x14e)]===0x0)return[];const _0x278746=new Map();for(const _0x3397f8 of _0x4841ad){if(!_0x3397f8||typeof _0x3397f8!==_0x5b8abc(0x16c)||typeof _0x3397f8[_0x5b8abc(0x16a)]!=='string')throw CliErrors[_0x5b8abc(0x16d)](_0x5b8abc(0x14d));const _0x414395=normalizeSkillRelativePath(_0x3397f8[_0x5b8abc(0x16a)]);if(_0x278746[_0x5b8abc(0x152)](_0x414395))throw CliErrors[_0x5b8abc(0x16d)](_0x5b8abc(0x149)+_0x414395);if(!isSha256Hex(_0x3397f8[_0x5b8abc(0x153)]))throw CliErrors['validation'](_0x5b8abc(0x15a)+_0x414395);if(!Number[_0x5b8abc(0x145)](_0x3397f8[_0x5b8abc(0x159)])||_0x3397f8[_0x5b8abc(0x159)]<0x0)throw CliErrors['validation'](_0x5b8abc(0x161)+_0x414395);_0x278746[_0x5b8abc(0x14a)](_0x414395,{'path':_0x414395,'sha256':_0x3397f8['sha256']['toLowerCase'](),'size':_0x3397f8['size']});}return Array[_0x5b8abc(0x14b)](_0x278746['values']())[_0x5b8abc(0x147)](compareSkillFiles);}export function scanSkillDirectory(_0x51564e,_0x268ead={}){const _0x36bd41=realpathSync(_0x51564e),_0x2cf27e=canonicalExcludedFilePaths(_0x268ead['excludedFilePaths']),_0xdf5cdb=[];function _0x2e1046(_0x56b7e0){const _0x22f921=a156_0x3a38,_0x3da09e=readdirSync(_0x56b7e0,{'withFileTypes':!![]})['sort']((_0x30ccb5,_0x49f03c)=>_0x30ccb5[_0x22f921(0x166)]['localeCompare'](_0x49f03c[_0x22f921(0x166)]));for(const _0x47cec1 of _0x3da09e){if(_0x47cec1[_0x22f921(0x162)]()&&IGNORED_DIR_NAMES[_0x22f921(0x152)](_0x47cec1['name']))continue;if(IGNORED_FILE_NAMES[_0x22f921(0x152)](_0x47cec1[_0x22f921(0x166)]))continue;const _0x44afd1=resolve(_0x56b7e0,_0x47cec1['name']);if(isExcludedFilePath(_0x44afd1,_0x2cf27e))continue;if(_0x47cec1[_0x22f921(0x144)]())throw CliErrors[_0x22f921(0x16d)](_0x22f921(0x158)+_0x44afd1);const _0x21e737=toPosixPath(relative(_0x36bd41,_0x44afd1));if(_0x47cec1[_0x22f921(0x162)]()){_0x2e1046(_0x44afd1);continue;}if(!_0x47cec1[_0x22f921(0x160)]())continue;validateSkillRelativePath(_0x21e737);const _0x2eb096=readFileSync(_0x44afd1);_0xdf5cdb['push']({'path':_0x21e737,'bytes':_0x2eb096});}}return _0x2e1046(_0x36bd41),normalizeLocalFiles(_0xdf5cdb);}function canonicalExcludedFilePaths(_0x471393){const _0x4b37ff=a156_0x3a38,_0x5ecc09=new Set();for(const _0x376b89 of _0x471393??[]){const _0x44b567=resolve(_0x376b89);_0x5ecc09[_0x4b37ff(0x14c)](_0x44b567);try{_0x5ecc09[_0x4b37ff(0x14c)](realpathSync(_0x44b567));}catch{}}return _0x5ecc09;}function isExcludedFilePath(_0x5e9ece,_0x555d9d){const _0xa36ea8=a156_0x3a38;if(_0x555d9d[_0xa36ea8(0x152)](_0x5e9ece))return!![];if(_0x555d9d['size']===0x0)return![];try{return _0x555d9d[_0xa36ea8(0x152)](realpathSync(_0x5e9ece));}catch{return![];}}function a156_0x3a38(_0xbd0549,_0x175fa2){_0xbd0549=_0xbd0549-0x143;const _0x47af9f=a156_0x47af();let _0x3a3805=_0x47af9f[_0xbd0549];return _0x3a3805;}export function compareSkillFiles(_0x49cee4,_0x5c34b9){const _0x19ea20=a156_0x3a38;if(_0x49cee4[_0x19ea20(0x16a)]===SKILL_FILE)return _0x5c34b9[_0x19ea20(0x16a)]===SKILL_FILE?0x0:-0x1;if(_0x5c34b9['path']===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x19ea20(0x14b)](_0x49cee4[_0x19ea20(0x16a)],'utf8'),Buffer[_0x19ea20(0x14b)](_0x5c34b9[_0x19ea20(0x16a)],_0x19ea20(0x16b)));}export function normalizeSkillRelativePath(_0x5268ef){const _0x1f6eaa=a156_0x3a38,_0x3b26f7=toPosixPath(_0x5268ef[_0x1f6eaa(0x16f)]());return validateSkillRelativePath(_0x3b26f7),_0x3b26f7;}function a156_0x47af(){const _0x3f1824=['884730FPHGjB','isBuffer','replace','45ubYIfn','isFile','Skill\x20file\x20size\x20is\x20invalid:\x20','isDirectory','toString','includes','split','name','string','bytes','787002OHOila','path','utf8','object','validation','18LVrXrl','trim','values','isSymbolicLink','isSafeInteger','28CmlJup','sort','2977885RtQqQg','Duplicate\x20Skill\x20file\x20path:\x20','set','from','add','Skill\x20file\x20path\x20must\x20be\x20text.','length','Unsafe\x20Skill\x20file\x20path:\x20','526616lddzIT','content','has','sha256','2328544cwjaJH','11183473BLYlaH','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','test','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','size','Skill\x20file\x20sha256\x20is\x20invalid:\x20','11829070vCQttB'];a156_0x47af=function(){return _0x3f1824;};return a156_0x47af();}export function validateSkillRelativePath(_0x584f1b){const _0x512351=a156_0x3a38;if(!_0x584f1b||_0x584f1b['startsWith']('/')||_0x584f1b[_0x512351(0x164)]('//'))throw CliErrors[_0x512351(0x16d)](_0x512351(0x14f)+_0x584f1b);for(const _0x3ce79a of _0x584f1b[_0x512351(0x165)]('/')){if(!_0x3ce79a||_0x3ce79a==='.'||_0x3ce79a==='..')throw CliErrors[_0x512351(0x16d)](_0x512351(0x14f)+_0x584f1b);}}export function toPosixPath(_0x313df8){const _0x3a1204=a156_0x3a38;return _0x313df8[_0x3a1204(0x15e)](/\\/g,'/');}export function isSha256Hex(_0x34f6ad){const _0x458dff=a156_0x3a38;return typeof _0x34f6ad===_0x458dff(0x167)&&/^[a-fA-F0-9]{64}$/[_0x458dff(0x157)](_0x34f6ad);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1790f2,_0x22b1e1){const _0x56fd2c=a157_0x55d5,_0x36c60a=_0x1790f2();while(!![]){try{const _0x1e26ae=parseInt(_0x56fd2c(0x1e7))/0x1*(parseInt(_0x56fd2c(0x1f1))/0x2)+-parseInt(_0x56fd2c(0x208))/0x3*(parseInt(_0x56fd2c(0x1d9))/0x4)+parseInt(_0x56fd2c(0x1da))/0x5*(parseInt(_0x56fd2c(0x20f))/0x6)+-parseInt(_0x56fd2c(0x1e5))/0x7+parseInt(_0x56fd2c(0x1ec))/0x8+-parseInt(_0x56fd2c(0x1fe))/0x9*(-parseInt(_0x56fd2c(0x1ed))/0xa)+parseInt(_0x56fd2c(0x205))/0xb*(-parseInt(_0x56fd2c(0x1ee))/0xc);if(_0x1e26ae===_0x22b1e1)break;else _0x36c60a['push'](_0x36c60a['shift']());}catch(_0x52f95d){_0x36c60a['push'](_0x36c60a['shift']());}}}(a157_0x2298,0x841ba));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a157_0x55d5(_0x4b0f8e,_0x5e5e9f){_0x4b0f8e=_0x4b0f8e-0x1d7;const _0x229818=a157_0x2298();let _0x55d5bc=_0x229818[_0x4b0f8e];return _0x55d5bc;}function a157_0x2298(){const _0x5ae052=['length','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','4028136sfTLiu','470JpjpJt','8787360LmfSbr','\x0a---\x0a\x0a','join','12490RWYGdf','contents','name:\x20','path','toString','version','test','trimEnd','has','schemaVersion','displayName','---','keys','186696NxZTpw','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','status','skillCode','stringify','packageBytes','set','11JkqYzl','fileHashes','trim','289269uzkfaF','validation','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','find','utf8','entries','match','1938LvRgat','Managed\x20file\x20was\x20removed\x20locally:\x20','accessKey','appCode','replace','.\x20Changed\x20file:\x20','scope','force','8MAsToU','3670bClMIF','paths','isFile','description:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','env','contentHash','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','filter','map','example','2969309TkEkhN','pulledAt','28YrXRZF','description'];a157_0x2298=function(){return _0x5ae052;};return a157_0x2298();}import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x2cfb8b,_0x1da3b2,_0xbb994c){const _0x647638=a157_0x55d5,_0x153293=requireSkillCode(_0x2cfb8b),_0x11e69f=requirePackageBytes(_0x153293,_0xbb994c[_0x647638(0x203)]),_0x2d37f8=extractDownloadedPackage(_0x11e69f),_0x4b6c75=_0x2d37f8[_0x647638(0x20b)](_0x3175ff=>_0x3175ff['path']===SKILL_FILE);if(!_0x4b6c75)throw CliErrors[_0x647638(0x209)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x153293);const _0x46f45d=withMaterializedSkillFrontmatter(_0x2d37f8,_0x2cfb8b,_0x153293),_0x457596=_0x46f45d['find'](_0x5abe86=>_0x5abe86['path']===SKILL_FILE),_0x27aa33=fileText(_0x457596),_0x13232e=getRuntimeSkillDir(_0xbb994c['env'],_0xbb994c[_0x647638(0x211)],_0xbb994c[_0x647638(0x212)],_0x1da3b2,_0x153293,_0xbb994c[_0x647638(0x1db)]),_0x20b193=resolve(_0x13232e,SKILL_FILE),_0x5d5ef6=resolve(_0x13232e,METADATA_FILE),_0x19683b=contentHash(_0x27aa33),_0xf2c14e=readMetadataIfPresent(_0x5d5ef6)?.[_0x647638(0x206)];ensurePulledFilesCanBeOverwritten(_0x13232e,_0x5d5ef6,_0x46f45d,_0xbb994c[_0x647638(0x1d8)]===!![]),mkdirSync(_0x13232e,{'recursive':!![],'mode':0x1c0});const _0x13749d=existsSync(_0x20b193)?readFileSync(_0x20b193,_0x647638(0x20c)):undefined;return materializeFiles(_0x13232e,_0x46f45d),removeStaleManagedFiles(_0x13232e,_0xf2c14e,_0x46f45d),writeJsonAtomic(_0x5d5ef6,buildMetadata(_0x2cfb8b,_0x1da3b2,_0xbb994c[_0x647638(0x212)],_0x19683b,_0xbb994c[_0x647638(0x1e6)],_0x46f45d,_0x11e69f)),{'skill':_0x2cfb8b,'scope':_0x1da3b2,'dir':_0x13232e,'skillMdPath':_0x20b193,'metadataPath':_0x5d5ef6,'contentHash':_0x19683b,'changed':_0x13749d!==_0x27aa33};}export function reuseMaterializedRuntimeSkill(_0x26e7ab,_0x289097,_0x3b8479){const _0x442b58=a157_0x55d5,_0xb30fb1=_0x26e7ab['version']?.[_0x442b58(0x207)]();if(!_0xb30fb1)return undefined;const _0x3784cb=requireSkillCode(_0x26e7ab),_0x2a4c70=getRuntimeSkillDir(_0x3b8479[_0x442b58(0x1df)],_0x3b8479[_0x442b58(0x211)],_0x3b8479[_0x442b58(0x212)],_0x289097,_0x3784cb,_0x3b8479[_0x442b58(0x1db)]),_0x2cd646=resolve(_0x2a4c70,SKILL_FILE),_0x438c9b=resolve(_0x2a4c70,METADATA_FILE),_0x3eed39=readMetadataIfPresent(_0x438c9b);if(!_0x3eed39||_0x3eed39[_0x442b58(0x1fa)]!==0x2||_0x3eed39[_0x442b58(0x212)]!==_0x3b8479['appCode']||_0x3eed39[_0x442b58(0x1d7)]!==_0x289097||_0x3eed39[_0x442b58(0x201)]!==_0x3784cb||_0x3eed39[_0x442b58(0x1f6)]!==_0xb30fb1||_0x3eed39['id']!==_0x26e7ab['id']||_0x3eed39['skillName']!==_0x26e7ab['skillName']||_0x3eed39[_0x442b58(0x1e8)]!==_0x26e7ab[_0x442b58(0x1e8)]||_0x3eed39['example']!==_0x26e7ab[_0x442b58(0x1e4)]||_0x3eed39[_0x442b58(0x200)]!==_0x26e7ab[_0x442b58(0x200)]||!_0x3eed39['contentHash']||!_0x3eed39[_0x442b58(0x206)]||!Object['hasOwn'](_0x3eed39[_0x442b58(0x206)],SKILL_FILE))return undefined;for(const [_0x3c6bf5,_0x228a16]of Object['entries'](_0x3eed39['fileHashes'])){if(!/^[a-f0-9]{64}$/['test'](_0x228a16))return undefined;const _0x5b85b5=resolveManagedFilePath(_0x2a4c70,_0x3c6bf5);if(!existsSync(_0x5b85b5)||!lstatSync(_0x5b85b5)[_0x442b58(0x1dc)]())return undefined;if(bufferSha256(readFileSync(_0x5b85b5))!==_0x228a16)return undefined;}return{'skill':_0x26e7ab,'scope':_0x289097,'dir':_0x2a4c70,'skillMdPath':_0x2cd646,'metadataPath':_0x438c9b,'contentHash':_0x3eed39[_0x442b58(0x1e0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x3d483e,_0x85a306,_0x323c44){const _0x160a93=a157_0x55d5,_0x1ee79f=skillDisplayName(_0x85a306,_0x323c44),_0x130535=_0x85a306['description']?.[_0x160a93(0x207)]()||_0x1ee79f||_0x323c44;return normalizeLocalFiles(_0x3d483e)[_0x160a93(0x1e3)](_0x2169f9=>{const _0x31ecf5=_0x160a93,_0x5b925d=fileText(_0x2169f9);if(_0x2169f9['path']!==SKILL_FILE)return _0x2169f9;if(hasYamlFrontmatter(_0x5b925d))return{'path':_0x2169f9[_0x31ecf5(0x1f4)],'content':withSyncedDisplayName(_0x5b925d,_0x1ee79f)};return{'path':_0x2169f9[_0x31ecf5(0x1f4)],'content':prependSkillFrontmatter(_0x5b925d,{'name':_0x323c44,'displayName':_0x1ee79f,'description':_0x130535})};});}function hasYamlFrontmatter(_0x543674){const _0x438bdf=a157_0x55d5;return/^\uFEFF?---\s*\r?\n/[_0x438bdf(0x1f7)](_0x543674);}function prependSkillFrontmatter(_0x4def24,_0x3acf44){const _0x382fd7=a157_0x55d5,_0x1d4dc7=_0x4def24[_0x382fd7(0x213)](/^\uFEFF/,'');return[_0x382fd7(0x1fc),_0x382fd7(0x1f3)+yamlString(_0x3acf44['name']),_0x3acf44[_0x382fd7(0x1fb)]?'displayName:\x20'+yamlString(_0x3acf44[_0x382fd7(0x1fb)]):undefined,_0x382fd7(0x1dd)+yamlString(_0x3acf44[_0x382fd7(0x1e8)]),'---','',_0x1d4dc7][_0x382fd7(0x1e2)](_0x36cf35=>_0x36cf35!==undefined)[_0x382fd7(0x1f0)]('\x0a');}function yamlString(_0x219da1){const _0x33af1d=a157_0x55d5;return JSON[_0x33af1d(0x202)](_0x219da1[_0x33af1d(0x213)](/\r/g,'')[_0x33af1d(0x207)]());}function skillDisplayName(_0x23d641,_0x3074c1){const _0x4c9f5b=a157_0x55d5,_0x40c37e=_0x23d641['skillName']?.[_0x4c9f5b(0x207)]();return _0x40c37e||_0x3074c1;}function withSyncedDisplayName(_0x308a84,_0x43574f){const _0x4dd9ec=a157_0x55d5,_0x138532=_0x308a84[_0x4dd9ec(0x20e)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x138532)return _0x308a84;const _0x31b4a5=_0x138532[0x1]??'',_0x532d3f=_0x138532[0x2]??'',_0x3a4a25=parseDocument(_0x532d3f);if(_0x3a4a25['errors'][_0x4dd9ec(0x1e9)]>0x0||!isMap(_0x3a4a25['contents']))return _0x308a84;if(_0x43574f)_0x3a4a25[_0x4dd9ec(0x204)](_0x4dd9ec(0x1fb),_0x43574f);else{if(_0x3a4a25[_0x4dd9ec(0x1f9)](_0x4dd9ec(0x1fb)))_0x3a4a25['delete']('displayName');else return _0x308a84;}forceBlockCollections(_0x3a4a25[_0x4dd9ec(0x1f2)]);const _0x1567c5=_0x3a4a25[_0x4dd9ec(0x1f5)]({'lineWidth':0x0})[_0x4dd9ec(0x1f8)](),_0x2e04f5=_0x308a84['slice'](_0x138532[0x0]['length'])['replace'](/^\r?\n/,'');return _0x31b4a5+_0x4dd9ec(0x1ea)+_0x1567c5+_0x4dd9ec(0x1ef)+_0x2e04f5;}function forceBlockCollections(_0x5161f1){if(!isNode(_0x5161f1))return;visit(_0x5161f1,(_0x32295a,_0x1c6ef6)=>{isCollection(_0x1c6ef6)&&(_0x1c6ef6['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x27d4ef,_0xff8cdb,_0x9d53c9,_0x1d7c03){const _0x72b663=a157_0x55d5;if(_0x1d7c03||!existsSync(_0xff8cdb))return;const _0x4b241d=readMetadataIfPresent(_0xff8cdb);if(!_0x4b241d)return;const _0x26ebfe=_0x4b241d[_0x72b663(0x206)]&&Object[_0x72b663(0x1fd)](_0x4b241d[_0x72b663(0x206)])['length']>0x0?_0x4b241d['fileHashes']:undefined;if(_0x26ebfe)for(const [_0x4e78ce,_0x2e2bc3]of Object[_0x72b663(0x20d)](_0x26ebfe)){const _0x4a5c7c=resolveManagedFilePath(_0x27d4ef,_0x4e78ce);if(!existsSync(_0x4a5c7c))throw CliErrors['validation'](_0x72b663(0x1de)+_0x27d4ef,_0x72b663(0x210)+_0x4e78ce);const _0x5cf45f=lstatSync(_0x4a5c7c);if(!_0x5cf45f[_0x72b663(0x1dc)]())throw CliErrors[_0x72b663(0x209)](_0x72b663(0x1de)+_0x27d4ef,_0x72b663(0x1ff)+_0x4e78ce);const _0x2d1646=bufferSha256(readFileSync(_0x4a5c7c));if(_0x2d1646!==_0x2e2bc3)throw CliErrors[_0x72b663(0x209)](_0x72b663(0x1de)+_0x27d4ef+_0x72b663(0x214)+_0x4e78ce,_0x72b663(0x1eb)+_0x4e78ce);}else{const _0x52a967=resolve(_0x27d4ef,SKILL_FILE);if(existsSync(_0x52a967)&&_0x4b241d[_0x72b663(0x1e0)]){const _0x1e89ce=contentHash(readFileSync(_0x52a967,_0x72b663(0x20c)));if(_0x1e89ce!==_0x4b241d[_0x72b663(0x1e0)])throw CliErrors[_0x72b663(0x209)](_0x72b663(0x1e1)+_0x52a967,_0x72b663(0x20a));}}for(const _0x5a98bd of normalizeLocalFiles(_0x9d53c9)){if(_0x26ebfe?.[_0x5a98bd[_0x72b663(0x1f4)]])continue;if(!_0x26ebfe&&_0x5a98bd['path']===SKILL_FILE)continue;const _0xa96e95=resolveManagedFilePath(_0x27d4ef,_0x5a98bd[_0x72b663(0x1f4)]);if(!existsSync(_0xa96e95))continue;const _0x11503d=lstatSync(_0xa96e95);if(!_0x11503d[_0x72b663(0x1dc)]())throw CliErrors[_0x72b663(0x209)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x27d4ef,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x5a98bd[_0x72b663(0x1f4)]);const _0x5a5b6a=bufferSha256(readFileSync(_0xa96e95));if(_0x5a5b6a!==fileHash(_0x5a98bd))throw CliErrors['validation'](_0x72b663(0x1de)+_0x27d4ef,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x5a98bd['path']);}}function materializeFiles(_0x129df9,_0x53a9e1){const _0x4f71a7=a157_0x55d5;for(const _0x498c8e of normalizeLocalFiles(_0x53a9e1)){const _0x5e6aba=resolveManagedFilePath(_0x129df9,_0x498c8e[_0x4f71a7(0x1f4)]);mkdirSync(dirname(_0x5e6aba),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5e6aba,fileContent(_0x498c8e),0x180);}}function removeStaleManagedFiles(_0x2885da,_0x35e7bd,_0x1aac2f){const _0x4a2b1a=a157_0x55d5;if(!_0x35e7bd)return;const _0x871e4b=new Set(normalizeLocalFiles(_0x1aac2f)[_0x4a2b1a(0x1e3)](_0x299f36=>_0x299f36[_0x4a2b1a(0x1f4)]));for(const _0x1498c6 of Object[_0x4a2b1a(0x1fd)](_0x35e7bd)){if(_0x871e4b['has'](_0x1498c6))continue;const _0x168273=resolveManagedFilePath(_0x2885da,_0x1498c6);existsSync(_0x168273)&&lstatSync(_0x168273)[_0x4a2b1a(0x1dc)]()&&rmSync(_0x168273,{'force':!![]});}}
|
|
1
|
+
(function(_0x35379f,_0x4bda64){const _0x5e39bb=a157_0xa0bc,_0x1e309c=_0x35379f();while(!![]){try{const _0x45bf60=parseInt(_0x5e39bb(0x1ea))/0x1+parseInt(_0x5e39bb(0x20c))/0x2+-parseInt(_0x5e39bb(0x1e0))/0x3*(parseInt(_0x5e39bb(0x1e7))/0x4)+parseInt(_0x5e39bb(0x20f))/0x5*(parseInt(_0x5e39bb(0x1e6))/0x6)+parseInt(_0x5e39bb(0x201))/0x7+parseInt(_0x5e39bb(0x1da))/0x8+-parseInt(_0x5e39bb(0x1d6))/0x9*(parseInt(_0x5e39bb(0x1e8))/0xa);if(_0x45bf60===_0x4bda64)break;else _0x1e309c['push'](_0x1e309c['shift']());}catch(_0x3debc0){_0x1e309c['push'](_0x1e309c['shift']());}}}(a157_0x5463,0x40410));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a157_0x5463(){const _0x3c5357=['676917JaWqke','trim','hasOwn','join','1967600GhronW','trimEnd','replace','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','scope','displayName','909mnxlHQ','Runtime\x20Skill\x20package\x20is\x20missing\x20','contentHash','map','pulledAt','Managed\x20file\x20was\x20removed\x20locally:\x20','474vcgNLn','4208ahNdUD','50votLGD','contents','170653mxihAu','delete','schemaVersion','.\x20Changed\x20file:\x20','entries','name:\x20','displayName:\x20','find','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','accessKey','stringify','force','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','paths','toString','utf8','skillName','version','test','description','keys','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','status','268163BOPzxB','description:\x20','filter','appCode','fileHashes','\x0a---\x0a\x0a','validation','flow','path','has','example','172736LcqDmg','errors','length','26375QRYtjZ','---','slice','isFile'];a157_0x5463=function(){return _0x3c5357;};return a157_0x5463();}import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x2fa795,_0x4c2cbe,_0x3d6f75){const _0x2012b8=a157_0xa0bc,_0x4da5e1=requireSkillCode(_0x2fa795),_0x507528=requirePackageBytes(_0x4da5e1,_0x3d6f75['packageBytes']),_0x5d42d2=extractDownloadedPackage(_0x507528),_0x1eb811=_0x5d42d2['find'](_0x1a6f59=>_0x1a6f59['path']===SKILL_FILE);if(!_0x1eb811)throw CliErrors[_0x2012b8(0x207)](_0x2012b8(0x1e1)+SKILL_FILE+':\x20'+_0x4da5e1);const _0x7c42ff=withMaterializedSkillFrontmatter(_0x5d42d2,_0x2fa795,_0x4da5e1),_0x124bdd=_0x7c42ff[_0x2012b8(0x1f1)](_0x2f98fe=>_0x2f98fe[_0x2012b8(0x209)]===SKILL_FILE),_0xe69967=fileText(_0x124bdd),_0x4abd67=getRuntimeSkillDir(_0x3d6f75['env'],_0x3d6f75['accessKey'],_0x3d6f75['appCode'],_0x4c2cbe,_0x4da5e1,_0x3d6f75[_0x2012b8(0x1f7)]),_0x484a87=resolve(_0x4abd67,SKILL_FILE),_0x192ccf=resolve(_0x4abd67,METADATA_FILE),_0x1470f4=contentHash(_0xe69967),_0x1142f8=readMetadataIfPresent(_0x192ccf)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x4abd67,_0x192ccf,_0x7c42ff,_0x3d6f75[_0x2012b8(0x1f5)]===!![]),mkdirSync(_0x4abd67,{'recursive':!![],'mode':0x1c0});const _0x27670a=existsSync(_0x484a87)?readFileSync(_0x484a87,_0x2012b8(0x1f9)):undefined;return materializeFiles(_0x4abd67,_0x7c42ff),removeStaleManagedFiles(_0x4abd67,_0x1142f8,_0x7c42ff),writeJsonAtomic(_0x192ccf,buildMetadata(_0x2fa795,_0x4c2cbe,_0x3d6f75[_0x2012b8(0x204)],_0x1470f4,_0x3d6f75[_0x2012b8(0x1e4)],_0x7c42ff,_0x507528)),{'skill':_0x2fa795,'scope':_0x4c2cbe,'dir':_0x4abd67,'skillMdPath':_0x484a87,'metadataPath':_0x192ccf,'contentHash':_0x1470f4,'changed':_0x27670a!==_0xe69967};}export function reuseMaterializedRuntimeSkill(_0x21521f,_0x155240,_0x36294b){const _0x33dc18=a157_0xa0bc,_0x3e9468=_0x21521f[_0x33dc18(0x1fb)]?.['trim']();if(!_0x3e9468)return undefined;const _0x5541c0=requireSkillCode(_0x21521f),_0x2fbee0=getRuntimeSkillDir(_0x36294b['env'],_0x36294b[_0x33dc18(0x1f3)],_0x36294b[_0x33dc18(0x204)],_0x155240,_0x5541c0,_0x36294b[_0x33dc18(0x1f7)]),_0x3b5063=resolve(_0x2fbee0,SKILL_FILE),_0x3c428d=resolve(_0x2fbee0,METADATA_FILE),_0x53a1bf=readMetadataIfPresent(_0x3c428d);if(!_0x53a1bf||_0x53a1bf[_0x33dc18(0x1ec)]!==0x2||_0x53a1bf[_0x33dc18(0x204)]!==_0x36294b[_0x33dc18(0x204)]||_0x53a1bf[_0x33dc18(0x1de)]!==_0x155240||_0x53a1bf['skillCode']!==_0x5541c0||_0x53a1bf[_0x33dc18(0x1fb)]!==_0x3e9468||_0x53a1bf['id']!==_0x21521f['id']||_0x53a1bf[_0x33dc18(0x1fa)]!==_0x21521f[_0x33dc18(0x1fa)]||_0x53a1bf[_0x33dc18(0x1fd)]!==_0x21521f[_0x33dc18(0x1fd)]||_0x53a1bf[_0x33dc18(0x20b)]!==_0x21521f['example']||_0x53a1bf[_0x33dc18(0x200)]!==_0x21521f['status']||!_0x53a1bf[_0x33dc18(0x1e2)]||!_0x53a1bf[_0x33dc18(0x205)]||!Object[_0x33dc18(0x1d8)](_0x53a1bf[_0x33dc18(0x205)],SKILL_FILE))return undefined;for(const [_0x5c9d46,_0x5eb727]of Object[_0x33dc18(0x1ee)](_0x53a1bf[_0x33dc18(0x205)])){if(!/^[a-f0-9]{64}$/['test'](_0x5eb727))return undefined;const _0x38cf62=resolveManagedFilePath(_0x2fbee0,_0x5c9d46);if(!existsSync(_0x38cf62)||!lstatSync(_0x38cf62)[_0x33dc18(0x1d5)]())return undefined;if(bufferSha256(readFileSync(_0x38cf62))!==_0x5eb727)return undefined;}return{'skill':_0x21521f,'scope':_0x155240,'dir':_0x2fbee0,'skillMdPath':_0x3b5063,'metadataPath':_0x3c428d,'contentHash':_0x53a1bf[_0x33dc18(0x1e2)],'changed':![]};}function withMaterializedSkillFrontmatter(_0xbaf9ea,_0x20213a,_0x1a623b){const _0x2ea1e8=a157_0xa0bc,_0x1f61ba=skillDisplayName(_0x20213a,_0x1a623b),_0x42be03=_0x20213a[_0x2ea1e8(0x1fd)]?.[_0x2ea1e8(0x1d7)]()||_0x1f61ba||_0x1a623b;return normalizeLocalFiles(_0xbaf9ea)[_0x2ea1e8(0x1e3)](_0x15e4b6=>{const _0x1c7027=_0x2ea1e8,_0x1b53df=fileText(_0x15e4b6);if(_0x15e4b6['path']!==SKILL_FILE)return _0x15e4b6;if(hasYamlFrontmatter(_0x1b53df))return{'path':_0x15e4b6[_0x1c7027(0x209)],'content':withSyncedDisplayName(_0x1b53df,_0x1f61ba)};return{'path':_0x15e4b6['path'],'content':prependSkillFrontmatter(_0x1b53df,{'name':_0x1a623b,'displayName':_0x1f61ba,'description':_0x42be03})};});}function hasYamlFrontmatter(_0x386937){const _0x2f7ebd=a157_0xa0bc;return/^\uFEFF?---\s*\r?\n/[_0x2f7ebd(0x1fc)](_0x386937);}function a157_0xa0bc(_0x26f928,_0x3b9563){_0x26f928=_0x26f928-0x1d3;const _0x5463a6=a157_0x5463();let _0xa0bcb5=_0x5463a6[_0x26f928];return _0xa0bcb5;}function prependSkillFrontmatter(_0x590ad8,_0x281367){const _0x3526e0=a157_0xa0bc,_0x45ce9a=_0x590ad8[_0x3526e0(0x1dc)](/^\uFEFF/,'');return[_0x3526e0(0x1d3),_0x3526e0(0x1ef)+yamlString(_0x281367['name']),_0x281367[_0x3526e0(0x1df)]?_0x3526e0(0x1f0)+yamlString(_0x281367[_0x3526e0(0x1df)]):undefined,_0x3526e0(0x202)+yamlString(_0x281367[_0x3526e0(0x1fd)]),_0x3526e0(0x1d3),'',_0x45ce9a][_0x3526e0(0x203)](_0x4007b6=>_0x4007b6!==undefined)[_0x3526e0(0x1d9)]('\x0a');}function yamlString(_0x3e5131){const _0xbf542a=a157_0xa0bc;return JSON[_0xbf542a(0x1f4)](_0x3e5131[_0xbf542a(0x1dc)](/\r/g,'')['trim']());}function skillDisplayName(_0x26194a,_0x860106){const _0x4a50b2=a157_0xa0bc,_0x54bcd2=_0x26194a['skillName']?.[_0x4a50b2(0x1d7)]();return _0x54bcd2||_0x860106;}function withSyncedDisplayName(_0x103d28,_0x527030){const _0x190ffe=a157_0xa0bc,_0x4a7701=_0x103d28['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4a7701)return _0x103d28;const _0x330194=_0x4a7701[0x1]??'',_0x4f9786=_0x4a7701[0x2]??'',_0x79db05=parseDocument(_0x4f9786);if(_0x79db05[_0x190ffe(0x20d)][_0x190ffe(0x20e)]>0x0||!isMap(_0x79db05[_0x190ffe(0x1e9)]))return _0x103d28;if(_0x527030)_0x79db05['set']('displayName',_0x527030);else{if(_0x79db05[_0x190ffe(0x20a)](_0x190ffe(0x1df)))_0x79db05[_0x190ffe(0x1eb)]('displayName');else return _0x103d28;}forceBlockCollections(_0x79db05[_0x190ffe(0x1e9)]);const _0x5f04c4=_0x79db05[_0x190ffe(0x1f8)]({'lineWidth':0x0})[_0x190ffe(0x1db)](),_0xa0fedb=_0x103d28[_0x190ffe(0x1d4)](_0x4a7701[0x0]['length'])[_0x190ffe(0x1dc)](/^\r?\n/,'');return _0x330194+'---\x0a'+_0x5f04c4+_0x190ffe(0x206)+_0xa0fedb;}function forceBlockCollections(_0x5b502d){if(!isNode(_0x5b502d))return;visit(_0x5b502d,(_0x17586f,_0x24f7c3)=>{const _0x3a0f83=a157_0xa0bc;isCollection(_0x24f7c3)&&(_0x24f7c3[_0x3a0f83(0x208)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x487d77,_0x228e2d,_0x21e651,_0x677f0b){const _0x42e64c=a157_0xa0bc;if(_0x677f0b||!existsSync(_0x228e2d))return;const _0x43b92e=readMetadataIfPresent(_0x228e2d);if(!_0x43b92e)return;const _0x535b8f=_0x43b92e[_0x42e64c(0x205)]&&Object[_0x42e64c(0x1fe)](_0x43b92e['fileHashes'])[_0x42e64c(0x20e)]>0x0?_0x43b92e[_0x42e64c(0x205)]:undefined;if(_0x535b8f)for(const [_0x360fc0,_0x55f865]of Object['entries'](_0x535b8f)){const _0x58ad27=resolveManagedFilePath(_0x487d77,_0x360fc0);if(!existsSync(_0x58ad27))throw CliErrors[_0x42e64c(0x207)](_0x42e64c(0x1f2)+_0x487d77,_0x42e64c(0x1e5)+_0x360fc0);const _0x392daf=lstatSync(_0x58ad27);if(!_0x392daf[_0x42e64c(0x1d5)]())throw CliErrors[_0x42e64c(0x207)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x487d77,_0x42e64c(0x1dd)+_0x360fc0);const _0x434b27=bufferSha256(readFileSync(_0x58ad27));if(_0x434b27!==_0x55f865)throw CliErrors['validation'](_0x42e64c(0x1f2)+_0x487d77+_0x42e64c(0x1ed)+_0x360fc0,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x360fc0);}else{const _0x4629f4=resolve(_0x487d77,SKILL_FILE);if(existsSync(_0x4629f4)&&_0x43b92e[_0x42e64c(0x1e2)]){const _0x54d6f8=contentHash(readFileSync(_0x4629f4,_0x42e64c(0x1f9)));if(_0x54d6f8!==_0x43b92e[_0x42e64c(0x1e2)])throw CliErrors[_0x42e64c(0x207)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x4629f4,_0x42e64c(0x1f6));}}for(const _0x4f8b1d of normalizeLocalFiles(_0x21e651)){if(_0x535b8f?.[_0x4f8b1d[_0x42e64c(0x209)]])continue;if(!_0x535b8f&&_0x4f8b1d[_0x42e64c(0x209)]===SKILL_FILE)continue;const _0x318198=resolveManagedFilePath(_0x487d77,_0x4f8b1d[_0x42e64c(0x209)]);if(!existsSync(_0x318198))continue;const _0x17e3f8=lstatSync(_0x318198);if(!_0x17e3f8[_0x42e64c(0x1d5)]())throw CliErrors[_0x42e64c(0x207)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x487d77,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x4f8b1d['path']);const _0xc81044=bufferSha256(readFileSync(_0x318198));if(_0xc81044!==fileHash(_0x4f8b1d))throw CliErrors[_0x42e64c(0x207)](_0x42e64c(0x1f2)+_0x487d77,_0x42e64c(0x1ff)+_0x4f8b1d[_0x42e64c(0x209)]);}}function materializeFiles(_0x4c3f7b,_0x59d95a){const _0x405972=a157_0xa0bc;for(const _0x1a4229 of normalizeLocalFiles(_0x59d95a)){const _0x34a707=resolveManagedFilePath(_0x4c3f7b,_0x1a4229[_0x405972(0x209)]);mkdirSync(dirname(_0x34a707),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x34a707,fileContent(_0x1a4229),0x180);}}function removeStaleManagedFiles(_0xb79844,_0x442ab3,_0x5020c8){const _0x352567=a157_0xa0bc;if(!_0x442ab3)return;const _0xa68cf=new Set(normalizeLocalFiles(_0x5020c8)['map'](_0x32764b=>_0x32764b[_0x352567(0x209)]));for(const _0x1c5228 of Object[_0x352567(0x1fe)](_0x442ab3)){if(_0xa68cf['has'](_0x1c5228))continue;const _0x256b9d=resolveManagedFilePath(_0xb79844,_0x1c5228);existsSync(_0x256b9d)&&lstatSync(_0x256b9d)[_0x352567(0x1d5)]()&&rmSync(_0x256b9d,{'force':!![]});}}
|