@lovrabet/lovrabet-cli 2.3.8-beta.5 → 2.3.8-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/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/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.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-sdk-errors.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/runtime-user-id.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +10 -2
- package/skills/lovrabet/guides/development-intent-handoff.md +58 -0
- package/skills/lovrabet.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a150_0x4db0a9=a150_0x5288;(function(_0x2a7e18,_0x556299){const _0x3f39ed=a150_0x5288,_0x23599e=_0x2a7e18();while(!![]){try{const _0x2f0a73=parseInt(_0x3f39ed(0x1dc))/0x1*(-parseInt(_0x3f39ed(0x1a4))/0x2)+parseInt(_0x3f39ed(0x1d2))/0x3+-parseInt(_0x3f39ed(0x1f9))/0x4+-parseInt(_0x3f39ed(0x1e2))/0x5*(-parseInt(_0x3f39ed(0x1ea))/0x6)+-parseInt(_0x3f39ed(0x21a))/0x7+parseInt(_0x3f39ed(0x1ed))/0x8*(-parseInt(_0x3f39ed(0x1ba))/0x9)+parseInt(_0x3f39ed(0x1fe))/0xa;if(_0x2f0a73===_0x556299)break;else _0x23599e['push'](_0x23599e['shift']());}catch(_0x52dbe4){_0x23599e['push'](_0x23599e['shift']());}}}(a150_0x14ae,0x60717));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(_0x5b075f){const _0x4858d2=a150_0x5288;if(Array[_0x4858d2(0x1c3)](_0x5b075f))return'['+_0x5b075f['map'](canonical)[_0x4858d2(0x1a3)](',')+']';if(_0x5b075f&&typeof _0x5b075f===_0x4858d2(0x1da))return'{'+Object['keys'](_0x5b075f)[_0x4858d2(0x215)]()[_0x4858d2(0x1d4)](_0x9cb1b1=>JSON[_0x4858d2(0x201)](_0x9cb1b1)+':'+canonical(_0x5b075f[_0x9cb1b1]))[_0x4858d2(0x1a3)](',')+'}';return JSON[_0x4858d2(0x201)](_0x5b075f)??'undefined';}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a150_0x4db0a9(0x1ab),a150_0x4db0a9(0x1c5),a150_0x4db0a9(0x213),a150_0x4db0a9(0x1c8),'pois',a150_0x4db0a9(0x1e5),'country',a150_0x4db0a9(0x216),'province',a150_0x4db0a9(0x1a0),'city','netType','resultCode',a150_0x4db0a9(0x212),'accuracy',a150_0x4db0a9(0x1a1),a150_0x4db0a9(0x1b7),a150_0x4db0a9(0x1ce),a150_0x4db0a9(0x1f3),a150_0x4db0a9(0x20e)]);export function sameImportValue(_0x12daa8,_0x1b78b7,_0x1a9e5a=![]){const _0x547f78=a150_0x4db0a9;if(_0x1a9e5a){const _0x48463a=_0x571acb=>Array['isArray'](_0x571acb)?_0x571acb[_0x547f78(0x1d4)](_0x97e74f=>{const _0x54e135=_0x547f78;if(!_0x97e74f||typeof _0x97e74f!==_0x54e135(0x1da)||Array[_0x54e135(0x1c3)](_0x97e74f))return _0x97e74f;const _0x18263f={..._0x97e74f};delete _0x18263f['url'],delete _0x18263f[_0x54e135(0x1af)];if(_0x18263f['dingTalkUrl']==='')delete _0x18263f[_0x54e135(0x1a5)];if(_0x18263f[_0x54e135(0x1f4)]==null)delete _0x18263f[_0x54e135(0x1f4)];if(_0x18263f[_0x54e135(0x1e9)]==null)delete _0x18263f[_0x54e135(0x1e9)];if(_0x18263f[_0x54e135(0x211)]==null||typeof _0x18263f[_0x54e135(0x211)]===_0x54e135(0x1da)&&!Array[_0x54e135(0x1c3)](_0x18263f[_0x54e135(0x211)])&&Object['entries'](_0x18263f[_0x54e135(0x211)])['every'](([_0x2a5b9b,_0xef60b5])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x54e135(0x1ac)](_0x2a5b9b)&&_0xef60b5===null))delete _0x18263f[_0x54e135(0x211)];for(const _0x5c1e24 of['name',_0x54e135(0x1d1),_0x54e135(0x1f7)])if(!(_0x5c1e24 in _0x18263f))_0x18263f[_0x5c1e24]='';if(_0x18263f[_0x54e135(0x1bf)]==null)_0x18263f[_0x54e135(0x1bf)]=0x0;return _0x18263f;}):_0x571acb;return canonical(_0x48463a(_0x12daa8))===canonical(_0x48463a(_0x1b78b7));}return _0x12daa8===null?_0x1b78b7===null||_0x1b78b7===undefined:canonical(_0x1b78b7)===canonical(_0x12daa8);}function a150_0x5288(_0x646f29,_0x2ed63a){_0x646f29=_0x646f29-0x19d;const _0x14ae0a=a150_0x14ae();let _0x52882e=_0x14ae0a[_0x646f29];return _0x52882e;}async function rejectSymlink(_0x55ca6a){const _0x38c78a=a150_0x4db0a9;try{if((await lstat(_0x55ca6a))['isSymbolicLink']())throw Error('Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.');}catch(_0x1d5ad3){if(_0x1d5ad3[_0x38c78a(0x1b0)]!=='ENOENT')throw _0x1d5ad3;}}export async function resolveImportOutputPath(_0x208676){return await rejectSymlink(_0x208676),resolve(await realpath(dirname(resolve(_0x208676))),basename(_0x208676));}export function assertImportPaths(_0x197175,_0x24f9a3,_0x34d60b=[]){const _0x538097=a150_0x4db0a9,_0x492c19=[..._0x34d60b,_0x197175,_0x24f9a3,_0x197175+_0x538097(0x1c0),_0x197175+'.lock.recovery']['map'](_0x37ff09=>resolve(_0x37ff09));if(new Set(_0x492c19)[_0x538097(0x1bf)]!==_0x492c19['length'])throw Error(_0x538097(0x19e));}export async function saveImportJson(_0xc2cadc,_0x2b5c7f){const _0x43952a=a150_0x4db0a9;await rejectSymlink(_0xc2cadc);const _0x5b4484=_0xc2cadc+_0x43952a(0x1eb)+randomUUID(),_0x301bfa=await open(_0x5b4484,'wx',0x180);try{await _0x301bfa['writeFile'](JSON[_0x43952a(0x201)](_0x2b5c7f,null,0x2)),await _0x301bfa['sync']();}finally{await _0x301bfa[_0x43952a(0x1a6)]();}try{await rename(_0x5b4484,_0xc2cadc);}catch(_0x3587c8){await unlink(_0x5b4484)[_0x43952a(0x1f1)](()=>{});throw _0x3587c8;}}function a150_0x14ae(){const _0x4d944f=['conflict','count','previewUrl','code','errors','completed','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','batchSize','EEXIST','message','cityAdcode','strategy','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','3053835pqRHyx','appCode','byteLength','schemaVersion','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','size','.lock','actorId','Excel\x20contains\x20no\x20valid\x20data\x20rows.','isArray','sync','operatorType','rowNumber','length','district','get','isInteger','parse','filter','version','errorMessage','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','maxBatchSize','type','1356258klCmYj','runtimeDomain','map','ids','warnings','binding','emptyRows','maxBatchBytes','object','every','339769gYToeW','some','source','fileHash','Excel\x20row\x20','utf8','175900CbbujB','Cannot\x20read\x20the\x20import\x20checkpoint.','slice','road','values','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','datasetCode','createUserName','132IMvPWF','.tmp-','unsent','8MmocNZ','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','token','string','catch','ENOENT','address','createUserId','resume','checkpoint','key','report','2688920jbiDGA','Incomplete\x20readback.','now','schemaFingerprint','succeeded','11897430Ypudgq','Invalid\x20import\x20readback\x20response.','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','stringify','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','pending','Invalid\x20import\x20batch\x20size.','sheet','pid','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','incomplete','.recovery','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','forEach','rows','readback','lbswuaCacheId','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','isSafeInteger','geolocation','streetNumber','districtAdcode','includes','sort','countryCode','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','kill','METADATA','4686108zZWkfy','Invalid\x20import\x20lock\x20owner.','push','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','auto-id-task-marker','latitude','longitude','status','join','2zFQnfX','dingTalkUrl','close','Invalid\x20write\x20result.','fixed-negative-id','onCheckpointReady','ESRCH','time','has'];a150_0x14ae=function(){return _0x4d944f;};return a150_0x14ae();}export async function acquireLock(_0x25b79f){const _0x308025=a150_0x4db0a9,_0x280d0c=_0x25b79f+_0x308025(0x1c0),_0x32fa97=randomUUID();await rejectSymlink(_0x280d0c);const _0x255f83=_0x280d0c+_0x308025(0x209);let _0x2893bc,_0x318085;try{try{_0x2893bc=await open(_0x280d0c,'wx',0x180);}catch(_0x171f49){if(_0x171f49[_0x308025(0x1b0)]!==_0x308025(0x1b5))throw _0x171f49;try{_0x318085=await open(_0x255f83,'wx',0x180);}catch(_0x400b41){if(_0x400b41[_0x308025(0x1b0)]===_0x308025(0x1b5))throw Error(_0x308025(0x20f));throw _0x400b41;}await _0x318085['writeFile'](JSON[_0x308025(0x201)]({'pid':process[_0x308025(0x206)],'token':_0x32fa97})),await _0x318085[_0x308025(0x1c4)](),await rejectSymlink(_0x280d0c);let _0x3bf8dc;try{_0x3bf8dc=await readFile(_0x280d0c,_0x308025(0x1e1));}catch(_0x3e54c5){if(_0x3e54c5[_0x308025(0x1b0)]!==_0x308025(0x1f2))throw _0x3e54c5;}if(_0x3bf8dc!==undefined){let _0x196269;try{_0x196269=JSON[_0x308025(0x1cb)](_0x3bf8dc);}catch{throw Error(_0x308025(0x1e7));}if(!_0x196269||!Number['isSafeInteger'](_0x196269[_0x308025(0x206)])||_0x196269[_0x308025(0x206)]<=0x0)throw Error(_0x308025(0x21b));try{process[_0x308025(0x218)](_0x196269[_0x308025(0x206)],0x0);throw Error(_0x308025(0x1be));}catch(_0x5024af){if(_0x5024af[_0x308025(0x1b0)]!==_0x308025(0x1aa))throw _0x5024af;}if(await readFile(_0x280d0c,'utf8')!==_0x3bf8dc)throw Error('Import\x20lock\x20changed;\x20retry\x20recovery.');await unlink(_0x280d0c);}_0x2893bc=await open(_0x280d0c,'wx',0x180);}await _0x2893bc['writeFile'](JSON[_0x308025(0x201)]({'pid':process['pid'],'token':_0x32fa97})),await _0x2893bc[_0x308025(0x1c4)]();}finally{try{await _0x2893bc?.[_0x308025(0x1a6)]();}finally{if(_0x318085)try{await _0x318085[_0x308025(0x1a6)]();}finally{await unlink(_0x255f83);}}}return async()=>{const _0x4c9694=_0x308025;if(JSON[_0x4c9694(0x1cb)](await readFile(_0x280d0c,_0x4c9694(0x1e1)))[_0x4c9694(0x1ef)]===_0x32fa97)await unlink(_0x280d0c);};}export function assertImportContract(_0x4448f3,_0x1a417e,_0x514554){const _0xad85e1=a150_0x4db0a9;if(!_0x4448f3||!(_0x4448f3[_0xad85e1(0x1bd)]===0x1&&_0x4448f3[_0xad85e1(0x1b8)]===_0xad85e1(0x1a8)||_0x4448f3[_0xad85e1(0x1bd)]===0x2&&_0x4448f3[_0xad85e1(0x1b8)]===_0xad85e1(0x19f))||_0x4448f3[_0xad85e1(0x1de)]!==_0xad85e1(0x219)||_0x4448f3['appCode']!==_0x1a417e||_0x4448f3[_0xad85e1(0x1e8)]!==_0x514554||typeof _0x4448f3[_0xad85e1(0x1c1)]!==_0xad85e1(0x1f0)||!_0x4448f3[_0xad85e1(0x1c1)]||typeof _0x4448f3[_0xad85e1(0x1fc)]!==_0xad85e1(0x1f0)||!_0x4448f3[_0xad85e1(0x1fc)]||!Number[_0xad85e1(0x210)](_0x4448f3['maxBatchSize'])||_0x4448f3[_0xad85e1(0x1d0)]<0x1||_0x4448f3['maxBatchSize']>0x3e8||!Number[_0xad85e1(0x210)](_0x4448f3[_0xad85e1(0x1d9)])||_0x4448f3[_0xad85e1(0x1d9)]<0x1||_0x4448f3[_0xad85e1(0x1d9)]>0x14*0x400*0x400)throw Error(_0xad85e1(0x20a));}export async function runExcelImport(_0x270389){const _0x2c00ca=a150_0x4db0a9;_0x270389={..._0x270389,'checkpoint':await resolveImportOutputPath(_0x270389[_0x2c00ca(0x1f6)]),'report':await resolveImportOutputPath(_0x270389[_0x2c00ca(0x1f8)])};const {manifest:_0x5421b3,contract:_0x38b4f4,api:_0x17b808}=_0x270389;assertImportContract(_0x38b4f4,_0x270389[_0x2c00ca(0x1bb)],_0x270389['datasetCode']);if(_0x38b4f4[_0x2c00ca(0x1bd)]!==0x1)throw Error(_0x2c00ca(0x1cf));if(_0x5421b3[_0x2c00ca(0x1b1)][_0x2c00ca(0x1c7)])throw Error('Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.');if(!_0x5421b3[_0x2c00ca(0x20c)][_0x2c00ca(0x1c7)])throw Error(_0x2c00ca(0x1c2));if(!Number[_0x2c00ca(0x1ca)](_0x270389[_0x2c00ca(0x1b4)])||_0x270389[_0x2c00ca(0x1b4)]<0x1||_0x270389[_0x2c00ca(0x1b4)]>_0x38b4f4[_0x2c00ca(0x1d0)])throw Error(_0x2c00ca(0x204));for(const _0xa232b3 of _0x5421b3[_0x2c00ca(0x20c)]){if(Buffer[_0x2c00ca(0x1bc)](JSON[_0x2c00ca(0x201)]({'schemaFingerprint':_0x38b4f4[_0x2c00ca(0x1fc)],'items':[{..._0xa232b3[_0x2c00ca(0x1e6)],'id':-0x1fffffffffffff}]}),'utf8')>_0x38b4f4['maxBatchBytes'])throw Error('Excel\x20row\x20'+_0xa232b3[_0x2c00ca(0x1c6)]+_0x2c00ca(0x1ee));}assertImportPaths(_0x270389[_0x2c00ca(0x1f6)],_0x270389[_0x2c00ca(0x1f8)]);const _0x4ca5af={'appCode':_0x270389['appCode'],'datasetCode':_0x270389['datasetCode'],'runtimeDomain':_0x270389[_0x2c00ca(0x1d3)],'actorId':_0x38b4f4[_0x2c00ca(0x1c1)],'fileHash':_0x5421b3[_0x2c00ca(0x1df)],'mappingHash':_0x5421b3['mappingHash'],'schemaHash':_0x5421b3['schemaHash'],'remoteSchemaHash':_0x38b4f4[_0x2c00ca(0x1fc)],'batchSize':_0x270389[_0x2c00ca(0x1b4)],'sheet':_0x5421b3[_0x2c00ca(0x205)]},_0x35eb07=await acquireLock(_0x270389[_0x2c00ca(0x1f6)]);let _0x21be45;const _0x4bd582=Date[_0x2c00ca(0x1fb)]();let _0x5e6078=0x0;const _0x2f7bc3=[],_0x58641d=()=>({'importId':_0x21be45?.['importId'],'sourceRows':_0x5421b3[_0x2c00ca(0x20c)]['length'],'emptyRows':_0x5421b3[_0x2c00ca(0x1d8)][_0x2c00ca(0x1c7)],'succeeded':_0x21be45?.[_0x2c00ca(0x20c)]['filter'](_0x222407=>_0x222407[_0x2c00ca(0x1a2)]==='succeeded')['length']??0x0,'unknown':_0x21be45?.[_0x2c00ca(0x20c)]['filter'](_0x3a617c=>_0x3a617c[_0x2c00ca(0x1a2)]===_0x2c00ca(0x203))['length']??0x0,'conflicts':_0x21be45?.[_0x2c00ca(0x20c)][_0x2c00ca(0x1cc)](_0x4f3e92=>_0x4f3e92[_0x2c00ca(0x1a2)]===_0x2c00ca(0x1ad))[_0x2c00ca(0x1c7)]??0x0,'notAttempted':_0x21be45?.['rows'][_0x2c00ca(0x1cc)](_0x3ba9d4=>_0x3ba9d4['status']==='unsent')['length']??_0x5421b3[_0x2c00ca(0x20c)][_0x2c00ca(0x1c7)],'batches':_0x5e6078,'batchResults':_0x2f7bc3,'elapsedMs':Date['now']()-_0x4bd582,'checkpoint':resolve(_0x270389['checkpoint']),'report':resolve(_0x270389[_0x2c00ca(0x1f8)]),'warnings':_0x5421b3[_0x2c00ca(0x1d6)]});try{await rejectSymlink(_0x270389[_0x2c00ca(0x1f6)]);if(_0x270389[_0x2c00ca(0x1f5)]){try{_0x21be45=JSON['parse'](await readFile(_0x270389[_0x2c00ca(0x1f6)],_0x2c00ca(0x1e1)));}catch{throw Error(_0x2c00ca(0x1e3));}if(!_0x21be45||_0x21be45[_0x2c00ca(0x1cd)]!==0x1||typeof _0x21be45['importId']!==_0x2c00ca(0x1f0)||canonical(_0x21be45[_0x2c00ca(0x1d7)])!==canonical(_0x4ca5af)||!Array[_0x2c00ca(0x1c3)](_0x21be45[_0x2c00ca(0x20c)])||_0x21be45['rows'][_0x2c00ca(0x1c7)]!==_0x5421b3[_0x2c00ca(0x20c)][_0x2c00ca(0x1c7)]||new Set(_0x21be45[_0x2c00ca(0x20c)][_0x2c00ca(0x1d4)](_0x338870=>_0x338870['id']))[_0x2c00ca(0x1bf)]!==_0x21be45[_0x2c00ca(0x20c)][_0x2c00ca(0x1c7)]||_0x21be45[_0x2c00ca(0x20c)][_0x2c00ca(0x1dd)]((_0x56cad4,_0x2b53f2)=>!Number['isSafeInteger'](_0x56cad4['id'])||_0x56cad4['id']>=0x0||_0x56cad4['rowNumber']!==_0x5421b3[_0x2c00ca(0x20c)][_0x2b53f2][_0x2c00ca(0x1c6)]||![_0x2c00ca(0x1ec),_0x2c00ca(0x203),_0x2c00ca(0x1fd),'conflict'][_0x2c00ca(0x214)](_0x56cad4['status'])))throw Error(_0x2c00ca(0x1b3));}else{try{await lstat(_0x270389[_0x2c00ca(0x1f6)]);throw Error(_0x2c00ca(0x217));}catch(_0x3d4b9e){if(_0x3d4b9e['code']!=='ENOENT')throw _0x3d4b9e;}const _0x32b4b0=new Set();_0x21be45={'version':0x1,'importId':randomUUID(),'binding':_0x4ca5af,'rows':_0x5421b3['rows'][_0x2c00ca(0x1d4)](_0x5051d3=>{const _0x587155=_0x2c00ca;let _0x261d3d;do{_0x261d3d=-(Number(BigInt('0x'+randomBytes(0x7)['toString']('hex'))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x32b4b0[_0x587155(0x1ac)](_0x261d3d));return _0x32b4b0['add'](_0x261d3d),{'id':_0x261d3d,'rowNumber':_0x5051d3[_0x587155(0x1c6)],'status':_0x587155(0x1ec)};})},await saveImportJson(_0x270389[_0x2c00ca(0x1f6)],_0x21be45);}await _0x270389[_0x2c00ca(0x1a9)]?.();const _0x2b2aae=_0x21be45;if(_0x2b2aae[_0x2c00ca(0x20c)]['some'](_0x193eff=>_0x193eff[_0x2c00ca(0x1a2)]===_0x2c00ca(0x1ad)))throw Error('Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.');const _0x54d17c=async _0x44e2e1=>{const _0x5af638=_0x2c00ca,_0x139e3f=await _0x17b808[_0x5af638(0x20d)](_0x44e2e1['map'](_0x1e67c9=>_0x2b2aae[_0x5af638(0x20c)][_0x1e67c9]['id']));if(!Array['isArray'](_0x139e3f))throw Error(_0x5af638(0x1ff));const _0x380b73=new Set(_0x44e2e1[_0x5af638(0x1d4)](_0x17dff6=>_0x2b2aae[_0x5af638(0x20c)][_0x17dff6]['id'])),_0x22cb81=new Map();for(const _0x1e667c of _0x139e3f){const _0x1c05bf=Number(_0x1e667c?.['id']);if(!_0x380b73[_0x5af638(0x1ac)](_0x1c05bf)||_0x22cb81[_0x5af638(0x1ac)](_0x1c05bf))throw Error(_0x5af638(0x207));_0x22cb81['set'](_0x1c05bf,_0x1e667c);}for(const _0x245548 of _0x44e2e1){const _0x517508=_0x22cb81[_0x5af638(0x1c9)](_0x2b2aae[_0x5af638(0x20c)][_0x245548]['id']);if(!_0x517508)continue;if(_0x2b2aae['rows'][_0x245548][_0x5af638(0x1a2)]===_0x5af638(0x1ec)){_0x2b2aae['rows'][_0x245548]['status']=_0x5af638(0x1ad),await saveImportJson(_0x270389[_0x5af638(0x1f6)],_0x2b2aae);throw Error(_0x5af638(0x200));}const _0x2aa486=_0x5421b3[_0x5af638(0x20c)][_0x245548][_0x5af638(0x1e6)];if(Object['keys'](_0x2aa486)[_0x5af638(0x1dd)](_0x2b9609=>!sameImportValue(_0x2aa486[_0x2b9609],_0x517508[_0x2b9609],_0x5421b3['imageFields']?.['includes'](_0x2b9609)&&!_0x5421b3['uploadFields']?.[_0x5af638(0x214)](_0x2b9609)))){_0x2b2aae[_0x5af638(0x20c)][_0x245548]['status']=_0x5af638(0x1ad),await saveImportJson(_0x270389[_0x5af638(0x1f6)],_0x2b2aae);throw Error(_0x5af638(0x1b9)+_0x2b2aae['rows'][_0x245548][_0x5af638(0x1c6)]+'.');}_0x2b2aae[_0x5af638(0x20c)][_0x245548][_0x5af638(0x1a2)]='succeeded';}return await saveImportJson(_0x270389[_0x5af638(0x1f6)],_0x2b2aae),_0x22cb81;};if(_0x270389[_0x2c00ca(0x1f5)])for(let _0x52d63c=0x0;_0x52d63c<_0x2b2aae[_0x2c00ca(0x20c)][_0x2c00ca(0x1c7)];_0x52d63c+=_0x270389[_0x2c00ca(0x1b4)]){const _0x2717e9=_0x2b2aae[_0x2c00ca(0x20c)][_0x2c00ca(0x1e4)](_0x52d63c,_0x52d63c+_0x270389[_0x2c00ca(0x1b4)])[_0x2c00ca(0x1d4)]((_0x403eff,_0x3c7b42)=>_0x52d63c+_0x3c7b42),_0x33e3e1=_0x2717e9[_0x2c00ca(0x1cc)](_0x5949ca=>_0x2b2aae[_0x2c00ca(0x20c)][_0x5949ca]['status']===_0x2c00ca(0x1fd)),_0x3bc670=await _0x54d17c(_0x2717e9),_0x4fc2a8=_0x33e3e1['filter'](_0x56e42c=>!_0x3bc670[_0x2c00ca(0x1ac)](_0x2b2aae[_0x2c00ca(0x20c)][_0x56e42c]['id']));if(_0x4fc2a8[_0x2c00ca(0x1c7)]){_0x4fc2a8[_0x2c00ca(0x20b)](_0x13930d=>{const _0x3cd3b0=_0x2c00ca;_0x2b2aae[_0x3cd3b0(0x20c)][_0x13930d]['status']=_0x3cd3b0(0x1ad);}),await saveImportJson(_0x270389[_0x2c00ca(0x1f6)],_0x2b2aae);throw Error('Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.');}}for(let _0x2239be=0x0;_0x2239be<_0x2b2aae[_0x2c00ca(0x20c)][_0x2c00ca(0x1c7)];){const _0x4fb9e3=[],_0x2e3d5d=[];while(_0x2239be<_0x2b2aae[_0x2c00ca(0x20c)][_0x2c00ca(0x1c7)]&&_0x2e3d5d[_0x2c00ca(0x1c7)]<_0x270389[_0x2c00ca(0x1b4)]){const _0x30d294=_0x2239be++;if(_0x2b2aae[_0x2c00ca(0x20c)][_0x30d294][_0x2c00ca(0x1a2)]===_0x2c00ca(0x1fd))continue;const _0x2c76d7={..._0x5421b3[_0x2c00ca(0x20c)][_0x30d294][_0x2c00ca(0x1e6)],'id':_0x2b2aae[_0x2c00ca(0x20c)][_0x30d294]['id']};if(Buffer[_0x2c00ca(0x1bc)](JSON[_0x2c00ca(0x201)]({'schemaFingerprint':_0x38b4f4['schemaFingerprint'],'items':[..._0x2e3d5d,_0x2c76d7]}),_0x2c00ca(0x1e1))>_0x38b4f4[_0x2c00ca(0x1d9)]){if(!_0x2e3d5d[_0x2c00ca(0x1c7)])throw Error(_0x2c00ca(0x1e0)+_0x2b2aae[_0x2c00ca(0x20c)][_0x30d294][_0x2c00ca(0x1c6)]+_0x2c00ca(0x1ee));_0x2239be--;break;}_0x4fb9e3[_0x2c00ca(0x19d)](_0x30d294),_0x2e3d5d[_0x2c00ca(0x19d)](_0x2c76d7);}if(!_0x2e3d5d[_0x2c00ca(0x1c7)])continue;const _0x513572=_0x4fb9e3[_0x2c00ca(0x1cc)](_0x2022ff=>_0x2b2aae[_0x2c00ca(0x20c)][_0x2022ff][_0x2c00ca(0x1a2)]===_0x2c00ca(0x1ec));if(_0x513572[_0x2c00ca(0x1c7)]){const _0x23717b=await _0x17b808['readback'](_0x513572[_0x2c00ca(0x1d4)](_0x3ff208=>_0x2b2aae[_0x2c00ca(0x20c)][_0x3ff208]['id']));if(!Array[_0x2c00ca(0x1c3)](_0x23717b))throw Error('Invalid\x20import\x20readback\x20response.');if(_0x23717b[_0x2c00ca(0x1c7)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x4fb9e3[_0x2c00ca(0x20b)](_0x3b9cce=>{const _0x4f813c=_0x2c00ca;_0x2b2aae[_0x4f813c(0x20c)][_0x3b9cce][_0x4f813c(0x1a2)]=_0x4f813c(0x203);}),await saveImportJson(_0x270389[_0x2c00ca(0x1f6)],_0x2b2aae),_0x5e6078++;const _0x257e3d=Date[_0x2c00ca(0x1fb)](),_0x10cf8e={'batch':_0x5e6078,'rowStart':_0x2b2aae[_0x2c00ca(0x20c)][_0x4fb9e3[0x0]]['rowNumber'],'rowEnd':_0x2b2aae['rows'][_0x4fb9e3[_0x4fb9e3[_0x2c00ca(0x1c7)]-0x1]][_0x2c00ca(0x1c6)],'count':_0x2e3d5d[_0x2c00ca(0x1c7)],'bytes':Buffer['byteLength'](JSON[_0x2c00ca(0x201)]({'schemaFingerprint':_0x38b4f4[_0x2c00ca(0x1fc)],'items':_0x2e3d5d}),_0x2c00ca(0x1e1)),'elapsedMs':0x0,'status':'unknown'};_0x2f7bc3['push'](_0x10cf8e);try{const _0x5a8742=await _0x17b808['write'](_0x2e3d5d);if(!_0x5a8742||_0x5a8742[_0x2c00ca(0x1ae)]!==_0x2e3d5d[_0x2c00ca(0x1c7)]||!Array[_0x2c00ca(0x1c3)](_0x5a8742[_0x2c00ca(0x1d5)])||_0x5a8742['ids'][_0x2c00ca(0x1c7)]!==_0x2e3d5d[_0x2c00ca(0x1c7)]||_0x5a8742[_0x2c00ca(0x1d5)]['some']((_0x418c0f,_0x2e0afa)=>Number(_0x418c0f)!==_0x2b2aae[_0x2c00ca(0x20c)][_0x4fb9e3[_0x2e0afa]]['id']))throw Error(_0x2c00ca(0x1a7));await _0x54d17c(_0x4fb9e3);if(_0x4fb9e3[_0x2c00ca(0x1dd)](_0x523633=>_0x2b2aae['rows'][_0x523633][_0x2c00ca(0x1a2)]!==_0x2c00ca(0x1fd)))throw Error(_0x2c00ca(0x1fa));}catch(_0x2bf2b0){if(_0x2b2aae['rows'][_0x2c00ca(0x1dd)](_0x49d50f=>_0x49d50f[_0x2c00ca(0x1a2)]===_0x2c00ca(0x1ad)))throw _0x2bf2b0;try{await _0x54d17c(_0x4fb9e3);}catch(_0x4b03ab){if(_0x2b2aae[_0x2c00ca(0x20c)]['some'](_0x3d7160=>_0x3d7160[_0x2c00ca(0x1a2)]===_0x2c00ca(0x1ad)))throw _0x4b03ab;}if(_0x4fb9e3['some'](_0x28590d=>_0x2b2aae['rows'][_0x28590d]['status']!=='succeeded'))throw Error(_0x2c00ca(0x202));}finally{_0x10cf8e['elapsedMs']=Date[_0x2c00ca(0x1fb)]()-_0x257e3d;if(_0x4fb9e3[_0x2c00ca(0x1db)](_0x4a81b1=>_0x2b2aae[_0x2c00ca(0x20c)][_0x4a81b1]['status']===_0x2c00ca(0x1fd)))_0x10cf8e[_0x2c00ca(0x1a2)]=_0x2c00ca(0x1fd);else{if(_0x4fb9e3[_0x2c00ca(0x1dd)](_0x233806=>_0x2b2aae[_0x2c00ca(0x20c)][_0x233806][_0x2c00ca(0x1a2)]===_0x2c00ca(0x1ad)))_0x10cf8e[_0x2c00ca(0x1a2)]=_0x2c00ca(0x1ad);}}}const _0x247000={'status':_0x2c00ca(0x1b2),..._0x58641d()};return await saveImportJson(_0x270389[_0x2c00ca(0x1f8)],_0x247000),_0x247000;}catch(_0x33b154){if(_0x21be45)await saveImportJson(_0x270389['report'],{'status':_0x2c00ca(0x208),..._0x58641d(),'message':_0x33b154[_0x2c00ca(0x1b6)]});throw _0x33b154;}finally{await _0x35eb07();}}
|
|
1
|
+
function a150_0x4d3f(){const _0x42f6f1=['.recovery','Excel\x20row\x20','isSafeInteger','runtimeDomain','checkpoint','.lock.recovery','schemaVersion','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','appCode','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','completed','auto-id-task-marker','imageFields','5XSRXOd','resume','size','undefined','METADATA','361350qUZqBO','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','Incomplete\x20readback.','maxBatchBytes','countryCode','2545250JAomqY','geolocation','batchSize','8517249hJZZjU','schemaFingerprint','ids','keys','Invalid\x20import\x20readback\x20response.','9QOCefe','entries','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','rowNumber','code','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','2995512uDIfnn','fileHash','longitude','EEXIST','2518096PZlESJ','has','add','some','isSymbolicLink','stringify','unsent','province','type','forEach','pending','.lock','country','sync','Invalid\x20import\x20batch\x20size.','districtAdcode','8UkmYHE','join','warnings','version','parse','resultCode','filter','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','datasetCode','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','strategy','object','ENOENT','source','209176bgEaMf','map','writeFile','now','rows','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','Import\x20lock\x20changed;\x20retry\x20recovery.','set','uploadFields','push','Cannot\x20read\x20the\x20import\x20checkpoint.','elapsedMs','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','emptyRows','errors','dingTalkUrl','byteLength','city','netType','values','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','fixed-negative-id','pois','status','binding','slice','get','utf8','latitude','report','every','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','pid','key','district','hex','name','string','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','actorId','message','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','streetNumber','importId','succeeded','length','Invalid\x20import\x20lock\x20owner.','catch','address','maxBatchSize','token','.tmp-','isArray','accuracy','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','kill','write','close','createUserId','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','road','createUserName','isInteger','schemaHash','6522411zkhSKH','readback','conflict','ESRCH','onCheckpointReady','includes'];a150_0x4d3f=function(){return _0x42f6f1;};return a150_0x4d3f();}const a150_0x4e0608=a150_0x4cfc;(function(_0x39bf98,_0x20a0f8){const _0x44c900=a150_0x4cfc,_0x712d55=_0x39bf98();while(!![]){try{const _0x180f46=parseInt(_0x44c900(0x1b2))/0x1+-parseInt(_0x44c900(0x1e7))/0x2*(-parseInt(_0x44c900(0x1bf))/0x3)+-parseInt(_0x44c900(0x1c9))/0x4*(-parseInt(_0x44c900(0x1ad))/0x5)+-parseInt(_0x44c900(0x1c5))/0x6+-parseInt(_0x44c900(0x19a))/0x7*(-parseInt(_0x44c900(0x1d9))/0x8)+-parseInt(_0x44c900(0x1ba))/0x9+-parseInt(_0x44c900(0x1b7))/0xa;if(_0x180f46===_0x20a0f8)break;else _0x712d55['push'](_0x712d55['shift']());}catch(_0x51efdf){_0x712d55['push'](_0x712d55['shift']());}}}(a150_0x4d3f,0x82ed1));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(_0x394c3f){const _0x295dac=a150_0x4cfc;if(Array[_0x295dac(0x18e)](_0x394c3f))return'['+_0x394c3f[_0x295dac(0x1e8)](canonical)[_0x295dac(0x1da)](',')+']';if(_0x394c3f&&typeof _0x394c3f==='object')return'{'+Object[_0x295dac(0x1bd)](_0x394c3f)['sort']()[_0x295dac(0x1e8)](_0x22eae4=>JSON['stringify'](_0x22eae4)+':'+canonical(_0x394c3f[_0x22eae4]))[_0x295dac(0x1da)](',')+'}';return JSON[_0x295dac(0x1ce)](_0x394c3f)??_0x295dac(0x1b0);}function a150_0x4cfc(_0x53eeda,_0x31b038){_0x53eeda=_0x53eeda-0x16a;const _0x4d3f36=a150_0x4d3f();let _0x4cfcf9=_0x4d3f36[_0x53eeda];return _0x4cfcf9;}const EMPTY_IMAGE_LOCATION_FIELDS=new Set(['time','operatorType',a150_0x4e0608(0x1d8),a150_0x4e0608(0x17c),a150_0x4e0608(0x170),a150_0x4e0608(0x196),a150_0x4e0608(0x1d5),a150_0x4e0608(0x1b6),a150_0x4e0608(0x1d0),a150_0x4e0608(0x176),a150_0x4e0608(0x16b),a150_0x4e0608(0x16c),a150_0x4e0608(0x1de),a150_0x4e0608(0x184),a150_0x4e0608(0x18f),a150_0x4e0608(0x1c7),'cityAdcode','errorMessage',a150_0x4e0608(0x18a),'lbswuaCacheId']);export function sameImportValue(_0xca2b7f,_0x828510,_0x385083=![]){const _0x2f00c3=a150_0x4e0608;if(_0x385083){const _0x3b4d60=_0x3a2dd0=>Array[_0x2f00c3(0x18e)](_0x3a2dd0)?_0x3a2dd0[_0x2f00c3(0x1e8)](_0x4dd48c=>{const _0x2f20c1=_0x2f00c3;if(!_0x4dd48c||typeof _0x4dd48c!==_0x2f20c1(0x1e4)||Array[_0x2f20c1(0x18e)](_0x4dd48c))return _0x4dd48c;const _0x37c652={..._0x4dd48c};delete _0x37c652['url'],delete _0x37c652['previewUrl'];if(_0x37c652[_0x2f20c1(0x1f6)]==='')delete _0x37c652[_0x2f20c1(0x1f6)];if(_0x37c652[_0x2f20c1(0x194)]==null)delete _0x37c652[_0x2f20c1(0x194)];if(_0x37c652[_0x2f20c1(0x197)]==null)delete _0x37c652[_0x2f20c1(0x197)];if(_0x37c652[_0x2f20c1(0x1b8)]==null||typeof _0x37c652[_0x2f20c1(0x1b8)]===_0x2f20c1(0x1e4)&&!Array[_0x2f20c1(0x18e)](_0x37c652['geolocation'])&&Object[_0x2f20c1(0x1c0)](_0x37c652[_0x2f20c1(0x1b8)])['every'](([_0x4033e8,_0x3adfd2])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x2f20c1(0x1ca)](_0x4033e8)&&_0x3adfd2===null))delete _0x37c652[_0x2f20c1(0x1b8)];for(const _0xc36131 of[_0x2f20c1(0x17e),_0x2f20c1(0x1d1),_0x2f20c1(0x17b)])if(!(_0xc36131 in _0x37c652))_0x37c652[_0xc36131]='';if(_0x37c652[_0x2f20c1(0x1af)]==null)_0x37c652[_0x2f20c1(0x1af)]=0x0;return _0x37c652;}):_0x3a2dd0;return canonical(_0x3b4d60(_0xca2b7f))===canonical(_0x3b4d60(_0x828510));}return _0xca2b7f===null?_0x828510===null||_0x828510===undefined:canonical(_0x828510)===canonical(_0xca2b7f);}async function rejectSymlink(_0x5516b6){const _0x38887c=a150_0x4e0608;try{if((await lstat(_0x5516b6))[_0x38887c(0x1cd)]())throw Error(_0x38887c(0x1f3));}catch(_0x48290f){if(_0x48290f['code']!==_0x38887c(0x1e5))throw _0x48290f;}}export async function resolveImportOutputPath(_0x425b12){return await rejectSymlink(_0x425b12),resolve(await realpath(dirname(resolve(_0x425b12))),basename(_0x425b12));}export function assertImportPaths(_0x149a40,_0xfd0edc,_0x5e1b6d=[]){const _0x4d2697=a150_0x4e0608,_0x30dc7a=[..._0x5e1b6d,_0x149a40,_0xfd0edc,_0x149a40+_0x4d2697(0x1d4),_0x149a40+_0x4d2697(0x1a5)][_0x4d2697(0x1e8)](_0x4c99df=>resolve(_0x4c99df));if(new Set(_0x30dc7a)[_0x4d2697(0x1af)]!==_0x30dc7a[_0x4d2697(0x187)])throw Error(_0x4d2697(0x183));}export async function saveImportJson(_0x49fce0,_0x9d37e0){const _0x4f9ca8=a150_0x4e0608;await rejectSymlink(_0x49fce0);const _0x199d0d=_0x49fce0+_0x4f9ca8(0x18d)+randomUUID(),_0x5426ae=await open(_0x199d0d,'wx',0x180);try{await _0x5426ae['writeFile'](JSON[_0x4f9ca8(0x1ce)](_0x9d37e0,null,0x2)),await _0x5426ae[_0x4f9ca8(0x1d6)]();}finally{await _0x5426ae[_0x4f9ca8(0x193)]();}try{await rename(_0x199d0d,_0x49fce0);}catch(_0x31977d){await unlink(_0x199d0d)[_0x4f9ca8(0x189)](()=>{});throw _0x31977d;}}export async function acquireLock(_0x116ba9){const _0x468831=a150_0x4e0608,_0x423b86=_0x116ba9+'.lock',_0xfac4ec=randomUUID();await rejectSymlink(_0x423b86);const _0x44cad5=_0x423b86+_0x468831(0x1a0);let _0x1eeb30,_0x407943;try{try{_0x1eeb30=await open(_0x423b86,'wx',0x180);}catch(_0x18da2b){if(_0x18da2b[_0x468831(0x1c3)]!==_0x468831(0x1c8))throw _0x18da2b;try{_0x407943=await open(_0x44cad5,'wx',0x180);}catch(_0x4d2424){if(_0x4d2424[_0x468831(0x1c3)]==='EEXIST')throw Error('Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.');throw _0x4d2424;}await _0x407943['writeFile'](JSON[_0x468831(0x1ce)]({'pid':process[_0x468831(0x17a)],'token':_0xfac4ec})),await _0x407943['sync'](),await rejectSymlink(_0x423b86);let _0xc8888e;try{_0xc8888e=await readFile(_0x423b86,_0x468831(0x175));}catch(_0x369f69){if(_0x369f69['code']!==_0x468831(0x1e5))throw _0x369f69;}if(_0xc8888e!==undefined){let _0x1ef145;try{_0x1ef145=JSON['parse'](_0xc8888e);}catch{throw Error(_0x468831(0x1e0));}if(!_0x1ef145||!Number['isSafeInteger'](_0x1ef145['pid'])||_0x1ef145[_0x468831(0x17a)]<=0x0)throw Error(_0x468831(0x188));try{process[_0x468831(0x191)](_0x1ef145[_0x468831(0x17a)],0x0);throw Error(_0x468831(0x180));}catch(_0x14dfed){if(_0x14dfed['code']!==_0x468831(0x19d))throw _0x14dfed;}if(await readFile(_0x423b86,_0x468831(0x175))!==_0xc8888e)throw Error(_0x468831(0x1ed));await unlink(_0x423b86);}_0x1eeb30=await open(_0x423b86,'wx',0x180);}await _0x1eeb30[_0x468831(0x1e9)](JSON[_0x468831(0x1ce)]({'pid':process[_0x468831(0x17a)],'token':_0xfac4ec})),await _0x1eeb30[_0x468831(0x1d6)]();}finally{try{await _0x1eeb30?.[_0x468831(0x193)]();}finally{if(_0x407943)try{await _0x407943[_0x468831(0x193)]();}finally{await unlink(_0x44cad5);}}}return async()=>{const _0x53ce66=_0x468831;if(JSON[_0x53ce66(0x1dd)](await readFile(_0x423b86,_0x53ce66(0x175)))[_0x53ce66(0x18c)]===_0xfac4ec)await unlink(_0x423b86);};}export function assertImportContract(_0x4847cc,_0x4cccbb,_0x5a074a){const _0x3a74d5=a150_0x4e0608;if(!_0x4847cc||!(_0x4847cc[_0x3a74d5(0x1a6)]===0x1&&_0x4847cc[_0x3a74d5(0x1e3)]===_0x3a74d5(0x16f)||_0x4847cc['schemaVersion']===0x2&&_0x4847cc['strategy']===_0x3a74d5(0x1ab))||_0x4847cc[_0x3a74d5(0x1e6)]!==_0x3a74d5(0x1b1)||_0x4847cc[_0x3a74d5(0x1a8)]!==_0x4cccbb||_0x4847cc[_0x3a74d5(0x1e1)]!==_0x5a074a||typeof _0x4847cc[_0x3a74d5(0x181)]!==_0x3a74d5(0x17f)||!_0x4847cc['actorId']||typeof _0x4847cc[_0x3a74d5(0x1bb)]!==_0x3a74d5(0x17f)||!_0x4847cc['schemaFingerprint']||!Number[_0x3a74d5(0x1a2)](_0x4847cc[_0x3a74d5(0x18b)])||_0x4847cc[_0x3a74d5(0x18b)]<0x1||_0x4847cc[_0x3a74d5(0x18b)]>0x3e8||!Number[_0x3a74d5(0x1a2)](_0x4847cc['maxBatchBytes'])||_0x4847cc[_0x3a74d5(0x1b5)]<0x1||_0x4847cc[_0x3a74d5(0x1b5)]>0x14*0x400*0x400)throw Error(_0x3a74d5(0x1c1));}export async function runExcelImport(_0x28021f){const _0x422d51=a150_0x4e0608;_0x28021f={..._0x28021f,'checkpoint':await resolveImportOutputPath(_0x28021f[_0x422d51(0x1a4)]),'report':await resolveImportOutputPath(_0x28021f[_0x422d51(0x177)])};const {manifest:_0xc3c33c,contract:_0x5b644d,api:_0x35f8b2}=_0x28021f;assertImportContract(_0x5b644d,_0x28021f['appCode'],_0x28021f[_0x422d51(0x1e1)]);if(_0x5b644d[_0x422d51(0x1a6)]!==0x1)throw Error(_0x422d51(0x1c4));if(_0xc3c33c[_0x422d51(0x1f5)][_0x422d51(0x187)])throw Error(_0x422d51(0x190));if(!_0xc3c33c[_0x422d51(0x1eb)]['length'])throw Error('Excel\x20contains\x20no\x20valid\x20data\x20rows.');if(!Number[_0x422d51(0x198)](_0x28021f[_0x422d51(0x1b9)])||_0x28021f[_0x422d51(0x1b9)]<0x1||_0x28021f['batchSize']>_0x5b644d['maxBatchSize'])throw Error(_0x422d51(0x1d7));for(const _0x291d95 of _0xc3c33c[_0x422d51(0x1eb)]){if(Buffer[_0x422d51(0x16a)](JSON[_0x422d51(0x1ce)]({'schemaFingerprint':_0x5b644d[_0x422d51(0x1bb)],'items':[{..._0x291d95['values'],'id':-0x1fffffffffffff}]}),'utf8')>_0x5b644d[_0x422d51(0x1b5)])throw Error(_0x422d51(0x1a1)+_0x291d95['rowNumber']+_0x422d51(0x1a7));}assertImportPaths(_0x28021f[_0x422d51(0x1a4)],_0x28021f[_0x422d51(0x177)]);const _0x30602e={'appCode':_0x28021f[_0x422d51(0x1a8)],'datasetCode':_0x28021f[_0x422d51(0x1e1)],'runtimeDomain':_0x28021f[_0x422d51(0x1a3)],'actorId':_0x5b644d[_0x422d51(0x181)],'fileHash':_0xc3c33c[_0x422d51(0x1c6)],'mappingHash':_0xc3c33c['mappingHash'],'schemaHash':_0xc3c33c[_0x422d51(0x199)],'remoteSchemaHash':_0x5b644d[_0x422d51(0x1bb)],'batchSize':_0x28021f[_0x422d51(0x1b9)],'sheet':_0xc3c33c['sheet']},_0x1a2321=await acquireLock(_0x28021f['checkpoint']);let _0x513449;const _0x3e1a7a=Date[_0x422d51(0x1ea)]();let _0x2a312e=0x0;const _0x2cca81=[],_0x15d110=()=>({'importId':_0x513449?.[_0x422d51(0x185)],'sourceRows':_0xc3c33c['rows']['length'],'emptyRows':_0xc3c33c[_0x422d51(0x1f4)][_0x422d51(0x187)],'succeeded':_0x513449?.[_0x422d51(0x1eb)][_0x422d51(0x1df)](_0x308316=>_0x308316['status']===_0x422d51(0x186))['length']??0x0,'unknown':_0x513449?.[_0x422d51(0x1eb)][_0x422d51(0x1df)](_0x185e35=>_0x185e35['status']===_0x422d51(0x1d3))['length']??0x0,'conflicts':_0x513449?.[_0x422d51(0x1eb)][_0x422d51(0x1df)](_0x7a4b22=>_0x7a4b22[_0x422d51(0x171)]===_0x422d51(0x19c))['length']??0x0,'notAttempted':_0x513449?.[_0x422d51(0x1eb)][_0x422d51(0x1df)](_0x5ccd9e=>_0x5ccd9e['status']===_0x422d51(0x1cf))[_0x422d51(0x187)]??_0xc3c33c[_0x422d51(0x1eb)][_0x422d51(0x187)],'batches':_0x2a312e,'batchResults':_0x2cca81,'elapsedMs':Date[_0x422d51(0x1ea)]()-_0x3e1a7a,'checkpoint':resolve(_0x28021f[_0x422d51(0x1a4)]),'report':resolve(_0x28021f[_0x422d51(0x177)]),'warnings':_0xc3c33c[_0x422d51(0x1db)]});try{await rejectSymlink(_0x28021f[_0x422d51(0x1a4)]);if(_0x28021f[_0x422d51(0x1ae)]){try{_0x513449=JSON['parse'](await readFile(_0x28021f['checkpoint'],_0x422d51(0x175)));}catch{throw Error(_0x422d51(0x1f1));}if(!_0x513449||_0x513449[_0x422d51(0x1dc)]!==0x1||typeof _0x513449[_0x422d51(0x185)]!==_0x422d51(0x17f)||canonical(_0x513449[_0x422d51(0x172)])!==canonical(_0x30602e)||!Array['isArray'](_0x513449[_0x422d51(0x1eb)])||_0x513449[_0x422d51(0x1eb)]['length']!==_0xc3c33c[_0x422d51(0x1eb)]['length']||new Set(_0x513449[_0x422d51(0x1eb)]['map'](_0x145dcd=>_0x145dcd['id']))['size']!==_0x513449[_0x422d51(0x1eb)][_0x422d51(0x187)]||_0x513449[_0x422d51(0x1eb)][_0x422d51(0x1cc)]((_0x463558,_0xe13a82)=>!Number[_0x422d51(0x1a2)](_0x463558['id'])||_0x463558['id']>=0x0||_0x463558[_0x422d51(0x1c2)]!==_0xc3c33c['rows'][_0xe13a82][_0x422d51(0x1c2)]||![_0x422d51(0x1cf),'pending',_0x422d51(0x186),'conflict'][_0x422d51(0x19f)](_0x463558[_0x422d51(0x171)])))throw Error(_0x422d51(0x1ec));}else{try{await lstat(_0x28021f[_0x422d51(0x1a4)]);throw Error(_0x422d51(0x179));}catch(_0x1cb3fe){if(_0x1cb3fe[_0x422d51(0x1c3)]!=='ENOENT')throw _0x1cb3fe;}const _0x77473f=new Set();_0x513449={'version':0x1,'importId':randomUUID(),'binding':_0x30602e,'rows':_0xc3c33c[_0x422d51(0x1eb)][_0x422d51(0x1e8)](_0x33df61=>{const _0x5a71be=_0x422d51;let _0x5d8bd0;do{_0x5d8bd0=-(Number(BigInt('0x'+randomBytes(0x7)['toString'](_0x5a71be(0x17d)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x77473f[_0x5a71be(0x1ca)](_0x5d8bd0));return _0x77473f[_0x5a71be(0x1cb)](_0x5d8bd0),{'id':_0x5d8bd0,'rowNumber':_0x33df61[_0x5a71be(0x1c2)],'status':'unsent'};})},await saveImportJson(_0x28021f[_0x422d51(0x1a4)],_0x513449);}await _0x28021f[_0x422d51(0x19e)]?.();const _0x1e078e=_0x513449;if(_0x1e078e[_0x422d51(0x1eb)][_0x422d51(0x1cc)](_0x32b80a=>_0x32b80a[_0x422d51(0x171)]==='conflict'))throw Error('Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.');const _0x2af641=async _0x5b7e75=>{const _0x1466b3=_0x422d51,_0x33121a=await _0x35f8b2['readback'](_0x5b7e75[_0x1466b3(0x1e8)](_0xe94cf5=>_0x1e078e[_0x1466b3(0x1eb)][_0xe94cf5]['id']));if(!Array[_0x1466b3(0x18e)](_0x33121a))throw Error('Invalid\x20import\x20readback\x20response.');const _0x105b4d=new Set(_0x5b7e75[_0x1466b3(0x1e8)](_0x4d41fb=>_0x1e078e[_0x1466b3(0x1eb)][_0x4d41fb]['id'])),_0x1743ac=new Map();for(const _0x80fa47 of _0x33121a){const _0x281eff=Number(_0x80fa47?.['id']);if(!_0x105b4d[_0x1466b3(0x1ca)](_0x281eff)||_0x1743ac[_0x1466b3(0x1ca)](_0x281eff))throw Error(_0x1466b3(0x1b3));_0x1743ac[_0x1466b3(0x1ee)](_0x281eff,_0x80fa47);}for(const _0x4a076d of _0x5b7e75){const _0x142aa7=_0x1743ac[_0x1466b3(0x174)](_0x1e078e['rows'][_0x4a076d]['id']);if(!_0x142aa7)continue;if(_0x1e078e['rows'][_0x4a076d]['status']===_0x1466b3(0x1cf)){_0x1e078e[_0x1466b3(0x1eb)][_0x4a076d][_0x1466b3(0x171)]=_0x1466b3(0x19c),await saveImportJson(_0x28021f[_0x1466b3(0x1a4)],_0x1e078e);throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}const _0x40497b=_0xc3c33c['rows'][_0x4a076d][_0x1466b3(0x16d)];if(Object['keys'](_0x40497b)[_0x1466b3(0x1cc)](_0x5c2467=>!sameImportValue(_0x40497b[_0x5c2467],_0x142aa7[_0x5c2467],_0xc3c33c[_0x1466b3(0x1ac)]?.[_0x1466b3(0x19f)](_0x5c2467)&&!_0xc3c33c[_0x1466b3(0x1ef)]?.[_0x1466b3(0x19f)](_0x5c2467)))){_0x1e078e[_0x1466b3(0x1eb)][_0x4a076d]['status']=_0x1466b3(0x19c),await saveImportJson(_0x28021f[_0x1466b3(0x1a4)],_0x1e078e);throw Error(_0x1466b3(0x16e)+_0x1e078e[_0x1466b3(0x1eb)][_0x4a076d][_0x1466b3(0x1c2)]+'.');}_0x1e078e[_0x1466b3(0x1eb)][_0x4a076d][_0x1466b3(0x171)]=_0x1466b3(0x186);}return await saveImportJson(_0x28021f['checkpoint'],_0x1e078e),_0x1743ac;};if(_0x28021f[_0x422d51(0x1ae)])for(let _0x46a20d=0x0;_0x46a20d<_0x1e078e[_0x422d51(0x1eb)][_0x422d51(0x187)];_0x46a20d+=_0x28021f[_0x422d51(0x1b9)]){const _0x5cdaf9=_0x1e078e['rows'][_0x422d51(0x173)](_0x46a20d,_0x46a20d+_0x28021f['batchSize'])['map']((_0x46dc15,_0x3f715c)=>_0x46a20d+_0x3f715c),_0x3d5bed=_0x5cdaf9[_0x422d51(0x1df)](_0xd54192=>_0x1e078e[_0x422d51(0x1eb)][_0xd54192]['status']===_0x422d51(0x186)),_0xde72d6=await _0x2af641(_0x5cdaf9),_0x3accbd=_0x3d5bed[_0x422d51(0x1df)](_0x503259=>!_0xde72d6['has'](_0x1e078e[_0x422d51(0x1eb)][_0x503259]['id']));if(_0x3accbd[_0x422d51(0x187)]){_0x3accbd['forEach'](_0x14d939=>{const _0x35c8f2=_0x422d51;_0x1e078e['rows'][_0x14d939][_0x35c8f2(0x171)]=_0x35c8f2(0x19c);}),await saveImportJson(_0x28021f['checkpoint'],_0x1e078e);throw Error(_0x422d51(0x1e2));}}for(let _0x56327a=0x0;_0x56327a<_0x1e078e['rows'][_0x422d51(0x187)];){const _0x5f3eb4=[],_0x250749=[];while(_0x56327a<_0x1e078e[_0x422d51(0x1eb)]['length']&&_0x250749[_0x422d51(0x187)]<_0x28021f[_0x422d51(0x1b9)]){const _0x56cedb=_0x56327a++;if(_0x1e078e['rows'][_0x56cedb]['status']===_0x422d51(0x186))continue;const _0x473864={..._0xc3c33c[_0x422d51(0x1eb)][_0x56cedb]['values'],'id':_0x1e078e[_0x422d51(0x1eb)][_0x56cedb]['id']};if(Buffer[_0x422d51(0x16a)](JSON[_0x422d51(0x1ce)]({'schemaFingerprint':_0x5b644d[_0x422d51(0x1bb)],'items':[..._0x250749,_0x473864]}),_0x422d51(0x175))>_0x5b644d[_0x422d51(0x1b5)]){if(!_0x250749['length'])throw Error('Excel\x20row\x20'+_0x1e078e['rows'][_0x56cedb][_0x422d51(0x1c2)]+_0x422d51(0x1a7));_0x56327a--;break;}_0x5f3eb4[_0x422d51(0x1f0)](_0x56cedb),_0x250749[_0x422d51(0x1f0)](_0x473864);}if(!_0x250749[_0x422d51(0x187)])continue;const _0x8cb9b8=_0x5f3eb4[_0x422d51(0x1df)](_0x557b06=>_0x1e078e['rows'][_0x557b06][_0x422d51(0x171)]===_0x422d51(0x1cf));if(_0x8cb9b8[_0x422d51(0x187)]){const _0x4d8ff1=await _0x35f8b2[_0x422d51(0x19b)](_0x8cb9b8[_0x422d51(0x1e8)](_0x3626ff=>_0x1e078e[_0x422d51(0x1eb)][_0x3626ff]['id']));if(!Array[_0x422d51(0x18e)](_0x4d8ff1))throw Error(_0x422d51(0x1be));if(_0x4d8ff1[_0x422d51(0x187)])throw Error(_0x422d51(0x1a9));}_0x5f3eb4[_0x422d51(0x1d2)](_0x428ceb=>{const _0x1991d3=_0x422d51;_0x1e078e[_0x1991d3(0x1eb)][_0x428ceb][_0x1991d3(0x171)]=_0x1991d3(0x1d3);}),await saveImportJson(_0x28021f[_0x422d51(0x1a4)],_0x1e078e),_0x2a312e++;const _0x42b8a8=Date[_0x422d51(0x1ea)](),_0x3411d6={'batch':_0x2a312e,'rowStart':_0x1e078e[_0x422d51(0x1eb)][_0x5f3eb4[0x0]]['rowNumber'],'rowEnd':_0x1e078e[_0x422d51(0x1eb)][_0x5f3eb4[_0x5f3eb4[_0x422d51(0x187)]-0x1]][_0x422d51(0x1c2)],'count':_0x250749[_0x422d51(0x187)],'bytes':Buffer['byteLength'](JSON[_0x422d51(0x1ce)]({'schemaFingerprint':_0x5b644d[_0x422d51(0x1bb)],'items':_0x250749}),_0x422d51(0x175)),'elapsedMs':0x0,'status':'unknown'};_0x2cca81['push'](_0x3411d6);try{const _0x525d1d=await _0x35f8b2[_0x422d51(0x192)](_0x250749);if(!_0x525d1d||_0x525d1d['count']!==_0x250749[_0x422d51(0x187)]||!Array[_0x422d51(0x18e)](_0x525d1d[_0x422d51(0x1bc)])||_0x525d1d[_0x422d51(0x1bc)][_0x422d51(0x187)]!==_0x250749[_0x422d51(0x187)]||_0x525d1d['ids'][_0x422d51(0x1cc)]((_0x2835c7,_0x107806)=>Number(_0x2835c7)!==_0x1e078e[_0x422d51(0x1eb)][_0x5f3eb4[_0x107806]]['id']))throw Error('Invalid\x20write\x20result.');await _0x2af641(_0x5f3eb4);if(_0x5f3eb4[_0x422d51(0x1cc)](_0x525ef1=>_0x1e078e['rows'][_0x525ef1]['status']!==_0x422d51(0x186)))throw Error(_0x422d51(0x1b4));}catch(_0x7a7d7d){if(_0x1e078e[_0x422d51(0x1eb)]['some'](_0x4824e7=>_0x4824e7['status']==='conflict'))throw _0x7a7d7d;try{await _0x2af641(_0x5f3eb4);}catch(_0x129769){if(_0x1e078e[_0x422d51(0x1eb)]['some'](_0x5332d6=>_0x5332d6[_0x422d51(0x171)]===_0x422d51(0x19c)))throw _0x129769;}if(_0x5f3eb4[_0x422d51(0x1cc)](_0x13a397=>_0x1e078e['rows'][_0x13a397][_0x422d51(0x171)]!==_0x422d51(0x186)))throw Error(_0x422d51(0x195));}finally{_0x3411d6[_0x422d51(0x1f2)]=Date[_0x422d51(0x1ea)]()-_0x42b8a8;if(_0x5f3eb4[_0x422d51(0x178)](_0x8542f3=>_0x1e078e['rows'][_0x8542f3][_0x422d51(0x171)]===_0x422d51(0x186)))_0x3411d6[_0x422d51(0x171)]=_0x422d51(0x186);else{if(_0x5f3eb4['some'](_0x4f912b=>_0x1e078e[_0x422d51(0x1eb)][_0x4f912b][_0x422d51(0x171)]==='conflict'))_0x3411d6[_0x422d51(0x171)]=_0x422d51(0x19c);}}}const _0x206e93={'status':_0x422d51(0x1aa),..._0x15d110()};return await saveImportJson(_0x28021f['report'],_0x206e93),_0x206e93;}catch(_0x78f6b4){if(_0x513449)await saveImportJson(_0x28021f['report'],{'status':'incomplete',..._0x15d110(),'message':_0x78f6b4[_0x422d51(0x182)]});throw _0x78f6b4;}finally{await _0x1a2321();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a152_0x5eaafb=a152_0x2b09;(function(_0x239603,_0x41f45e){const _0x437c7e=a152_0x2b09,_0x4f5899=_0x239603();while(!![]){try{const _0x447c29=-parseInt(_0x437c7e(0x13a))/0x1*(parseInt(_0x437c7e(0x13d))/0x2)+parseInt(_0x437c7e(0x12e))/0x3+-parseInt(_0x437c7e(0x14f))/0x4*(-parseInt(_0x437c7e(0x142))/0x5)+-parseInt(_0x437c7e(0x143))/0x6+-parseInt(_0x437c7e(0x12a))/0x7*(-parseInt(_0x437c7e(0x122))/0x8)+parseInt(_0x437c7e(0x14b))/0x9*(parseInt(_0x437c7e(0x119))/0xa)+-parseInt(_0x437c7e(0x157))/0xb*(-parseInt(_0x437c7e(0x14a))/0xc);if(_0x447c29===_0x41f45e)break;else _0x4f5899['push'](_0x4f5899['shift']());}catch(_0x4f3886){_0x4f5899['push'](_0x4f5899['shift']());}}}(a152_0x32cb,0xa7884));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a152_0x32cb(){const _0x51d86a=['811090GTHRoE','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','flatMap','home','packageVersion','status','path','match','count','1096912HwlJxK','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','lovrabet','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','unverifiable','missing','skills@latest\x20exited\x20','sort','14JcMmPF','manifest','parse','join','156183MjLIjW','split','installedPath','lovrabet-skills','isFile','packageRoot','update','lovrabet.manifest.json','isSymbolicLink','partialFailure','length','SKILL.md','1IWaGbh','utf8','current','50730UjFGer','pipe','includes',':\x5cs*(.+)$','\x20verified;\x20','97885AIkbDQ','6243594nPMIJB','message','log','digest','trim','state','reason','14492868vqdKHH','9rkNnGs','absent','every','skills','28QoPFeq','content_mismatch','package.json','skillVersion','root','version_mismatch','files','sha256','11jYpDRo','startsWith','error','Unsupported\x20Skill\x20entry:\x20','name','isDirectory','version','present','unknown','SOURCE_INVALID','output'];a152_0x32cb=function(){return _0x51d86a;};return a152_0x32cb();}function a152_0x2b09(_0x3fb935,_0x3b860c){_0x3fb935=_0x3fb935-0x118;const _0x32cbfc=a152_0x32cb();let _0x2b0951=_0x32cbfc[_0x3fb935];return _0x2b0951;}const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME=a152_0x5eaafb(0x124),debug=debuglog(a152_0x5eaafb(0x131));function frontmatterValue(_0x3336bf,_0x29392d){const _0x15d574=a152_0x5eaafb;return _0x3336bf[_0x15d574(0x120)](new RegExp('^'+_0x29392d+_0x15d574(0x140),'m'))?.[0x1]?.[_0x15d574(0x147)]()??'';}function listFiles(_0x1291ed,_0x11a57c=_0x1291ed){const _0x5d6278=a152_0x5eaafb;return readdirSync(_0x11a57c,{'withFileTypes':!![]})[_0x5d6278(0x11b)](_0x3582d4=>{const _0x86e34e=_0x5d6278,_0x32d4a1=join(_0x11a57c,_0x3582d4[_0x86e34e(0x15b)]),_0x148b85=lstatSync(_0x32d4a1);if(_0x148b85[_0x86e34e(0x136)]())throw new Error('Symbolic\x20link\x20is\x20not\x20allowed:\x20'+_0x32d4a1);if(_0x148b85[_0x86e34e(0x15c)]())return listFiles(_0x1291ed,_0x32d4a1);if(!_0x148b85[_0x86e34e(0x132)]())throw new Error(_0x86e34e(0x15a)+_0x32d4a1);return[relative(_0x1291ed,_0x32d4a1)[_0x86e34e(0x12f)](sep)[_0x86e34e(0x12d)]('/')];})[_0x5d6278(0x129)]((_0x13f338,_0x50dc20)=>_0x13f338<_0x50dc20?-0x1:_0x13f338>_0x50dc20?0x1:0x0);}function digestFiles(_0x136df0,_0x871ec8){const _0x10f56e=a152_0x5eaafb,_0x43867e=createHash(_0x10f56e(0x156));for(const _0x29b301 of _0x871ec8){if(_0x29b301[_0x10f56e(0x158)]('/')||_0x29b301['split']('/')['includes']('..')||_0x29b301[_0x10f56e(0x13f)]('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x29b301);_0x43867e[_0x10f56e(0x134)](_0x29b301),_0x43867e[_0x10f56e(0x134)]('\x00'),_0x43867e[_0x10f56e(0x134)](readFileSync(join(_0x136df0,..._0x29b301[_0x10f56e(0x12f)]('/')))),_0x43867e['update']('\x00');}return _0x43867e[_0x10f56e(0x146)]('hex');}function sameFiles(_0x531a67,_0x312f5b){const _0x4989d1=a152_0x5eaafb;return _0x531a67[_0x4989d1(0x138)]===_0x312f5b['length']&&_0x531a67[_0x4989d1(0x14d)]((_0x1e18e1,_0x344d8f)=>_0x1e18e1===_0x312f5b[_0x344d8f]);}function readSource(_0x5495ed){const _0x242b45=a152_0x5eaafb,_0x3792f8=JSON['parse'](readFileSync(join(_0x5495ed,_0x242b45(0x151)),'utf8')),_0x1bdb5d=JSON[_0x242b45(0x12c)](readFileSync(join(_0x5495ed,'skills',_0x242b45(0x135)),_0x242b45(0x13b))),_0x25208e=join(_0x5495ed,_0x242b45(0x14e),SKILL_NAME),_0x3733ef=frontmatterValue(readFileSync(join(_0x25208e,'SKILL.md'),_0x242b45(0x13b)),_0x242b45(0x15d)),_0x5d5f42=listFiles(_0x25208e);if(_0x1bdb5d['schemaVersion']!==0x1||_0x1bdb5d[_0x242b45(0x15b)]!==SKILL_NAME||!_0x3792f8['version']||_0x1bdb5d[_0x242b45(0x11d)]!==_0x3792f8[_0x242b45(0x15d)]||_0x1bdb5d[_0x242b45(0x152)]!==_0x3792f8[_0x242b45(0x15d)]||_0x3733ef!==_0x3792f8[_0x242b45(0x15d)]||!sameFiles(_0x5d5f42,_0x1bdb5d['files'])||digestFiles(_0x25208e,_0x5d5f42)!==_0x1bdb5d[_0x242b45(0x146)])throw new Error(_0x242b45(0x123));return{'packageVersion':_0x3792f8[_0x242b45(0x15d)],'skillVersion':_0x3733ef,'root':_0x25208e,'manifest':_0x1bdb5d};}function installedSkillPath(_0x1b0359){const _0x281a5a=a152_0x5eaafb,_0x14d536=resolveInstalledSkill(SKILL_NAME,{'home':_0x1b0359});if(_0x14d536[_0x281a5a(0x148)]==='present')return{'state':_0x281a5a(0x15e),'path':dirname(_0x14d536[_0x281a5a(0x11f)])};if(_0x14d536[_0x281a5a(0x148)]===_0x281a5a(0x14c))return{'state':'missing'};return{'state':_0x281a5a(0x126),'reason':_0x14d536['reason']};}export function inspectInstalledBuiltinSkillVersion(_0x3ce8a5,_0x2ac8a9={}){const _0x284875=a152_0x5eaafb,_0x2e63b7=installedSkillPath(_0x2ac8a9[_0x284875(0x11c)]??homedir());if(_0x2e63b7[_0x284875(0x148)]===_0x284875(0x127))return{'state':'missing','expectedVersion':_0x3ce8a5,'repairCommand':REPAIR_COMMAND};if(_0x2e63b7[_0x284875(0x148)]===_0x284875(0x126))return{'state':_0x284875(0x126),'expectedVersion':_0x3ce8a5,'reason':_0x2e63b7[_0x284875(0x149)],'repairCommand':REPAIR_COMMAND};try{const _0x20a740=frontmatterValue(readFileSync(join(_0x2e63b7[_0x284875(0x11f)],'SKILL.md'),'utf8'),_0x284875(0x15d));return{'state':_0x20a740===_0x3ce8a5?_0x284875(0x13c):_0x284875(0x154),'expectedVersion':_0x3ce8a5,'skillVersion':_0x20a740,'installedPath':_0x2e63b7[_0x284875(0x11f)],'repairCommand':REPAIR_COMMAND};}catch(_0xae093){return{'state':_0x284875(0x126),'expectedVersion':_0x3ce8a5,'installedPath':_0x2e63b7[_0x284875(0x11f)],'reason':_0xae093 instanceof Error?_0xae093['message']:String(_0xae093),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x4f152f={}){const _0x45bd1e=a152_0x5eaafb,_0x34d284=_0x4f152f[_0x45bd1e(0x133)]??DEFAULT_PACKAGE_ROOT;let _0x3d346e;try{_0x3d346e=readSource(_0x34d284);}catch(_0x3e8a0b){return{'state':_0x45bd1e(0x126),'packageVersion':'unknown','reason':_0x3e8a0b instanceof Error?_0x3e8a0b[_0x45bd1e(0x144)]:String(_0x3e8a0b),'repairCommand':REPAIR_COMMAND};}const _0x324522=installedSkillPath(_0x4f152f[_0x45bd1e(0x11c)]??homedir());if(_0x324522[_0x45bd1e(0x148)]==='missing')return{'state':_0x45bd1e(0x127),'packageVersion':_0x3d346e['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x324522[_0x45bd1e(0x148)]==='unverifiable')return{'state':_0x45bd1e(0x126),'packageVersion':_0x3d346e[_0x45bd1e(0x11d)],'reason':_0x324522[_0x45bd1e(0x149)],'repairCommand':REPAIR_COMMAND};try{const _0x3d465d=frontmatterValue(readFileSync(join(_0x324522[_0x45bd1e(0x11f)],_0x45bd1e(0x139)),'utf8'),_0x45bd1e(0x15d));if(_0x3d465d!==_0x3d346e[_0x45bd1e(0x152)])return{'state':'version_mismatch','packageVersion':_0x3d346e['packageVersion'],'skillVersion':_0x3d465d,'installedPath':_0x324522[_0x45bd1e(0x11f)],'repairCommand':REPAIR_COMMAND};const _0x25ec98=listFiles(_0x324522[_0x45bd1e(0x11f)]),_0x52fde7=digestFiles(_0x324522[_0x45bd1e(0x11f)],_0x25ec98);return{'state':sameFiles(_0x25ec98,_0x3d346e[_0x45bd1e(0x12b)][_0x45bd1e(0x155)])&&_0x52fde7===_0x3d346e['manifest'][_0x45bd1e(0x146)]?_0x45bd1e(0x13c):_0x45bd1e(0x150),'packageVersion':_0x3d346e[_0x45bd1e(0x11d)],'skillVersion':_0x3d465d,'installedPath':_0x324522[_0x45bd1e(0x11f)],'digest':_0x52fde7,'repairCommand':REPAIR_COMMAND};}catch(_0x2b0b75){return{'state':_0x45bd1e(0x126),'packageVersion':_0x3d346e[_0x45bd1e(0x11d)],'installedPath':_0x324522[_0x45bd1e(0x11f)],'reason':_0x2b0b75 instanceof Error?_0x2b0b75[_0x45bd1e(0x144)]:String(_0x2b0b75),'repairCommand':REPAIR_COMMAND};}}function failure(_0xf10407,_0x433f32,_0xdc5e47,_0xc56285){const _0x1202bd=a152_0x5eaafb;return{'ok':![],'code':_0xf10407,'packageVersion':_0x433f32[_0x1202bd(0x11d)],'skillVersion':_0x433f32[_0x1202bd(0x152)],'installedPath':_0xc56285,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0xdc5e47 instanceof Error?_0xdc5e47['message']:String(_0xdc5e47)};}export function installBuiltinSkill(_0x427093={}){const _0x8d19a4=a152_0x5eaafb,_0xa063eb=_0x427093['packageRoot']??DEFAULT_PACKAGE_ROOT,_0x1ac64d=_0x427093[_0x8d19a4(0x11c)]??homedir();let _0x267ddd;try{_0x267ddd=readSource(_0xa063eb);}catch(_0x4ae896){return failure(_0x8d19a4(0x160),{'packageVersion':_0x8d19a4(0x15f),'skillVersion':_0x8d19a4(0x15f)},_0x4ae896);}const _0x18818d=inspectBuiltinSkill({'packageRoot':_0xa063eb,'home':_0x1ac64d}),_0x48c9e8=runNpxSkillsAddGlobal(_0xa063eb,_0x267ddd[_0x8d19a4(0x153)],{'stdio':_0x427093['stdio']??_0x8d19a4(0x13e),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x1ac64d}});if(_0x48c9e8['skipped'])return{'ok':!![],'packageVersion':_0x267ddd[_0x8d19a4(0x11d)],'skillVersion':_0x267ddd['skillVersion'],'installedPath':_0x18818d[_0x8d19a4(0x130)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x48c9e8['ok'])return failure('INSTALL_FAILED',_0x267ddd,_0x48c9e8[_0x8d19a4(0x159)]??_0x8d19a4(0x128)+_0x48c9e8[_0x8d19a4(0x11e)]);const _0x3500f7=inspectBuiltinSkill({'packageRoot':_0xa063eb,'home':_0x1ac64d});if(_0x3500f7['state']!=='current'){const _0x243c78=_0x3500f7['reason']??'Installed\x20Skill\x20state\x20is\x20'+_0x3500f7[_0x8d19a4(0x148)];return failure('VERIFY_FAILED',_0x267ddd,_0x48c9e8[_0x8d19a4(0x137)]?_0x243c78+'\x0a'+_0x48c9e8[_0x8d19a4(0x137)][_0x8d19a4(0x118)]:_0x243c78,_0x3500f7['installedPath']);}return _0x48c9e8['partialFailure']&&(debug(_0x8d19a4(0x125),_0x48c9e8[_0x8d19a4(0x137)]['output']),console[_0x8d19a4(0x145)]('CLI\x20Built-in\x20Skill\x20'+_0x267ddd['skillVersion']+_0x8d19a4(0x141)+_0x48c9e8[_0x8d19a4(0x137)][_0x8d19a4(0x121)]+_0x8d19a4(0x11a))),{'ok':!![],'packageVersion':_0x267ddd['packageVersion'],'skillVersion':_0x267ddd[_0x8d19a4(0x152)],'installedPath':_0x3500f7[_0x8d19a4(0x130)],'changed':_0x18818d[_0x8d19a4(0x148)]!==_0x8d19a4(0x13c),'repairCommand':REPAIR_COMMAND};}
|
|
1
|
+
const a152_0xafdf57=a152_0x3c08;(function(_0x25db33,_0x2970a0){const _0x286b2c=a152_0x3c08,_0x53ec9a=_0x25db33();while(!![]){try{const _0x4e6132=parseInt(_0x286b2c(0x164))/0x1*(parseInt(_0x286b2c(0x138))/0x2)+-parseInt(_0x286b2c(0x135))/0x3+parseInt(_0x286b2c(0x149))/0x4+-parseInt(_0x286b2c(0x12f))/0x5*(-parseInt(_0x286b2c(0x167))/0x6)+-parseInt(_0x286b2c(0x140))/0x7*(-parseInt(_0x286b2c(0x14d))/0x8)+-parseInt(_0x286b2c(0x146))/0x9+parseInt(_0x286b2c(0x16d))/0xa;if(_0x4e6132===_0x2970a0)break;else _0x53ec9a['push'](_0x53ec9a['shift']());}catch(_0x473f9b){_0x53ec9a['push'](_0x53ec9a['shift']());}}}(a152_0x56b8,0x67b92));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a152_0xafdf57(0x16a),SKILL_NAME=a152_0xafdf57(0x153),debug=debuglog(a152_0xafdf57(0x15b));function frontmatterValue(_0x4dd79b,_0xa23350){const _0x4d1c82=a152_0xafdf57;return _0x4dd79b[_0x4d1c82(0x152)](new RegExp('^'+_0xa23350+_0x4d1c82(0x12e),'m'))?.[0x1]?.['trim']()??'';}function listFiles(_0x5c2255,_0x35e083=_0x5c2255){const _0x4a08c7=a152_0xafdf57;return readdirSync(_0x35e083,{'withFileTypes':!![]})[_0x4a08c7(0x14b)](_0x16f69e=>{const _0x64689e=_0x4a08c7,_0x285791=join(_0x35e083,_0x16f69e[_0x64689e(0x132)]),_0x1edee8=lstatSync(_0x285791);if(_0x1edee8['isSymbolicLink']())throw new Error('Symbolic\x20link\x20is\x20not\x20allowed:\x20'+_0x285791);if(_0x1edee8[_0x64689e(0x144)]())return listFiles(_0x5c2255,_0x285791);if(!_0x1edee8['isFile']())throw new Error(_0x64689e(0x150)+_0x285791);return[relative(_0x5c2255,_0x285791)['split'](sep)[_0x64689e(0x159)]('/')];})[_0x4a08c7(0x163)]((_0x2cfdc4,_0x400e41)=>_0x2cfdc4<_0x400e41?-0x1:_0x2cfdc4>_0x400e41?0x1:0x0);}function a152_0x3c08(_0x14b232,_0x4c5ac3){_0x14b232=_0x14b232-0x12e;const _0x56b8c7=a152_0x56b8();let _0x3c08f6=_0x56b8c7[_0x14b232];return _0x3c08f6;}function digestFiles(_0x54c2d0,_0x3aae5a){const _0x13c728=a152_0xafdf57,_0x44a5e6=createHash(_0x13c728(0x168));for(const _0x486036 of _0x3aae5a){if(_0x486036['startsWith']('/')||_0x486036[_0x13c728(0x148)]('/')['includes']('..')||_0x486036[_0x13c728(0x151)]('\x5c'))throw new Error(_0x13c728(0x13f)+_0x486036);_0x44a5e6[_0x13c728(0x15c)](_0x486036),_0x44a5e6[_0x13c728(0x15c)]('\x00'),_0x44a5e6[_0x13c728(0x15c)](readFileSync(join(_0x54c2d0,..._0x486036[_0x13c728(0x148)]('/')))),_0x44a5e6[_0x13c728(0x15c)]('\x00');}return _0x44a5e6[_0x13c728(0x166)](_0x13c728(0x13a));}function sameFiles(_0xd36044,_0x58309b){const _0x410d95=a152_0xafdf57;return _0xd36044[_0x410d95(0x16f)]===_0x58309b[_0x410d95(0x16f)]&&_0xd36044[_0x410d95(0x170)]((_0x454052,_0x3b58ee)=>_0x454052===_0x58309b[_0x3b58ee]);}function readSource(_0x5b47f5){const _0x5c4ab0=a152_0xafdf57,_0xe74ca2=JSON[_0x5c4ab0(0x13e)](readFileSync(join(_0x5b47f5,_0x5c4ab0(0x154)),_0x5c4ab0(0x130))),_0x512c6e=JSON[_0x5c4ab0(0x13e)](readFileSync(join(_0x5b47f5,'skills',_0x5c4ab0(0x160)),_0x5c4ab0(0x130))),_0x3a6109=join(_0x5b47f5,_0x5c4ab0(0x141),SKILL_NAME),_0x5cc3c0=frontmatterValue(readFileSync(join(_0x3a6109,_0x5c4ab0(0x143)),_0x5c4ab0(0x130)),'version'),_0x4fb956=listFiles(_0x3a6109);if(_0x512c6e[_0x5c4ab0(0x169)]!==0x1||_0x512c6e[_0x5c4ab0(0x132)]!==SKILL_NAME||!_0xe74ca2['version']||_0x512c6e[_0x5c4ab0(0x155)]!==_0xe74ca2['version']||_0x512c6e[_0x5c4ab0(0x15f)]!==_0xe74ca2[_0x5c4ab0(0x131)]||_0x5cc3c0!==_0xe74ca2['version']||!sameFiles(_0x4fb956,_0x512c6e[_0x5c4ab0(0x175)])||digestFiles(_0x3a6109,_0x4fb956)!==_0x512c6e[_0x5c4ab0(0x166)])throw new Error(_0x5c4ab0(0x171));return{'packageVersion':_0xe74ca2[_0x5c4ab0(0x131)],'skillVersion':_0x5cc3c0,'root':_0x3a6109,'manifest':_0x512c6e};}function a152_0x56b8(){const _0x50ccf4=['current','skillVersion','lovrabet.manifest.json','home','content_mismatch','sort','161765TyxSBv','VERIFY_FAILED','digest','6mvWJIZ','sha256','schemaVersion','lovrabet\x20cli-skill\x20install','count','stdio','2094960oGMbKs','skipped','length','every','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','INSTALL_FAILED','packageRoot','skills@latest\x20exited\x20','files',':\x5cs*(.+)$','1542440MiUcKj','utf8','version','name','error','partialFailure','2136435FdPXzL','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','missing','4mbBBhm','Installed\x20Skill\x20state\x20is\x20','hex','path','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','message','parse','Unsafe\x20manifest\x20path:\x20','3129371GNhEBg','skills','unknown','SKILL.md','isDirectory','CLI\x20Built-in\x20Skill\x20','4197969WIFQVI','manifest','split','1259476bumDGJ','log','flatMap','installedPath','8atyiVc','version_mismatch','reason','Unsupported\x20Skill\x20entry:\x20','includes','match','lovrabet','package.json','packageVersion','present','\x20verified;\x20','root','join','state','lovrabet-skills','update','unverifiable'];a152_0x56b8=function(){return _0x50ccf4;};return a152_0x56b8();}function installedSkillPath(_0x374057){const _0x4ca96f=a152_0xafdf57,_0x1c34fc=resolveInstalledSkill(SKILL_NAME,{'home':_0x374057});if(_0x1c34fc['state']===_0x4ca96f(0x156))return{'state':_0x4ca96f(0x156),'path':dirname(_0x1c34fc[_0x4ca96f(0x13b)])};if(_0x1c34fc[_0x4ca96f(0x15a)]==='absent')return{'state':'missing'};return{'state':_0x4ca96f(0x15d),'reason':_0x1c34fc[_0x4ca96f(0x14f)]};}export function inspectInstalledBuiltinSkillVersion(_0x229446,_0x11806a={}){const _0x38db2e=a152_0xafdf57,_0x44ec2b=installedSkillPath(_0x11806a[_0x38db2e(0x161)]??homedir());if(_0x44ec2b[_0x38db2e(0x15a)]==='missing')return{'state':_0x38db2e(0x137),'expectedVersion':_0x229446,'repairCommand':REPAIR_COMMAND};if(_0x44ec2b['state']===_0x38db2e(0x15d))return{'state':'unverifiable','expectedVersion':_0x229446,'reason':_0x44ec2b[_0x38db2e(0x14f)],'repairCommand':REPAIR_COMMAND};try{const _0x35ef5e=frontmatterValue(readFileSync(join(_0x44ec2b['path'],_0x38db2e(0x143)),_0x38db2e(0x130)),_0x38db2e(0x131));return{'state':_0x35ef5e===_0x229446?_0x38db2e(0x15e):_0x38db2e(0x14e),'expectedVersion':_0x229446,'skillVersion':_0x35ef5e,'installedPath':_0x44ec2b[_0x38db2e(0x13b)],'repairCommand':REPAIR_COMMAND};}catch(_0x3e3a4f){return{'state':'unverifiable','expectedVersion':_0x229446,'installedPath':_0x44ec2b['path'],'reason':_0x3e3a4f instanceof Error?_0x3e3a4f[_0x38db2e(0x13d)]:String(_0x3e3a4f),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x3da974={}){const _0x48d1bf=a152_0xafdf57,_0x441afe=_0x3da974[_0x48d1bf(0x173)]??DEFAULT_PACKAGE_ROOT;let _0x560e75;try{_0x560e75=readSource(_0x441afe);}catch(_0x172465){return{'state':_0x48d1bf(0x15d),'packageVersion':_0x48d1bf(0x142),'reason':_0x172465 instanceof Error?_0x172465[_0x48d1bf(0x13d)]:String(_0x172465),'repairCommand':REPAIR_COMMAND};}const _0xbe9009=installedSkillPath(_0x3da974[_0x48d1bf(0x161)]??homedir());if(_0xbe9009[_0x48d1bf(0x15a)]===_0x48d1bf(0x137))return{'state':_0x48d1bf(0x137),'packageVersion':_0x560e75[_0x48d1bf(0x155)],'repairCommand':REPAIR_COMMAND};if(_0xbe9009[_0x48d1bf(0x15a)]===_0x48d1bf(0x15d))return{'state':_0x48d1bf(0x15d),'packageVersion':_0x560e75[_0x48d1bf(0x155)],'reason':_0xbe9009[_0x48d1bf(0x14f)],'repairCommand':REPAIR_COMMAND};try{const _0xc4806c=frontmatterValue(readFileSync(join(_0xbe9009[_0x48d1bf(0x13b)],_0x48d1bf(0x143)),_0x48d1bf(0x130)),_0x48d1bf(0x131));if(_0xc4806c!==_0x560e75[_0x48d1bf(0x15f)])return{'state':_0x48d1bf(0x14e),'packageVersion':_0x560e75[_0x48d1bf(0x155)],'skillVersion':_0xc4806c,'installedPath':_0xbe9009[_0x48d1bf(0x13b)],'repairCommand':REPAIR_COMMAND};const _0xf4a495=listFiles(_0xbe9009[_0x48d1bf(0x13b)]),_0x4ccf56=digestFiles(_0xbe9009[_0x48d1bf(0x13b)],_0xf4a495);return{'state':sameFiles(_0xf4a495,_0x560e75[_0x48d1bf(0x147)][_0x48d1bf(0x175)])&&_0x4ccf56===_0x560e75[_0x48d1bf(0x147)][_0x48d1bf(0x166)]?_0x48d1bf(0x15e):_0x48d1bf(0x162),'packageVersion':_0x560e75[_0x48d1bf(0x155)],'skillVersion':_0xc4806c,'installedPath':_0xbe9009[_0x48d1bf(0x13b)],'digest':_0x4ccf56,'repairCommand':REPAIR_COMMAND};}catch(_0x57257f){return{'state':'unverifiable','packageVersion':_0x560e75[_0x48d1bf(0x155)],'installedPath':_0xbe9009[_0x48d1bf(0x13b)],'reason':_0x57257f instanceof Error?_0x57257f[_0x48d1bf(0x13d)]:String(_0x57257f),'repairCommand':REPAIR_COMMAND};}}function failure(_0x167caf,_0x4f695f,_0x5a4a18,_0x13b52f){const _0x55e6c8=a152_0xafdf57;return{'ok':![],'code':_0x167caf,'packageVersion':_0x4f695f[_0x55e6c8(0x155)],'skillVersion':_0x4f695f[_0x55e6c8(0x15f)],'installedPath':_0x13b52f,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x5a4a18 instanceof Error?_0x5a4a18[_0x55e6c8(0x13d)]:String(_0x5a4a18)};}export function installBuiltinSkill(_0x270099={}){const _0x261ca1=a152_0xafdf57,_0x352a64=_0x270099[_0x261ca1(0x173)]??DEFAULT_PACKAGE_ROOT,_0x5b1d8f=_0x270099[_0x261ca1(0x161)]??homedir();let _0x2186ee;try{_0x2186ee=readSource(_0x352a64);}catch(_0x6b48b3){return failure('SOURCE_INVALID',{'packageVersion':_0x261ca1(0x142),'skillVersion':_0x261ca1(0x142)},_0x6b48b3);}const _0x23dcd7=inspectBuiltinSkill({'packageRoot':_0x352a64,'home':_0x5b1d8f}),_0x19332f=runNpxSkillsAddGlobal(_0x352a64,_0x2186ee[_0x261ca1(0x158)],{'stdio':_0x270099[_0x261ca1(0x16c)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x5b1d8f}});if(_0x19332f[_0x261ca1(0x16e)])return{'ok':!![],'packageVersion':_0x2186ee[_0x261ca1(0x155)],'skillVersion':_0x2186ee[_0x261ca1(0x15f)],'installedPath':_0x23dcd7[_0x261ca1(0x14c)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x19332f['ok'])return failure(_0x261ca1(0x172),_0x2186ee,_0x19332f[_0x261ca1(0x133)]??_0x261ca1(0x174)+_0x19332f['status']);const _0x50b8fc=inspectBuiltinSkill({'packageRoot':_0x352a64,'home':_0x5b1d8f});if(_0x50b8fc[_0x261ca1(0x15a)]!==_0x261ca1(0x15e)){const _0x176825=_0x50b8fc[_0x261ca1(0x14f)]??_0x261ca1(0x139)+_0x50b8fc[_0x261ca1(0x15a)];return failure(_0x261ca1(0x165),_0x2186ee,_0x19332f[_0x261ca1(0x134)]?_0x176825+'\x0a'+_0x19332f['partialFailure']['output']:_0x176825,_0x50b8fc['installedPath']);}return _0x19332f[_0x261ca1(0x134)]&&(debug(_0x261ca1(0x13c),_0x19332f[_0x261ca1(0x134)]['output']),console[_0x261ca1(0x14a)](_0x261ca1(0x145)+_0x2186ee['skillVersion']+_0x261ca1(0x157)+_0x19332f[_0x261ca1(0x134)][_0x261ca1(0x16b)]+_0x261ca1(0x136))),{'ok':!![],'packageVersion':_0x2186ee[_0x261ca1(0x155)],'skillVersion':_0x2186ee[_0x261ca1(0x15f)],'installedPath':_0x50b8fc[_0x261ca1(0x14c)],'changed':_0x23dcd7[_0x261ca1(0x15a)]!==_0x261ca1(0x15e),'repairCommand':REPAIR_COMMAND};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0xb69aaa=a153_0x5979;(function(_0x485429,_0x3de666){const _0x400667=a153_0x5979,_0x3844c3=_0x485429();while(!![]){try{const _0x5360b6=parseInt(_0x400667(0x84))/0x1*(parseInt(_0x400667(0x83))/0x2)+parseInt(_0x400667(0x85))/0x3*(parseInt(_0x400667(0x98))/0x4)+parseInt(_0x400667(0x97))/0x5*(parseInt(_0x400667(0x8a))/0x6)+-parseInt(_0x400667(0x7e))/0x7*(-parseInt(_0x400667(0x89))/0x8)+-parseInt(_0x400667(0x7b))/0x9*(-parseInt(_0x400667(0x82))/0xa)+parseInt(_0x400667(0x81))/0xb*(parseInt(_0x400667(0xac))/0xc)+-parseInt(_0x400667(0x73))/0xd;if(_0x5360b6===_0x3de666)break;else _0x3844c3['push'](_0x3844c3['shift']());}catch(_0x51bb77){_0x3844c3['push'](_0x3844c3['shift']());}}}(a153_0x90d7,0xc8b45));import{execaSync}from'execa';function a153_0x90d7(){const _0x3e6ca9=['message','55HhLscc','1660HLBlDD','46662AnvjCT','39tILwmU','2382kwwKxi','code','\x22\x20install\x20state:\x20','partialFailure','8iSgNmu','782958zAWbyj','npm_config_global','npx','SPAWN_FAILED','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','ENOENT','unverifiable','exitCode','Installer\x20reported\x20','stdout','match','state','trim','25IYpnPZ','4236LEWLJy','npx\x20failed\x20to\x20start','SKILL_NOT_INSTALLED','stderr','NPX_NOT_FOUND','signal','reason','internalSkillSource','filter','npx\x20terminated\x20by\x20signal\x20','skills@latest','log','globalSkillName','presence','NPM_CONFIG_GLOBAL','absent','add','pipe','CHILD_TERMINATED','PERMISSION_DENIED','3612228kCJmtv','unknown','58035562yisrhI','shortMessage','skipNpxSkillsEnvSuffix','Skill\x20\x22','checked','warn','join','stdio','69399iAnctl','CHILD_EXIT_NONZERO','INSTALL_PARTIAL','686126zEduUu','!\x20Could\x20not\x20verify\x20\x22'];a153_0x90d7=function(){return _0x3e6ca9;};return a153_0x90d7();}import{LOVRABET_SKILL_SOURCE as a153_0x321897}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a153_0x321897;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a153_0xb69aaa(0x9f)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a153_0xb69aaa(0xa4)];export function resolveGlobalSkillName(_0x41e5ea){const _0x32acc5=a153_0xb69aaa;switch(_0x41e5ea[_0x32acc5(0x96)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}function a153_0x5979(_0x32652b,_0xd7010){_0x32652b=_0x32652b-0x73;const _0x90d78f=a153_0x90d7();let _0x597919=_0x90d78f[_0x32652b];return _0x597919;}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a153_0xb69aaa(0x75)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x527292,_0x4f0258,_0x5cc2b4){return{'ok':![],'status':_0x4f0258,'code':_0x527292,'error':'['+_0x527292+']\x20'+_0x5cc2b4};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x205256,_0x3bd705=LOVRABET_SKILL_SOURCE,_0x3749a5){const _0x634da6=a153_0xb69aaa;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5cb25f=['-y',_0x634da6(0xa2),_0x634da6(0xa8),_0x3bd705,'-g','-y'],_0xbfacfc=['npx',..._0x5cb25f][_0x634da6(0x79)]('\x20');console['log']('*\x20'+_0xbfacfc);const _0x51a7aa={...process.env};delete _0x51a7aa[_0x634da6(0x8b)],delete _0x51a7aa[_0x634da6(0xa6)];const _0x31c30c=execaSync(_0x634da6(0x8c),_0x5cb25f,{'cwd':_0x205256,'stdio':'pipe','env':_0x51a7aa,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x2c4440=[_0x31c30c[_0x634da6(0x93)]?String(_0x31c30c[_0x634da6(0x93)]):'',_0x31c30c['stderr']?String(_0x31c30c[_0x634da6(0x9b)]):''][_0x634da6(0xa0)](Boolean)[_0x634da6(0x79)]('\x0a')['trim'](),_0xdf627d=_0x31c30c[_0x634da6(0x91)]??null,_0x6b6e74=_0x31d582=>{const _0x493833=_0x634da6;return _0x3749a5?.[_0x493833(0x7a)]!==_0x493833(0xa9)&&!_0x31d582[_0x493833(0x88)]&&_0x2c4440&&console[_0x493833(0xa3)](_0x2c4440),_0x31d582;};if(_0x31c30c[_0x634da6(0x86)]){const _0xff4828=_0x31c30c[_0x634da6(0x86)]===_0x634da6(0x8f)?_0x634da6(0x9c):_0x31c30c[_0x634da6(0x86)]==='EPERM'||_0x31c30c[_0x634da6(0x86)]==='EACCES'?_0x634da6(0xab):_0x634da6(0x8d);return _0x6b6e74(failure(_0xff4828,_0xdf627d,_0x31c30c[_0x634da6(0x74)]??_0x31c30c[_0x634da6(0x80)]??_0x31c30c[_0x634da6(0x86)]));}if(_0x31c30c[_0x634da6(0x9d)])return _0x6b6e74(failure(_0x634da6(0xaa),_0xdf627d,_0x634da6(0xa1)+_0x31c30c['signal']));if(_0x31c30c['failed']&&_0xdf627d===null)return _0x6b6e74(failure('SPAWN_FAILED',_0xdf627d,_0x31c30c[_0x634da6(0x74)]??_0x31c30c[_0x634da6(0x80)]??_0x634da6(0x99)));if(_0xdf627d!==0x0)return _0x6b6e74(failure(_0x634da6(0x7c),_0xdf627d,_0x2c4440||_0x31c30c[_0x634da6(0x74)]||'exit\x20'+(_0xdf627d??_0x634da6(0xad))));const _0x2bcf37=_0x3749a5?.['expectedSkillName']??resolveGlobalSkillName(_0x3bd705),_0x3432b7=_0x2bcf37?resolveInstalledSkill(_0x2bcf37,_0x3749a5?.[_0x634da6(0xa5)]):undefined,_0x31cafd=_0x2c4440[_0x634da6(0x94)](/Failed to install\s+(\d+)/i);if(_0x31cafd&&Number(_0x31cafd[0x1])>0x0){const _0x52ec1f=_0x634da6(0x92)+_0x31cafd[0x1]+'\x20failed\x20target(s)'+(_0x2c4440?':\x0a'+_0x2c4440:'');if(_0x3432b7?.[_0x634da6(0x95)]==='present')return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x31cafd[0x1]),'output':_0x2c4440}};return _0x6b6e74(failure(_0x634da6(0x7d),0x0,_0x52ec1f));}if(_0x2bcf37&&_0x3432b7){if(_0x3432b7[_0x634da6(0x95)]===_0x634da6(0xa7))return _0x6b6e74(failure(_0x634da6(0x9a),0x0,_0x634da6(0x76)+_0x2bcf37+_0x634da6(0x8e)+_0x3432b7[_0x634da6(0x77)]['join'](',\x20')+')'));_0x3432b7['state']===_0x634da6(0x90)&&console[_0x634da6(0x78)](_0x634da6(0x7f)+_0x2bcf37+_0x634da6(0x87)+_0x3432b7[_0x634da6(0x9e)]);}return _0x6b6e74({'ok':!![],'status':0x0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a154_0x116fc4=a154_0x5c3e;function a154_0x3073(){const _0xa252df=['8RDaxpY','105573JVJxon','SKILL.md','lovrabet.skill.json','.git','882595UUglzy','36JGAXOa','coverage','build','312supVkS','4127080ERUHgV','30AWPiLT','8MmYZcb','.hg','201755oTYmBF','1887275zKXoTJ','672463FohjXX','.cache','.turbo','2976633gMybkM','.DS_Store'];a154_0x3073=function(){return _0xa252df;};return a154_0x3073();}(function(_0x22f0cb,_0x335515){const _0x1774f2=a154_0x5c3e,_0x5145cc=_0x22f0cb();while(!![]){try{const _0x904ebe=-parseInt(_0x1774f2(0x188))/0x1*(-parseInt(_0x1774f2(0x186))/0x2)+parseInt(_0x1774f2(0x190))/0x3*(parseInt(_0x1774f2(0x180))/0x4)+-parseInt(_0x1774f2(0x189))/0x5+-parseInt(_0x1774f2(0x185))/0x6*(-parseInt(_0x1774f2(0x17f))/0x7)+parseInt(_0x1774f2(0x18f))/0x8*(parseInt(_0x1774f2(0x18d))/0x9)+parseInt(_0x1774f2(0x184))/0xa+parseInt(_0x1774f2(0x18a))/0xb*(-parseInt(_0x1774f2(0x183))/0xc);if(_0x904ebe===_0x335515)break;else _0x5145cc['push'](_0x5145cc['shift']());}catch(_0x138969){_0x5145cc['push'](_0x5145cc['shift']());}}}(a154_0x3073,0x81908));export const METADATA_FILE=a154_0x116fc4(0x17d);export const SKILL_FILE=a154_0x116fc4(0x17c);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a154_0x116fc4(0x18e)]);function a154_0x5c3e(_0x2fd147,_0x121650){_0x2fd147=_0x2fd147-0x17c;const _0x307347=a154_0x3073();let _0x5c3e4e=_0x307347[_0x2fd147];return _0x5c3e4e;}export const IGNORED_DIR_NAMES=new Set([a154_0x116fc4(0x17e),a154_0x116fc4(0x187),'.svn','node_modules','.next','dist',a154_0x116fc4(0x182),a154_0x116fc4(0x181),a154_0x116fc4(0x18c),a154_0x116fc4(0x18b)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1de8a7,_0x403f60){const _0x4168e8=a155_0x3ded,_0x185a0f=_0x1de8a7();while(!![]){try{const _0x122c9e=parseInt(_0x4168e8(0x1bd))/0x1*(parseInt(_0x4168e8(0x1c5))/0x2)+parseInt(_0x4168e8(0x1be))/0x3+-parseInt(_0x4168e8(0x1c1))/0x4+-parseInt(_0x4168e8(0x1b5))/0x5+parseInt(_0x4168e8(0x1b7))/0x6+parseInt(_0x4168e8(0x1bb))/0x7+-parseInt(_0x4168e8(0x1b6))/0x8*(parseInt(_0x4168e8(0x1b9))/0x9);if(_0x122c9e===_0x403f60)break;else _0x185a0f['push'](_0x185a0f['shift']());}catch(_0x567dfb){_0x185a0f['push'](_0x185a0f['shift']());}}}(a155_0x245b,0x9034d));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(_0x31e89d,_0x1a7302){const _0x3edbfd=a155_0x3ded,_0x163f41=normalizeSkillRelativePath(_0x1a7302),_0x2011b2=realOrResolved(_0x31e89d),_0x1ae13c=resolve(_0x2011b2,..._0x163f41[_0x3edbfd(0x1b8)]('/'));if(!isPathInside(_0x1ae13c,_0x2011b2))throw CliErrors[_0x3edbfd(0x1c6)](_0x3edbfd(0x1c0)+_0x1a7302);return ensureNoSymlinkInManagedPath(_0x2011b2,_0x163f41),_0x1ae13c;}export function ensureNoSymlinkInManagedPath(_0x24d95c,_0x53fb7b){const _0x54bc9a=a155_0x3ded;let _0x551515=_0x24d95c;for(const _0x24d5ea of _0x53fb7b[_0x54bc9a(0x1b8)]('/')){_0x551515=resolve(_0x551515,_0x24d5ea);const _0x2bd75a=lstatIfPresent(_0x551515);if(_0x2bd75a?.[_0x54bc9a(0x1b4)]())throw CliErrors[_0x54bc9a(0x1c6)](_0x54bc9a(0x1bc)+_0x53fb7b);}}export function isDanglingSymlink(_0x4ac362){const _0x3f9717=a155_0x3ded;try{return lstatSync(_0x4ac362)[_0x3f9717(0x1b4)]();}catch{return![];}}export function resolveSymlinkTarget(_0x1bebc2){const _0x374e5f=readlinkSync(_0x1bebc2);return isAbsolute(_0x374e5f)?_0x374e5f:resolve(dirname(_0x1bebc2),_0x374e5f);}export function isPathInside(_0x4b976e,_0x1d08ce){const _0x344b19=a155_0x3ded,_0x28884e=_0x4b976e['endsWith'](sep)?_0x4b976e:''+_0x4b976e+sep,_0x48cadf=_0x1d08ce['endsWith'](sep)?_0x1d08ce:''+_0x1d08ce+sep;return _0x4b976e===_0x1d08ce||_0x28884e[_0x344b19(0x1ba)](_0x48cadf);}function a155_0x3ded(_0x4ee5e5,_0x3abc0f){_0x4ee5e5=_0x4ee5e5-0x1b4;const _0x245bc3=a155_0x245b();let _0x3dedd5=_0x245bc3[_0x4ee5e5];return _0x3dedd5;}export function realOrResolved(_0x256a60){try{return realpathSync(_0x256a60);}catch{return resolve(_0x256a60);}}export function lstatIfPresent(_0x299671){try{return lstatSync(_0x299671);}catch{return undefined;}}export function writeTextAtomic(_0x1dd3b7,_0x3c9213,_0x404ddb){const _0x49af55=a155_0x3ded;writeBytesAtomic(_0x1dd3b7,Buffer[_0x49af55(0x1c3)](_0x3c9213,_0x49af55(0x1c4)),_0x404ddb);}function a155_0x245b(){const _0x3e75b0=['4269924TqsiFy','startsWith','6860252ZICFwE','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','10vmvggp','1583790wWQtEF','stringify','Unsafe\x20Skill\x20file\x20path:\x20','1099360USxSmF','.tmp','from','utf8','203492lKFSJD','validation','isSymbolicLink','2120860NZOhjT','32lszaxs','3971994uKrbOh','split'];a155_0x245b=function(){return _0x3e75b0;};return a155_0x245b();}export function writeBytesAtomic(_0x1cc63c,_0x248c8a,_0x46f82f){const _0x113f51=a155_0x3ded,_0x135d30=_0x1cc63c+_0x113f51(0x1c2);try{writeFileSync(_0x135d30,_0x248c8a,{'mode':_0x46f82f}),renameSync(_0x135d30,_0x1cc63c);}catch(_0x5d95e4){try{rmSync(_0x135d30,{'force':!![]});}catch{}throw _0x5d95e4;}}export function writeJsonAtomic(_0x2939e4,_0x988c44){const _0x530cc5=a155_0x3ded;writeTextAtomic(_0x2939e4,JSON[_0x530cc5(0x1bf)](_0x988c44,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ad615,_0x50548b){const _0x329752=a156_0x312e,_0x26cbb6=_0x1ad615();while(!![]){try{const _0x4825bd=-parseInt(_0x329752(0x1ed))/0x1*(parseInt(_0x329752(0x1e0))/0x2)+-parseInt(_0x329752(0x1e8))/0x3*(-parseInt(_0x329752(0x1e5))/0x4)+parseInt(_0x329752(0x1df))/0x5+-parseInt(_0x329752(0x1eb))/0x6*(-parseInt(_0x329752(0x1e7))/0x7)+parseInt(_0x329752(0x1ec))/0x8*(parseInt(_0x329752(0x1ea))/0x9)+parseInt(_0x329752(0x1e9))/0xa+-parseInt(_0x329752(0x1e6))/0xb;if(_0x4825bd===_0x50548b)break;else _0x26cbb6['push'](_0x26cbb6['shift']());}catch(_0x237fec){_0x26cbb6['push'](_0x26cbb6['shift']());}}}(a156_0x1cdc,0x6c9f8));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x3d5504){const _0x3a8f1f=a156_0x312e;return createHash(_0x3a8f1f(0x1e4))['update'](_0x3d5504)[_0x3a8f1f(0x1e1)](_0x3a8f1f(0x1e3));}export function fileHash(_0x4fd127){return bufferSha256(fileContent(_0x4fd127));}function a156_0x1cdc(){const _0x46e9dd=['328DQUXJL','10011133ekGiMb','13048cxFxIQ','20763OVNeqJ','1866030FnrptD','1611QkWihS','1686ZHkEOc','22840rwAqYA','13KalQrx','size','348900TaShFs','77494WeznKX','digest','update','hex','sha256'];a156_0x1cdc=function(){return _0x46e9dd;};return a156_0x1cdc();}function a156_0x312e(_0x982ef0,_0x4e3076){_0x982ef0=_0x982ef0-0x1df;const _0x1cdc7d=a156_0x1cdc();let _0x312e5b=_0x1cdc7d[_0x982ef0];return _0x312e5b;}export function bufferSha256(_0x2296cd){const _0x40cbd4=a156_0x312e;return createHash(_0x40cbd4(0x1e4))['update'](_0x2296cd)['digest']('hex');}export function fileTreeHash(_0x1a17fc){const _0xa82d29=a156_0x312e,_0xbad2e5=createHash('sha256');for(const _0x35c1bb of normalizeManifestFiles(_0x1a17fc)){_0xbad2e5[_0xa82d29(0x1e2)](_0x35c1bb['path']),_0xbad2e5['update']('\x00'),_0xbad2e5[_0xa82d29(0x1e2)](_0x35c1bb['sha256']),_0xbad2e5[_0xa82d29(0x1e2)]('\x00'),_0xbad2e5[_0xa82d29(0x1e2)](String(_0x35c1bb[_0xa82d29(0x1ee)])),_0xbad2e5[_0xa82d29(0x1e2)]('\x00');}return _0xbad2e5[_0xa82d29(0x1e1)](_0xa82d29(0x1e3));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a157_0x3ab6c7=a157_0x5bb4;function a157_0x564e(){const _0x1e2afd=['5hGWJUC','.agents','3486dadYmP','3lfjfwn','managedRoot','appCode','5354382ZvaFzX','project','213477knxRHs','1949120UBuPXu','2869902JeyXJO','freeze','174jyZaDe','65566RfyaTM','10RNIcLn','815348LilwhC','global'];a157_0x564e=function(){return _0x1e2afd;};return a157_0x564e();}(function(_0x2f6197,_0x199fd7){const _0x43c2a1=a157_0x5bb4,_0x10bdac=_0x2f6197();while(!![]){try{const _0x5dffc9=-parseInt(_0x43c2a1(0x128))/0x1*(-parseInt(_0x43c2a1(0x132))/0x2)+-parseInt(_0x43c2a1(0x12d))/0x3+parseInt(_0x43c2a1(0x134))/0x4*(parseInt(_0x43c2a1(0x136))/0x5)+parseInt(_0x43c2a1(0x131))/0x6*(parseInt(_0x43c2a1(0x127))/0x7)+-parseInt(_0x43c2a1(0x12e))/0x8+-parseInt(_0x43c2a1(0x12f))/0x9*(parseInt(_0x43c2a1(0x133))/0xa)+parseInt(_0x43c2a1(0x12b))/0xb;if(_0x5dffc9===_0x199fd7)break;else _0x10bdac['push'](_0x10bdac['shift']());}catch(_0x441f2f){_0x10bdac['push'](_0x10bdac['shift']());}}}(a157_0x564e,0x296f1));import{resolve}from'node:path';function a157_0x5bb4(_0x2a70db,_0x2d3b73){_0x2a70db=_0x2a70db-0x127;const _0x564ed4=a157_0x564e();let _0x5bb4b3=_0x564ed4[_0x2a70db];return _0x5bb4b3;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x72d159,_0x11d16a=a157_0x3ab6c7(0x135),_0xb52334={}){const _0x1b6bf3=a157_0x3ab6c7,_0xb74356=resolveSkillSyncPaths(_0xb52334),_0x53a5e4=safePathSegment(_0x72d159,_0x1b6bf3(0x12a)),_0x4b5cf9=_0x11d16a===_0x1b6bf3(0x12c)?[resolve(_0xb52334['cwd']??process['cwd'](),_0x1b6bf3(0x137),'skills')]:runtimeAgentSkillRoots(_0xb74356);return Object[_0x1b6bf3(0x130)]({'scope':_0x11d16a,'appCode':_0x53a5e4,'skillRoots':Object['freeze'](_0x4b5cf9),'managedRoot':_0xb74356[_0x1b6bf3(0x129)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a158_0x556498=a158_0x8647;(function(_0x2cd493,_0x256053){const _0x32e56d=a158_0x8647,_0x1b5194=_0x2cd493();while(!![]){try{const _0x5f3ec0=parseInt(_0x32e56d(0x1a0))/0x1*(parseInt(_0x32e56d(0x1a3))/0x2)+-parseInt(_0x32e56d(0x17f))/0x3*(-parseInt(_0x32e56d(0x1a2))/0x4)+parseInt(_0x32e56d(0x19d))/0x5*(-parseInt(_0x32e56d(0x192))/0x6)+-parseInt(_0x32e56d(0x17c))/0x7*(-parseInt(_0x32e56d(0x18d))/0x8)+parseInt(_0x32e56d(0x1a8))/0x9*(parseInt(_0x32e56d(0x1a9))/0xa)+-parseInt(_0x32e56d(0x197))/0xb*(-parseInt(_0x32e56d(0x18a))/0xc)+-parseInt(_0x32e56d(0x187))/0xd;if(_0x5f3ec0===_0x256053)break;else _0x1b5194['push'](_0x1b5194['shift']());}catch(_0x8a0437){_0x1b5194['push'](_0x1b5194['shift']());}}}(a158_0xa3bf,0x7746c));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0x2a78c1 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';function a158_0xa3bf(){const _0x5edec0=['Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','contentHash','902166AlSuLF','validation','updated','scope','isDirectory','8027305HlOsoh','skipped','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','accessKey','removed','10HvNzBV','map','skillCode','740zxHuZp','appCode','824044yiYRrb','1610UKOmfR','linked-from-protected-root','metadata-mismatch','filter','name','1769661jYSatY','30tqyjrR','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','skill','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','created','lovrabet','company','personal','scopes','project','secret-retriever','2116583TRIrnu','metadataPath','slice','9HySupb','env','activeSkillCodes','has','isSymbolicLink','pruneSkillCodes','trim','protectedLinkRoots','26604058oKrost','dir','not-managed-symlink','12RschOZ','push','builtin','8VlXfEf','skillRoots','agentsSkillsDir'];a158_0xa3bf=function(){return _0x5edec0;};return a158_0xa3bf();}const {copySync,ensureDirSync,removeSync}=a158_0x2a78c1,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0x556498(0x1af),'runtime-observe',a158_0x556498(0x17b)]);export function linkEffectiveRuntimeSkills(_0x244d10,_0x2ef1d0){const _0x22572a=a158_0x556498,_0x5c32c3=new Map();for(const _0x3dfb3d of _0x244d10){const _0x39787b=_0x3dfb3d[_0x22572a(0x1ac)][_0x22572a(0x19f)];if(!_0x39787b)continue;const _0x8d939c=_0x5c32c3['get'](_0x39787b);(!_0x8d939c||_0x3dfb3d['scope']===_0x22572a(0x1b1))&&_0x5c32c3['set'](_0x39787b,_0x3dfb3d);}const _0x570a5d=[];for(const _0x1c9769 of _0x5c32c3['values']()){const _0x1b1b34=requireSkillCode(_0x1c9769[_0x22572a(0x1ac)]),_0x4edc55=readMetadataIfPresent(_0x1c9769[_0x22572a(0x17d)]);if(_0x4edc55?.[_0x22572a(0x1a1)]!==_0x2ef1d0['appCode']||_0x4edc55[_0x22572a(0x19f)]!==_0x1b1b34)throw CliErrors[_0x22572a(0x193)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x2ef1d0[_0x22572a(0x1a1)]+':\x20'+_0x1c9769['metadataPath']);const _0xad738b=runtimeSkillLinkName(_0x2ef1d0,_0x1b1b34);for(const _0x35693d of _0x2ef1d0['skillRoots']){_0x570a5d[_0x22572a(0x18b)](ensureManagedSymlink(resolve(_0x35693d,_0xad738b),_0x1c9769[_0x22572a(0x188)],_0x2ef1d0,_0x1b1b34));}}return _0x570a5d;}export function pruneStaleRuntimeSkillLinks(_0x548125,_0x3eda3e,_0x578efa){const _0x22f335=a158_0x556498,_0x3574c6=new Set([..._0x3eda3e][_0x22f335(0x19e)](_0x468b67=>_0x468b67[_0x22f335(0x185)]())[_0x22f335(0x1a6)](Boolean)),_0x343c74=_0x578efa?new Set([..._0x578efa][_0x22f335(0x19e)](_0x35064a=>_0x35064a['trim']())[_0x22f335(0x1a6)](Boolean)):undefined,_0x1261c5=[];for(const _0x99147f of _0x548125[_0x22f335(0x18e)]){for(const _0x509342 of managedTargetSkillLinkPaths(_0x99147f,_0x548125)){const _0x51eee8=runtimeSkillCodeFromLink(_0x548125,_0x509342);if(_0x343c74&&!_0x343c74[_0x22f335(0x182)](_0x51eee8))continue;if(_0x3574c6[_0x22f335(0x182)](_0x51eee8))continue;_0x1261c5[_0x22f335(0x18b)](removeManagedSkillLink(_0x509342,_0x548125,_0x51eee8));}}return _0x1261c5;}export function pruneStaleRuntimeSkillCache(_0x2b3178,_0x2160b2={}){const _0x3da93e=a158_0x556498,_0x348364=new Set([..._0x2b3178[_0x3da93e(0x181)]][_0x3da93e(0x19e)](_0xfb8447=>_0xfb8447[_0x3da93e(0x185)]())[_0x3da93e(0x1a6)](Boolean)),_0x4b9ff1=_0x2b3178[_0x3da93e(0x184)]?new Set([..._0x2b3178[_0x3da93e(0x184)]][_0x3da93e(0x19e)](_0x3bcbad=>_0x3bcbad[_0x3da93e(0x185)]())[_0x3da93e(0x1a6)](Boolean)):undefined,_0x50f80c=_0x2b3178[_0x3da93e(0x1b2)]??[_0x3da93e(0x1b1),_0x3da93e(0x1b0)],_0x5ba2a6=resolve(getRuntimeSkillCacheRoot(_0x2b3178[_0x3da93e(0x180)],_0x2b3178[_0x3da93e(0x19b)],_0x2160b2),safePathSegment(_0x2b3178[_0x3da93e(0x1a1)],_0x3da93e(0x1a1))),_0x56c434=[];for(const _0x245b48 of _0x50f80c){const _0xf694e7=resolve(_0x5ba2a6,_0x245b48);if(!existsSync(_0xf694e7))continue;for(const _0x149d73 of readdirSync(_0xf694e7,{'withFileTypes':!![]})){if(!_0x149d73[_0x3da93e(0x196)]())continue;const _0x4ce46d=_0x149d73[_0x3da93e(0x1a7)];if(_0x4b9ff1&&!_0x4b9ff1['has'](_0x4ce46d))continue;if(_0x348364['has'](_0x4ce46d))continue;const _0x417ffe=resolve(_0xf694e7,_0x4ce46d),_0x171e4f=readMetadataIfPresent(resolve(_0x417ffe,METADATA_FILE));if(_0x171e4f?.[_0x3da93e(0x1a1)]!==_0x2b3178['appCode']||_0x171e4f[_0x3da93e(0x195)]!==_0x245b48||_0x171e4f['skillCode']!==_0x4ce46d){_0x56c434[_0x3da93e(0x18b)]({'path':_0x417ffe,'action':'skipped','reason':_0x3da93e(0x1a5)});continue;}if(isLinkedFromAnyRoot(_0x417ffe,_0x2b3178[_0x3da93e(0x186)]??[])){_0x56c434[_0x3da93e(0x18b)]({'path':_0x417ffe,'action':'skipped','reason':_0x3da93e(0x1a4)});continue;}removeSync(_0x417ffe),_0x56c434['push']({'path':_0x417ffe,'action':_0x3da93e(0x19c)});}}return _0x56c434;}export function linkGlobalRuntimeSkills(_0x53884f,_0x5cc1d0={}){const _0x1c9893=a158_0x556498,_0x41404f=resolveSkillSyncPaths(_0x5cc1d0),_0x237f39=[];for(const _0x4e4c59 of _0x53884f){if(_0x4e4c59[_0x1c9893(0x195)]!==_0x1c9893(0x18c))throw CliErrors[_0x1c9893(0x193)](_0x1c9893(0x190)+_0x4e4c59[_0x1c9893(0x195)]);const _0x333a23=requireSkillCode(_0x4e4c59[_0x1c9893(0x1ac)]),_0x608db3=copyManagedSkillDirectory(_0x4e4c59[_0x1c9893(0x188)],resolve(_0x41404f[_0x1c9893(0x18f)],_0x333a23));_0x237f39[_0x1c9893(0x18b)]({..._0x608db3,'contentHash':_0x4e4c59['contentHash']});}return _0x237f39;}function ensureManagedSymlink(_0x20aa7c,_0x151b88,_0x16d106,_0x107232){const _0x3e06ef=a158_0x556498;mkdirSync(dirname(_0x20aa7c),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x20aa7c)||isDanglingSymlink(_0x20aa7c)){const _0x5f0936=lstatSync(_0x20aa7c);if(!_0x5f0936[_0x3e06ef(0x183)]())throw CliErrors[_0x3e06ef(0x193)](_0x3e06ef(0x199)+_0x20aa7c);const _0x5c7b89=resolveSymlinkTarget(_0x20aa7c);if(!isPathInside(realOrResolved(_0x5c7b89),realOrResolved(_0x16d106['managedRoot'])))throw CliErrors[_0x3e06ef(0x193)](_0x3e06ef(0x1ad)+_0x20aa7c);if(realOrResolved(_0x5c7b89)===realOrResolved(_0x151b88))return{'path':_0x20aa7c,'target':_0x151b88,'action':'unchanged'};const _0x2dc2bd=readMetadataIfPresent(resolve(_0x5c7b89,METADATA_FILE));if(_0x16d106[_0x3e06ef(0x195)]===_0x3e06ef(0x17a)&&(_0x2dc2bd?.[_0x3e06ef(0x1a1)]!==_0x16d106['appCode']||_0x2dc2bd[_0x3e06ef(0x19f)]!==_0x107232))throw CliErrors['validation'](_0x3e06ef(0x19a)+_0x20aa7c);return unlinkSync(_0x20aa7c),symlinkSync(_0x151b88,_0x20aa7c,_0x3e06ef(0x188)),{'path':_0x20aa7c,'target':_0x151b88,'action':_0x3e06ef(0x194)};}return symlinkSync(_0x151b88,_0x20aa7c,_0x3e06ef(0x188)),{'path':_0x20aa7c,'target':_0x151b88,'action':_0x3e06ef(0x1ae)};}function managedTargetSkillLinkPaths(_0x7bb5c9,_0x4593c6){const _0x3f7702=a158_0x556498;if(!existsSync(_0x7bb5c9))return[];const _0x12bc67=_0x4593c6[_0x3f7702(0x1a1)]+'--';return readdirSync(_0x7bb5c9,{'withFileTypes':!![]})[_0x3f7702(0x1a6)](_0x41f9e1=>_0x4593c6['scope']===_0x3f7702(0x17a)||_0x41f9e1[_0x3f7702(0x1a7)]['startsWith'](_0x12bc67))['map'](_0x18faeb=>resolve(_0x7bb5c9,_0x18faeb[_0x3f7702(0x1a7)]));}function removeManagedSkillLink(_0x4b9421,_0xdef11,_0xa0b277){const _0x1d51e7=a158_0x556498,_0x4e9bee=lstatIfPresent(_0x4b9421);if(!_0x4e9bee?.['isSymbolicLink']())return{'path':_0x4b9421,'action':_0x1d51e7(0x198),'reason':_0x1d51e7(0x189)};const _0x33895e=resolveSymlinkTarget(_0x4b9421);if(!isPathInside(realOrResolved(_0x33895e),realOrResolved(_0xdef11['managedRoot'])))return{'path':_0x4b9421,'action':'skipped','reason':'external-symlink'};const _0x5b9e0e=readMetadataIfPresent(resolve(_0x33895e,METADATA_FILE));if(_0xdef11['scope']===_0x1d51e7(0x17a)&&(_0x5b9e0e?.[_0x1d51e7(0x1a1)]!==_0xdef11[_0x1d51e7(0x1a1)]||_0x5b9e0e[_0x1d51e7(0x19f)]!==_0xa0b277))return{'path':_0x4b9421,'action':_0x1d51e7(0x198),'reason':_0x1d51e7(0x1a5)};return unlinkSync(_0x4b9421),{'path':_0x4b9421,'action':'removed'};}function isLinkedFromAnyRoot(_0xfbad84,_0x3046b4){const _0x77174f=a158_0x556498,_0xe0acbb=realOrResolved(_0xfbad84);for(const _0x4e9553 of _0x3046b4){if(!existsSync(_0x4e9553))continue;for(const _0x2152f4 of readdirSync(_0x4e9553,{'withFileTypes':!![]})){if(!_0x2152f4[_0x77174f(0x183)]())continue;const _0x387360=resolve(_0x4e9553,_0x2152f4[_0x77174f(0x1a7)]);if(realOrResolved(resolveSymlinkTarget(_0x387360))===_0xe0acbb)return!![];}}return![];}function runtimeSkillLinkName(_0x308796,_0x22038b){const _0x46a5c3=a158_0x556498,_0x34d5db=safePathSegment(_0x22038b,_0x46a5c3(0x19f));if(_0x308796[_0x46a5c3(0x195)]===_0x46a5c3(0x17a)&&RESERVED_PROJECT_SKILL_CODES[_0x46a5c3(0x182)](_0x34d5db))throw CliErrors[_0x46a5c3(0x193)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x34d5db);return _0x308796['scope']===_0x46a5c3(0x17a)?_0x34d5db:_0x308796[_0x46a5c3(0x1a1)]+'--'+_0x34d5db;}function runtimeSkillCodeFromLink(_0x197217,_0x5a6a8e){const _0x4757c6=a158_0x556498,_0x5b6308=basename(_0x5a6a8e);return _0x197217[_0x4757c6(0x195)]==='project'?_0x5b6308:_0x5b6308[_0x4757c6(0x17e)]((_0x197217[_0x4757c6(0x1a1)]+'--')['length']);}function a158_0x8647(_0x26a946,_0x13ba9a){_0x26a946=_0x26a946-0x17a;const _0xa3bfaa=a158_0xa3bf();let _0x864701=_0xa3bfaa[_0x26a946];return _0x864701;}export function copyManagedSkillDirectory(_0x39ed5d,_0x2ff10d){const _0x28db40=a158_0x556498,_0x15de9f=resolve(_0x2ff10d,METADATA_FILE),_0x56688e=existsSync(_0x2ff10d);if(_0x56688e){const _0x5cb402=lstatSync(_0x2ff10d);if(_0x5cb402[_0x28db40(0x183)]())throw CliErrors[_0x28db40(0x193)](_0x28db40(0x1ab)+_0x2ff10d);if(!_0x5cb402[_0x28db40(0x196)]())throw CliErrors[_0x28db40(0x193)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x2ff10d);const _0x207c4b=readMetadataIfPresent(_0x15de9f);if(_0x207c4b?.[_0x28db40(0x195)]!=='builtin')throw CliErrors['validation'](_0x28db40(0x1aa)+_0x2ff10d);}ensureDirSync(dirname(_0x2ff10d));const _0x3086bd=_0x56688e?readMetadataIfPresent(_0x15de9f)?.[_0x28db40(0x191)]:undefined,_0x3938d7=readMetadataIfPresent(resolve(_0x39ed5d,METADATA_FILE))?.[_0x28db40(0x191)];return _0x56688e&&removeSync(_0x2ff10d),copySkillDirectory(_0x39ed5d,_0x2ff10d),{'path':_0x2ff10d,'target':_0x39ed5d,'action':!_0x56688e?_0x28db40(0x1ae):_0x3086bd===_0x3938d7?'unchanged':_0x28db40(0x194)};}function copySkillDirectory(_0x1cd128,_0x3dc7af){copySync(_0x1cd128,_0x3dc7af,{'dereference':![],'overwrite':!![],'filter'(_0x436754){const _0x5c0f08=a158_0x8647;if(lstatSync(_0x436754)[_0x5c0f08(0x183)]())throw CliErrors[_0x5c0f08(0x193)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x436754);return!![];}});}
|
|
1
|
+
const a158_0x3369ab=a158_0x5f88;(function(_0x1a6bc9,_0x4aad0d){const _0x24f462=a158_0x5f88,_0x161775=_0x1a6bc9();while(!![]){try{const _0x4c1940=parseInt(_0x24f462(0xe5))/0x1+parseInt(_0x24f462(0xd1))/0x2+parseInt(_0x24f462(0xe7))/0x3*(-parseInt(_0x24f462(0xdc))/0x4)+-parseInt(_0x24f462(0xe3))/0x5+-parseInt(_0x24f462(0xdd))/0x6*(parseInt(_0x24f462(0xb6))/0x7)+-parseInt(_0x24f462(0xca))/0x8*(-parseInt(_0x24f462(0xb4))/0x9)+parseInt(_0x24f462(0xd3))/0xa;if(_0x4c1940===_0x4aad0d)break;else _0x161775['push'](_0x161775['shift']());}catch(_0x2ea4c8){_0x161775['push'](_0x161775['shift']());}}}(a158_0x5b03,0xdd872));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0x1fd0ef from'fs-extra';import{CliErrors}from'../../errors.js';function a158_0x5f88(_0x5c3d2b,_0x5e23c2){_0x5c3d2b=_0x5c3d2b-0xb3;const _0x5b0320=a158_0x5b03();let _0x5f8811=_0x5b0320[_0x5c3d2b];return _0x5f8811;}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}=a158_0x1fd0ef,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0x3369ab(0xed),a158_0x3369ab(0xcd),a158_0x3369ab(0xd4)]);export function linkEffectiveRuntimeSkills(_0x43d090,_0x1bfe88){const _0x2b9256=a158_0x3369ab,_0x3ae4bd=new Map();for(const _0x63760d of _0x43d090){const _0x17d793=_0x63760d[_0x2b9256(0xbf)][_0x2b9256(0xb9)];if(!_0x17d793)continue;const _0x32f70c=_0x3ae4bd[_0x2b9256(0xc8)](_0x17d793);(!_0x32f70c||_0x63760d[_0x2b9256(0xb8)]===_0x2b9256(0xc3))&&_0x3ae4bd['set'](_0x17d793,_0x63760d);}const _0x1fa843=[];for(const _0x55bdab of _0x3ae4bd['values']()){const _0x4e1e60=requireSkillCode(_0x55bdab[_0x2b9256(0xbf)]),_0x26dbc2=readMetadataIfPresent(_0x55bdab[_0x2b9256(0xd0)]);if(_0x26dbc2?.[_0x2b9256(0xee)]!==_0x1bfe88[_0x2b9256(0xee)]||_0x26dbc2[_0x2b9256(0xb9)]!==_0x4e1e60)throw CliErrors[_0x2b9256(0xc2)](_0x2b9256(0xc7)+_0x1bfe88['appCode']+':\x20'+_0x55bdab['metadataPath']);const _0x3b1592=runtimeSkillLinkName(_0x1bfe88,_0x4e1e60);for(const _0x23f6f6 of _0x1bfe88[_0x2b9256(0xd6)]){_0x1fa843[_0x2b9256(0xbb)](ensureManagedSymlink(resolve(_0x23f6f6,_0x3b1592),_0x55bdab[_0x2b9256(0xc0)],_0x1bfe88,_0x4e1e60));}}return _0x1fa843;}export function pruneStaleRuntimeSkillLinks(_0xd68956,_0xf03222,_0x536121){const _0x4eb8bf=a158_0x3369ab,_0x53d6f6=new Set([..._0xf03222]['map'](_0x26bc8e=>_0x26bc8e[_0x4eb8bf(0xec)]())[_0x4eb8bf(0xde)](Boolean)),_0x2c7f20=_0x536121?new Set([..._0x536121][_0x4eb8bf(0xb3)](_0x551c96=>_0x551c96[_0x4eb8bf(0xec)]())[_0x4eb8bf(0xde)](Boolean)):undefined,_0x39ba14=[];for(const _0x1b207b of _0xd68956['skillRoots']){for(const _0x5dfe7f of managedTargetSkillLinkPaths(_0x1b207b,_0xd68956)){const _0x50b9d5=runtimeSkillCodeFromLink(_0xd68956,_0x5dfe7f);if(_0x2c7f20&&!_0x2c7f20[_0x4eb8bf(0xd5)](_0x50b9d5))continue;if(_0x53d6f6[_0x4eb8bf(0xd5)](_0x50b9d5))continue;_0x39ba14['push'](removeManagedSkillLink(_0x5dfe7f,_0xd68956,_0x50b9d5));}}return _0x39ba14;}export function pruneStaleRuntimeSkillCache(_0x4e63d3,_0x52f7b8={}){const _0x4fa04a=a158_0x3369ab,_0x26d708=new Set([..._0x4e63d3[_0x4fa04a(0xcc)]][_0x4fa04a(0xb3)](_0x4f7c47=>_0x4f7c47[_0x4fa04a(0xec)]())[_0x4fa04a(0xde)](Boolean)),_0x4cff04=_0x4e63d3[_0x4fa04a(0xe2)]?new Set([..._0x4e63d3[_0x4fa04a(0xe2)]][_0x4fa04a(0xb3)](_0x12e2bd=>_0x12e2bd[_0x4fa04a(0xec)]())[_0x4fa04a(0xde)](Boolean)):undefined,_0x50800f=_0x4e63d3[_0x4fa04a(0xe0)]??[_0x4fa04a(0xc3),_0x4fa04a(0xcb)],_0x4e6f2f=resolve(getRuntimeSkillCacheRoot(_0x4e63d3[_0x4fa04a(0xcf)],_0x4e63d3[_0x4fa04a(0xe4)],_0x52f7b8),safePathSegment(_0x4e63d3[_0x4fa04a(0xee)],'appCode')),_0x4ecbfc=[];for(const _0x2a9c09 of _0x50800f){const _0xec4c64=resolve(_0x4e6f2f,_0x2a9c09);if(!existsSync(_0xec4c64))continue;for(const _0x31893f of readdirSync(_0xec4c64,{'withFileTypes':!![]})){if(!_0x31893f[_0x4fa04a(0xc1)]())continue;const _0x10b285=_0x31893f['name'];if(_0x4cff04&&!_0x4cff04[_0x4fa04a(0xd5)](_0x10b285))continue;if(_0x26d708[_0x4fa04a(0xd5)](_0x10b285))continue;const _0x4e9ea7=resolve(_0xec4c64,_0x10b285),_0x4a1e3c=readMetadataIfPresent(resolve(_0x4e9ea7,METADATA_FILE));if(_0x4a1e3c?.[_0x4fa04a(0xee)]!==_0x4e63d3[_0x4fa04a(0xee)]||_0x4a1e3c[_0x4fa04a(0xb8)]!==_0x2a9c09||_0x4a1e3c[_0x4fa04a(0xb9)]!==_0x10b285){_0x4ecbfc[_0x4fa04a(0xbb)]({'path':_0x4e9ea7,'action':_0x4fa04a(0xe9),'reason':_0x4fa04a(0xb7)});continue;}if(isLinkedFromAnyRoot(_0x4e9ea7,_0x4e63d3['protectedLinkRoots']??[])){_0x4ecbfc['push']({'path':_0x4e9ea7,'action':_0x4fa04a(0xe9),'reason':_0x4fa04a(0xeb)});continue;}removeSync(_0x4e9ea7),_0x4ecbfc[_0x4fa04a(0xbb)]({'path':_0x4e9ea7,'action':'removed'});}}return _0x4ecbfc;}export function linkGlobalRuntimeSkills(_0x3fda71,_0x581434={}){const _0x31c127=a158_0x3369ab,_0x29a227=resolveSkillSyncPaths(_0x581434),_0x2a07c0=[];for(const _0x37d48a of _0x3fda71){if(_0x37d48a[_0x31c127(0xb8)]!=='builtin')throw CliErrors[_0x31c127(0xc2)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x37d48a[_0x31c127(0xb8)]);const _0x43f025=requireSkillCode(_0x37d48a[_0x31c127(0xbf)]),_0x234e13=copyManagedSkillDirectory(_0x37d48a['dir'],resolve(_0x29a227[_0x31c127(0xc4)],_0x43f025));_0x2a07c0[_0x31c127(0xbb)]({..._0x234e13,'contentHash':_0x37d48a[_0x31c127(0xce)]});}return _0x2a07c0;}function ensureManagedSymlink(_0x576b62,_0x1fa5d1,_0xd8fb4d,_0x4d7856){const _0xadc71c=a158_0x3369ab;mkdirSync(dirname(_0x576b62),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x576b62)||isDanglingSymlink(_0x576b62)){const _0x22282b=lstatSync(_0x576b62);if(!_0x22282b[_0xadc71c(0xc9)]())throw CliErrors[_0xadc71c(0xc2)](_0xadc71c(0xe1)+_0x576b62);const _0x4fcb11=resolveSymlinkTarget(_0x576b62);if(!isPathInside(realOrResolved(_0x4fcb11),realOrResolved(_0xd8fb4d['managedRoot'])))throw CliErrors[_0xadc71c(0xc2)](_0xadc71c(0xd8)+_0x576b62);if(realOrResolved(_0x4fcb11)===realOrResolved(_0x1fa5d1))return{'path':_0x576b62,'target':_0x1fa5d1,'action':'unchanged'};const _0x46085f=readMetadataIfPresent(resolve(_0x4fcb11,METADATA_FILE));if(_0xd8fb4d[_0xadc71c(0xb8)]===_0xadc71c(0xc6)&&(_0x46085f?.[_0xadc71c(0xee)]!==_0xd8fb4d[_0xadc71c(0xee)]||_0x46085f[_0xadc71c(0xb9)]!==_0x4d7856))throw CliErrors['validation'](_0xadc71c(0xbe)+_0x576b62);return unlinkSync(_0x576b62),symlinkSync(_0x1fa5d1,_0x576b62,_0xadc71c(0xc0)),{'path':_0x576b62,'target':_0x1fa5d1,'action':_0xadc71c(0xbd)};}return symlinkSync(_0x1fa5d1,_0x576b62,_0xadc71c(0xc0)),{'path':_0x576b62,'target':_0x1fa5d1,'action':_0xadc71c(0xef)};}function managedTargetSkillLinkPaths(_0x3cd6b2,_0x1d73b2){const _0x136736=a158_0x3369ab;if(!existsSync(_0x3cd6b2))return[];const _0x5bfb9a=_0x1d73b2['appCode']+'--';return readdirSync(_0x3cd6b2,{'withFileTypes':!![]})['filter'](_0x4b1612=>_0x1d73b2[_0x136736(0xb8)]===_0x136736(0xc6)||_0x4b1612[_0x136736(0xd7)][_0x136736(0xdf)](_0x5bfb9a))[_0x136736(0xb3)](_0x14c1ba=>resolve(_0x3cd6b2,_0x14c1ba[_0x136736(0xd7)]));}function removeManagedSkillLink(_0x1665dd,_0x4de1a3,_0x21b37e){const _0x52f05e=a158_0x3369ab,_0x2d293c=lstatIfPresent(_0x1665dd);if(!_0x2d293c?.[_0x52f05e(0xc9)]())return{'path':_0x1665dd,'action':_0x52f05e(0xe9),'reason':_0x52f05e(0xd2)};const _0x39e1d1=resolveSymlinkTarget(_0x1665dd);if(!isPathInside(realOrResolved(_0x39e1d1),realOrResolved(_0x4de1a3[_0x52f05e(0xb5)])))return{'path':_0x1665dd,'action':_0x52f05e(0xe9),'reason':_0x52f05e(0xe6)};const _0x6f43d4=readMetadataIfPresent(resolve(_0x39e1d1,METADATA_FILE));if(_0x4de1a3[_0x52f05e(0xb8)]==='project'&&(_0x6f43d4?.['appCode']!==_0x4de1a3['appCode']||_0x6f43d4[_0x52f05e(0xb9)]!==_0x21b37e))return{'path':_0x1665dd,'action':_0x52f05e(0xe9),'reason':_0x52f05e(0xb7)};return unlinkSync(_0x1665dd),{'path':_0x1665dd,'action':_0x52f05e(0xba)};}function isLinkedFromAnyRoot(_0x24ae27,_0x240678){const _0xe9a21b=realOrResolved(_0x24ae27);for(const _0x122131 of _0x240678){if(!existsSync(_0x122131))continue;for(const _0x324610 of readdirSync(_0x122131,{'withFileTypes':!![]})){if(!_0x324610['isSymbolicLink']())continue;const _0xa72ac3=resolve(_0x122131,_0x324610['name']);if(realOrResolved(resolveSymlinkTarget(_0xa72ac3))===_0xe9a21b)return!![];}}return![];}function runtimeSkillLinkName(_0x3202d7,_0x2310b7){const _0x1d3379=a158_0x3369ab,_0x1e25f0=safePathSegment(_0x2310b7,_0x1d3379(0xb9));if(_0x3202d7[_0x1d3379(0xb8)]===_0x1d3379(0xc6)&&RESERVED_PROJECT_SKILL_CODES[_0x1d3379(0xd5)](_0x1e25f0))throw CliErrors[_0x1d3379(0xc2)](_0x1d3379(0xdb)+_0x1e25f0);return _0x3202d7['scope']===_0x1d3379(0xc6)?_0x1e25f0:_0x3202d7[_0x1d3379(0xee)]+'--'+_0x1e25f0;}function runtimeSkillCodeFromLink(_0x4c4a41,_0x254662){const _0xa92c9e=a158_0x3369ab,_0x4b60ab=basename(_0x254662);return _0x4c4a41[_0xa92c9e(0xb8)]===_0xa92c9e(0xc6)?_0x4b60ab:_0x4b60ab[_0xa92c9e(0xea)]((_0x4c4a41[_0xa92c9e(0xee)]+'--')['length']);}export function copyManagedSkillDirectory(_0x151b9e,_0x585dbf){const _0x29d50e=a158_0x3369ab,_0x41b083=resolve(_0x585dbf,METADATA_FILE),_0x5bc066=existsSync(_0x585dbf);if(_0x5bc066){const _0x4e4582=lstatSync(_0x585dbf);if(_0x4e4582[_0x29d50e(0xc9)]())throw CliErrors[_0x29d50e(0xc2)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x585dbf);if(!_0x4e4582[_0x29d50e(0xc1)]())throw CliErrors[_0x29d50e(0xc2)](_0x29d50e(0xbc)+_0x585dbf);const _0xb85799=readMetadataIfPresent(_0x41b083);if(_0xb85799?.[_0x29d50e(0xb8)]!==_0x29d50e(0xc5))throw CliErrors[_0x29d50e(0xc2)](_0x29d50e(0xe8)+_0x585dbf);}ensureDirSync(dirname(_0x585dbf));const _0x3c4aa0=_0x5bc066?readMetadataIfPresent(_0x41b083)?.[_0x29d50e(0xce)]:undefined,_0x550f13=readMetadataIfPresent(resolve(_0x151b9e,METADATA_FILE))?.[_0x29d50e(0xce)];return _0x5bc066&&removeSync(_0x585dbf),copySkillDirectory(_0x151b9e,_0x585dbf),{'path':_0x585dbf,'target':_0x151b9e,'action':!_0x5bc066?_0x29d50e(0xef):_0x3c4aa0===_0x550f13?_0x29d50e(0xd9):_0x29d50e(0xbd)};}function copySkillDirectory(_0x1a7a7b,_0x4defaf){copySync(_0x1a7a7b,_0x4defaf,{'dereference':![],'overwrite':!![],'filter'(_0x39a814){const _0x3ba595=a158_0x5f88;if(lstatSync(_0x39a814)[_0x3ba595(0xc9)]())throw CliErrors['validation'](_0x3ba595(0xda)+_0x39a814);return!![];}});}function a158_0x5b03(){const _0x135375=['Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','skill','dir','isDirectory','validation','personal','agentsSkillsDir','builtin','project','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','get','isSymbolicLink','19760lMrvrv','company','activeSkillCodes','runtime-observe','contentHash','env','metadataPath','2331942EAHOEV','not-managed-symlink','175130mnaFoS','secret-retriever','has','skillRoots','name','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','unchanged','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','143788DkalOY','4202070zqUeVn','filter','startsWith','scopes','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','pruneSkillCodes','7116650zpvNaW','accessKey','1131533OpGyfZ','external-symlink','6TeOFyZ','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','skipped','slice','linked-from-protected-root','trim','lovrabet','appCode','created','map','2871yAMpXx','managedRoot','7IekXJY','metadata-mismatch','scope','skillCode','removed','push','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','updated'];a158_0x5b03=function(){return _0x135375;};return a158_0x5b03();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28e9f1,_0x569acf){const _0x1b7616=a159_0x1b16,_0x1a89ba=_0x28e9f1();while(!![]){try{const _0x255288=-parseInt(_0x1b7616(0x155))/0x1*(parseInt(_0x1b7616(0x149))/0x2)+parseInt(_0x1b7616(0x14f))/0x3+-parseInt(_0x1b7616(0x163))/0x4+parseInt(_0x1b7616(0x14d))/0x5*(parseInt(_0x1b7616(0x14e))/0x6)+parseInt(_0x1b7616(0x14c))/0x7+parseInt(_0x1b7616(0x15a))/0x8*(-parseInt(_0x1b7616(0x13f))/0x9)+parseInt(_0x1b7616(0x13e))/0xa;if(_0x255288===_0x569acf)break;else _0x1a89ba['push'](_0x1a89ba['shift']());}catch(_0x4ab759){_0x1a89ba['push'](_0x1a89ba['shift']());}}}(a159_0x11b2,0x7bb55));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';function a159_0x1b16(_0x4f7e4a,_0x737119){_0x4f7e4a=_0x4f7e4a-0x13c;const _0x11b240=a159_0x11b2();let _0x1b169c=_0x11b240[_0x4f7e4a];return _0x1b169c;}import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x294c47,_0x529115,_0x1a2910={}){const _0x42d84b=a159_0x1b16,_0xf6604f=safePathSegment(_0x294c47['appCode'],'appCode');if(_0x529115[_0x42d84b(0x145)]!==_0xf6604f)throw CliErrors[_0x42d84b(0x15f)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x529115['appCode']+'\x20!=\x20'+_0xf6604f);const _0x3ffdce=normalizeRuntimeSkillScopes(_0x294c47[_0x42d84b(0x165)]),_0x4534d8=new Set(_0x3ffdce),_0x3061a0=_0x294c47[_0x42d84b(0x167)]?.[_0x42d84b(0x143)](),_0x2bedd8=new Map(),_0x4815fc=resolve(getRuntimeSkillCacheRoot(_0x294c47['env'],_0x294c47[_0x42d84b(0x164)],_0x1a2910),_0xf6604f);for(const _0x1209b0 of _0x3ffdce){for(const _0x2c44e2 of localSkillEntryDirs(resolve(_0x4815fc,_0x1209b0))){collectLocalRuntimeSkill(_0x2bedd8,_0x2c44e2,{'appCode':_0xf6604f,'scopes':_0x4534d8,'code':_0x3061a0,'source':'cache'});}}for(const _0x253304 of _0x529115[_0x42d84b(0x14b)]){for(const _0x175756 of localSkillLinkCandidates(_0x253304,_0x529115,_0x4534d8)){collectLocalRuntimeSkill(_0x2bedd8,_0x175756,{'appCode':_0xf6604f,'scopes':_0x4534d8,'code':_0x3061a0,'source':_0x42d84b(0x154),'linkedPath':_0x175756});}}return Array[_0x42d84b(0x158)](_0x2bedd8[_0x42d84b(0x166)]())[_0x42d84b(0x15c)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x454616){const _0x31becf=a159_0x1b16;if(!existsSync(_0x454616))return[];return readdirSync(_0x454616,{'withFileTypes':!![]})[_0x31becf(0x159)](_0x207533=>_0x207533['isDirectory']()||_0x207533[_0x31becf(0x15b)]())[_0x31becf(0x157)](_0x25aaf1=>resolve(_0x454616,_0x25aaf1[_0x31becf(0x142)]));}function a159_0x11b2(){const _0x3b1e78=['406600RKTcvo','accessKey','scopes','values','code','builtin','dir','12620400zhxlGb','10026MJJuwT','scope','startsWith','name','trim','tags','appCode','linkedPaths','set','isDirectory','1724CbFQfg','includes','skillRoots','1615845gVbrYE','773685wQZuzQ','6PLHrnK','378705BXGbtQ','has','isArray','cache','metadataPath','link','892yXAFub','localeCompare','map','from','filter','2848pFDJUl','isSymbolicLink','sort','skillCode','local','validation','skillMdPath','source','linkedPath'];a159_0x11b2=function(){return _0x3b1e78;};return a159_0x11b2();}function localSkillLinkCandidates(_0x2e4155,_0x5a56fe,_0x28f0a2){const _0x3fc672=a159_0x1b16;if(!existsSync(_0x2e4155))return[];const _0x2a7b4b=_0x5a56fe[_0x3fc672(0x145)]+'--';return readdirSync(_0x2e4155,{'withFileTypes':!![]})[_0x3fc672(0x159)](_0xf553b8=>_0xf553b8[_0x3fc672(0x148)]()||_0xf553b8['isSymbolicLink']())[_0x3fc672(0x159)](_0x5c1a3b=>_0x5a56fe[_0x3fc672(0x140)]==='project'||_0x5c1a3b[_0x3fc672(0x142)][_0x3fc672(0x141)](_0x2a7b4b)||_0x28f0a2[_0x3fc672(0x150)](_0x3fc672(0x13c)))[_0x3fc672(0x157)](_0x380ff7=>resolve(_0x2e4155,_0x380ff7[_0x3fc672(0x142)]));}function collectLocalRuntimeSkill(_0x4dda39,_0x104610,_0x1d6ce8){const _0x274cac=a159_0x1b16,_0x3d627b=resolve(_0x104610,METADATA_FILE),_0x14eedd=readMetadataIfPresent(_0x3d627b);if(!_0x14eedd)return;if(_0x14eedd['appCode']!==_0x1d6ce8['appCode'])return;if(!isRuntimeSkillScope(_0x14eedd[_0x274cac(0x140)])||!_0x1d6ce8['scopes']['has'](_0x14eedd[_0x274cac(0x140)]))return;const _0x2513c6=_0x14eedd[_0x274cac(0x15d)]?.[_0x274cac(0x143)]();if(!_0x2513c6)return;if(_0x1d6ce8['code']&&_0x2513c6!==_0x1d6ce8[_0x274cac(0x167)])return;const _0x483c63=_0x14eedd[_0x274cac(0x140)]+':'+_0x2513c6,_0xcb0f1e=_0x1d6ce8[_0x274cac(0x162)]?[_0x1d6ce8['linkedPath']]:[],_0x10f38c=_0x4dda39['get'](_0x483c63);if(_0x10f38c){_0x1d6ce8[_0x274cac(0x161)]===_0x274cac(0x152)&&(_0x10f38c[_0x274cac(0x13d)]=_0x104610,_0x10f38c['cacheDir']=_0x104610,_0x10f38c[_0x274cac(0x160)]=resolve(_0x104610,SKILL_FILE),_0x10f38c[_0x274cac(0x153)]=_0x3d627b);for(const _0x5c697e of _0xcb0f1e){!_0x10f38c[_0x274cac(0x146)][_0x274cac(0x14a)](_0x5c697e)&&_0x10f38c[_0x274cac(0x146)]['push'](_0x5c697e);}_0x10f38c[_0x274cac(0x146)][_0x274cac(0x15c)]();return;}_0x4dda39[_0x274cac(0x147)](_0x483c63,{..._0x14eedd,'tags':Array[_0x274cac(0x151)](_0x14eedd[_0x274cac(0x144)])?_0x14eedd[_0x274cac(0x144)]:[],'scope':_0x14eedd[_0x274cac(0x140)],'source':_0x274cac(0x15e),'dir':_0x104610,'cacheDir':_0x1d6ce8[_0x274cac(0x161)]==='cache'?_0x104610:undefined,'skillMdPath':resolve(_0x104610,SKILL_FILE),'metadataPath':_0x3d627b,'linkedPaths':_0xcb0f1e});}function compareLocalRuntimeSkills(_0x11734f,_0x2b7818){const _0x2fa778=a159_0x1b16,_0x23f07f={'personal':0x0,'company':0x1,'builtin':0x2};return _0x23f07f[_0x11734f[_0x2fa778(0x140)]]-_0x23f07f[_0x2b7818[_0x2fa778(0x140)]]||_0x11734f['skillCode']['localeCompare'](_0x2b7818[_0x2fa778(0x15d)])||_0x11734f[_0x2fa778(0x13d)][_0x2fa778(0x156)](_0x2b7818[_0x2fa778(0x13d)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x209f88,_0x5a6f09){const _0x2c6120=a160_0x4437,_0x593456=_0x209f88();while(!![]){try{const _0x8d0f3a=-parseInt(_0x2c6120(0x180))/0x1+-parseInt(_0x2c6120(0x178))/0x2+parseInt(_0x2c6120(0x18e))/0x3*(-parseInt(_0x2c6120(0x191))/0x4)+-parseInt(_0x2c6120(0x17a))/0x5+-parseInt(_0x2c6120(0x18f))/0x6+parseInt(_0x2c6120(0x194))/0x7*(-parseInt(_0x2c6120(0x18b))/0x8)+parseInt(_0x2c6120(0x184))/0x9;if(_0x8d0f3a===_0x5a6f09)break;else _0x593456['push'](_0x593456['shift']());}catch(_0x1ab30a){_0x593456['push'](_0x593456['shift']());}}}(a160_0x3b3d,0x39ce5));function a160_0x4437(_0x4e0ad6,_0x2875df){_0x4e0ad6=_0x4e0ad6-0x173;const _0x3b3d00=a160_0x3b3d();let _0x4437d9=_0x3b3d00[_0x4e0ad6];return _0x4437d9;}import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';function a160_0x3b3d(){const _0x36c22d=['startsWith','trim','push','content','values','728414nTuLRs','validation','769535PvTcMK','replace','set','test','bytes','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','300089KmSrPL','object','add','utf8','14850927sdgaCP','name','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','from','compare','length','localeCompare','37208IjoBWN','isSafeInteger','isArray','126957dFJrRH','598926VnvgzQ','isDirectory','20RCZkXC','Duplicate\x20Skill\x20file\x20path:\x20','split','427HAfGnQ','toLowerCase','sort','string','has','excludedFilePaths','size','Unsafe\x20Skill\x20file\x20path:\x20','isBuffer','isFile','Skill\x20file\x20path\x20must\x20be\x20text.','path','isSymbolicLink','sha256'];a160_0x3b3d=function(){return _0x36c22d;};return a160_0x3b3d();}import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x3d1e2c){const _0x206c43=a160_0x4437;return _0x3d1e2c[_0x206c43(0x17e)]??Buffer[_0x206c43(0x187)](_0x3d1e2c[_0x206c43(0x176)]??'','utf8');}export function fileText(_0x16f67f){const _0x440241=a160_0x4437;return fileContent(_0x16f67f)['toString'](_0x440241(0x183));}export function normalizeLocalFiles(_0x1491c6){const _0x574ae8=a160_0x4437;if(!Array[_0x574ae8(0x18d)](_0x1491c6)||_0x1491c6[_0x574ae8(0x189)]===0x0)return[];const _0x38408f=new Map();for(const _0x5bfc42 of _0x1491c6){if(!_0x5bfc42||typeof _0x5bfc42!=='object'||typeof _0x5bfc42[_0x574ae8(0x19f)]!==_0x574ae8(0x197))throw CliErrors[_0x574ae8(0x179)](_0x574ae8(0x19e));const _0x2d1849=normalizeSkillRelativePath(_0x5bfc42['path']);if(_0x38408f[_0x574ae8(0x198)](_0x2d1849))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x2d1849);if(_0x5bfc42[_0x574ae8(0x17e)]!==undefined&&!Buffer[_0x574ae8(0x19c)](_0x5bfc42['bytes']))throw CliErrors[_0x574ae8(0x179)](_0x574ae8(0x186)+_0x2d1849);if(_0x5bfc42[_0x574ae8(0x17e)]===undefined&&typeof _0x5bfc42['content']!=='string')throw CliErrors[_0x574ae8(0x179)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x2d1849);const _0x48a39e=fileContent(_0x5bfc42);_0x38408f[_0x574ae8(0x17c)](_0x2d1849,{'path':_0x2d1849,'bytes':_0x48a39e});}return Array[_0x574ae8(0x187)](_0x38408f['values']())[_0x574ae8(0x196)](compareSkillFiles);}export function normalizeManifestFiles(_0xe3e5fa){const _0x3278fa=a160_0x4437;if(!Array[_0x3278fa(0x18d)](_0xe3e5fa)||_0xe3e5fa[_0x3278fa(0x189)]===0x0)return[];const _0x34ca63=new Map();for(const _0x719396 of _0xe3e5fa){if(!_0x719396||typeof _0x719396!==_0x3278fa(0x181)||typeof _0x719396[_0x3278fa(0x19f)]!==_0x3278fa(0x197))throw CliErrors[_0x3278fa(0x179)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x4f2cd4=normalizeSkillRelativePath(_0x719396[_0x3278fa(0x19f)]);if(_0x34ca63[_0x3278fa(0x198)](_0x4f2cd4))throw CliErrors[_0x3278fa(0x179)](_0x3278fa(0x192)+_0x4f2cd4);if(!isSha256Hex(_0x719396['sha256']))throw CliErrors[_0x3278fa(0x179)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x4f2cd4);if(!Number[_0x3278fa(0x18c)](_0x719396[_0x3278fa(0x19a)])||_0x719396[_0x3278fa(0x19a)]<0x0)throw CliErrors[_0x3278fa(0x179)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x4f2cd4);_0x34ca63['set'](_0x4f2cd4,{'path':_0x4f2cd4,'sha256':_0x719396[_0x3278fa(0x1a1)][_0x3278fa(0x195)](),'size':_0x719396['size']});}return Array[_0x3278fa(0x187)](_0x34ca63[_0x3278fa(0x177)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x1f8eb9,_0xc29389={}){const _0x3edfb5=a160_0x4437,_0x4a9b83=realpathSync(_0x1f8eb9),_0x44879a=canonicalExcludedFilePaths(_0xc29389[_0x3edfb5(0x199)]),_0x2f06ed=[];function _0x4f81e5(_0xd6a9de){const _0x36213c=_0x3edfb5,_0x5da983=readdirSync(_0xd6a9de,{'withFileTypes':!![]})['sort']((_0x34d4b7,_0x4e6576)=>_0x34d4b7['name'][_0x36213c(0x18a)](_0x4e6576[_0x36213c(0x185)]));for(const _0x19932b of _0x5da983){if(_0x19932b['isDirectory']()&&IGNORED_DIR_NAMES[_0x36213c(0x198)](_0x19932b[_0x36213c(0x185)]))continue;if(IGNORED_FILE_NAMES['has'](_0x19932b[_0x36213c(0x185)]))continue;const _0x56ac22=resolve(_0xd6a9de,_0x19932b['name']);if(isExcludedFilePath(_0x56ac22,_0x44879a))continue;if(_0x19932b[_0x36213c(0x1a0)]())throw CliErrors[_0x36213c(0x179)](_0x36213c(0x17f)+_0x56ac22);const _0xc0744b=toPosixPath(relative(_0x4a9b83,_0x56ac22));if(_0x19932b[_0x36213c(0x190)]()){_0x4f81e5(_0x56ac22);continue;}if(!_0x19932b[_0x36213c(0x19d)]())continue;validateSkillRelativePath(_0xc0744b);const _0x1e616d=readFileSync(_0x56ac22);_0x2f06ed[_0x36213c(0x175)]({'path':_0xc0744b,'bytes':_0x1e616d});}}return _0x4f81e5(_0x4a9b83),normalizeLocalFiles(_0x2f06ed);}function canonicalExcludedFilePaths(_0x2c8912){const _0x49e9a5=a160_0x4437,_0x25eaec=new Set();for(const _0x2ad8d3 of _0x2c8912??[]){const _0xea8048=resolve(_0x2ad8d3);_0x25eaec[_0x49e9a5(0x182)](_0xea8048);try{_0x25eaec[_0x49e9a5(0x182)](realpathSync(_0xea8048));}catch{}}return _0x25eaec;}function isExcludedFilePath(_0x5b445d,_0x381261){const _0x2f691b=a160_0x4437;if(_0x381261[_0x2f691b(0x198)](_0x5b445d))return!![];if(_0x381261[_0x2f691b(0x19a)]===0x0)return![];try{return _0x381261[_0x2f691b(0x198)](realpathSync(_0x5b445d));}catch{return![];}}export function compareSkillFiles(_0x225afb,_0x5aa95e){const _0x2e570d=a160_0x4437;if(_0x225afb[_0x2e570d(0x19f)]===SKILL_FILE)return _0x5aa95e[_0x2e570d(0x19f)]===SKILL_FILE?0x0:-0x1;if(_0x5aa95e['path']===SKILL_FILE)return 0x1;return Buffer[_0x2e570d(0x188)](Buffer[_0x2e570d(0x187)](_0x225afb[_0x2e570d(0x19f)],_0x2e570d(0x183)),Buffer[_0x2e570d(0x187)](_0x5aa95e[_0x2e570d(0x19f)],_0x2e570d(0x183)));}export function normalizeSkillRelativePath(_0x14c0ea){const _0x438b7c=a160_0x4437,_0x2ba26f=toPosixPath(_0x14c0ea[_0x438b7c(0x174)]());return validateSkillRelativePath(_0x2ba26f),_0x2ba26f;}export function validateSkillRelativePath(_0x359029){const _0x7ca602=a160_0x4437;if(!_0x359029||_0x359029[_0x7ca602(0x173)]('/')||_0x359029['includes']('//'))throw CliErrors['validation'](_0x7ca602(0x19b)+_0x359029);for(const _0x4fa18a of _0x359029[_0x7ca602(0x193)]('/')){if(!_0x4fa18a||_0x4fa18a==='.'||_0x4fa18a==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x359029);}}export function toPosixPath(_0x376721){const _0x2c709e=a160_0x4437;return _0x376721[_0x2c709e(0x17b)](/\\/g,'/');}export function isSha256Hex(_0x256443){const _0x9a37f3=a160_0x4437;return typeof _0x256443===_0x9a37f3(0x197)&&/^[a-fA-F0-9]{64}$/[_0x9a37f3(0x17d)](_0x256443);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xa71e99,_0x5ad010){const _0x577168=a161_0x472d,_0xd588dd=_0xa71e99();while(!![]){try{const _0x4da921=-parseInt(_0x577168(0x1bb))/0x1*(parseInt(_0x577168(0x1e8))/0x2)+parseInt(_0x577168(0x1dd))/0x3*(parseInt(_0x577168(0x1d1))/0x4)+-parseInt(_0x577168(0x1be))/0x5*(-parseInt(_0x577168(0x1e9))/0x6)+-parseInt(_0x577168(0x1c2))/0x7*(-parseInt(_0x577168(0x1ea))/0x8)+-parseInt(_0x577168(0x1d9))/0x9*(-parseInt(_0x577168(0x1f8))/0xa)+parseInt(_0x577168(0x1f1))/0xb*(-parseInt(_0x577168(0x1f7))/0xc)+-parseInt(_0x577168(0x1b6))/0xd*(parseInt(_0x577168(0x1c0))/0xe);if(_0x4da921===_0x5ad010)break;else _0xd588dd['push'](_0xd588dd['shift']());}catch(_0x4fa1ae){_0xd588dd['push'](_0xd588dd['shift']());}}}(a161_0x12b3,0xa05bc));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';function a161_0x472d(_0x9d41da,_0x5223a7){_0x9d41da=_0x9d41da-0x1b6;const _0x12b307=a161_0x12b3();let _0x472d55=_0x12b307[_0x9d41da];return _0x472d55;}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(_0x184598,_0x4f0ac2,_0x24f1d6){const _0x358cc7=a161_0x472d,_0x5a65d3=requireSkillCode(_0x184598),_0xc482b9=requirePackageBytes(_0x5a65d3,_0x24f1d6[_0x358cc7(0x1e5)]),_0x14afb9=extractDownloadedPackage(_0xc482b9),_0x52bae4=_0x14afb9[_0x358cc7(0x1de)](_0x12f794=>_0x12f794['path']===SKILL_FILE);if(!_0x52bae4)throw CliErrors['validation'](_0x358cc7(0x1f2)+SKILL_FILE+':\x20'+_0x5a65d3);const _0x331e38=withMaterializedSkillFrontmatter(_0x14afb9,_0x184598,_0x5a65d3),_0x95e411=_0x331e38[_0x358cc7(0x1de)](_0x464f31=>_0x464f31[_0x358cc7(0x1e1)]===SKILL_FILE),_0x2a01c6=fileText(_0x95e411),_0x147ec8=getRuntimeSkillDir(_0x24f1d6['env'],_0x24f1d6['accessKey'],_0x24f1d6[_0x358cc7(0x1f0)],_0x4f0ac2,_0x5a65d3,_0x24f1d6[_0x358cc7(0x1da)]),_0x48187c=resolve(_0x147ec8,SKILL_FILE),_0x1e9d7a=resolve(_0x147ec8,METADATA_FILE),_0x298cb3=contentHash(_0x2a01c6),_0x55b7f2=readMetadataIfPresent(_0x1e9d7a)?.[_0x358cc7(0x1cb)];ensurePulledFilesCanBeOverwritten(_0x147ec8,_0x1e9d7a,_0x331e38,_0x24f1d6[_0x358cc7(0x1d3)]===!![]),mkdirSync(_0x147ec8,{'recursive':!![],'mode':0x1c0});const _0x9582c3=existsSync(_0x48187c)?readFileSync(_0x48187c,_0x358cc7(0x1df)):undefined;return materializeFiles(_0x147ec8,_0x331e38),removeStaleManagedFiles(_0x147ec8,_0x55b7f2,_0x331e38),writeJsonAtomic(_0x1e9d7a,buildMetadata(_0x184598,_0x4f0ac2,_0x24f1d6[_0x358cc7(0x1f0)],_0x298cb3,_0x24f1d6[_0x358cc7(0x1ba)],_0x331e38,_0xc482b9)),{'skill':_0x184598,'scope':_0x4f0ac2,'dir':_0x147ec8,'skillMdPath':_0x48187c,'metadataPath':_0x1e9d7a,'contentHash':_0x298cb3,'changed':_0x9582c3!==_0x2a01c6};}export function reuseMaterializedRuntimeSkill(_0x336624,_0x4b84e,_0x1581ce){const _0x46646b=a161_0x472d,_0x2650dc=_0x336624[_0x46646b(0x1d5)]?.[_0x46646b(0x1c3)]();if(!_0x2650dc)return undefined;const _0x2db5b4=requireSkillCode(_0x336624),_0x2a0672=getRuntimeSkillDir(_0x1581ce[_0x46646b(0x1e6)],_0x1581ce[_0x46646b(0x1bd)],_0x1581ce[_0x46646b(0x1f0)],_0x4b84e,_0x2db5b4,_0x1581ce[_0x46646b(0x1da)]),_0x1e636f=resolve(_0x2a0672,SKILL_FILE),_0x5557f2=resolve(_0x2a0672,METADATA_FILE),_0x59c05e=readMetadataIfPresent(_0x5557f2);if(!_0x59c05e||_0x59c05e[_0x46646b(0x1e3)]!==0x2||_0x59c05e[_0x46646b(0x1f0)]!==_0x1581ce[_0x46646b(0x1f0)]||_0x59c05e['scope']!==_0x4b84e||_0x59c05e[_0x46646b(0x1d0)]!==_0x2db5b4||_0x59c05e[_0x46646b(0x1d5)]!==_0x2650dc||_0x59c05e['id']!==_0x336624['id']||_0x59c05e[_0x46646b(0x1dc)]!==_0x336624['skillName']||_0x59c05e[_0x46646b(0x1ce)]!==_0x336624[_0x46646b(0x1ce)]||_0x59c05e['example']!==_0x336624[_0x46646b(0x1eb)]||_0x59c05e[_0x46646b(0x1b7)]!==_0x336624[_0x46646b(0x1b7)]||!_0x59c05e[_0x46646b(0x1c4)]||!_0x59c05e[_0x46646b(0x1cb)]||!Object[_0x46646b(0x1d2)](_0x59c05e['fileHashes'],SKILL_FILE))return undefined;for(const [_0x28f4c4,_0x3951f3]of Object[_0x46646b(0x1c5)](_0x59c05e[_0x46646b(0x1cb)])){if(!/^[a-f0-9]{64}$/['test'](_0x3951f3))return undefined;const _0x1f04b7=resolveManagedFilePath(_0x2a0672,_0x28f4c4);if(!existsSync(_0x1f04b7)||!lstatSync(_0x1f04b7)[_0x46646b(0x1f4)]())return undefined;if(bufferSha256(readFileSync(_0x1f04b7))!==_0x3951f3)return undefined;}return{'skill':_0x336624,'scope':_0x4b84e,'dir':_0x2a0672,'skillMdPath':_0x1e636f,'metadataPath':_0x5557f2,'contentHash':_0x59c05e[_0x46646b(0x1c4)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x586722,_0x1dce6e,_0x555962){const _0x9ad1c1=a161_0x472d,_0x20df1a=skillDisplayName(_0x1dce6e,_0x555962),_0x2c8497=_0x1dce6e[_0x9ad1c1(0x1ce)]?.[_0x9ad1c1(0x1c3)]()||_0x20df1a||_0x555962;return normalizeLocalFiles(_0x586722)[_0x9ad1c1(0x1f3)](_0x36af62=>{const _0x1e4722=_0x9ad1c1,_0x4b6a38=fileText(_0x36af62);if(_0x36af62['path']!==SKILL_FILE)return _0x36af62;if(hasYamlFrontmatter(_0x4b6a38))return{'path':_0x36af62[_0x1e4722(0x1e1)],'content':withSyncedDisplayName(_0x4b6a38,_0x20df1a)};return{'path':_0x36af62[_0x1e4722(0x1e1)],'content':prependSkillFrontmatter(_0x4b6a38,{'name':_0x555962,'displayName':_0x20df1a,'description':_0x2c8497})};});}function hasYamlFrontmatter(_0x532cb6){const _0x20b69d=a161_0x472d;return/^\uFEFF?---\s*\r?\n/[_0x20b69d(0x1b9)](_0x532cb6);}function prependSkillFrontmatter(_0x30e476,_0x45994a){const _0x8d00bd=a161_0x472d,_0x57a4d7=_0x30e476[_0x8d00bd(0x1ca)](/^\uFEFF/,'');return[_0x8d00bd(0x1ec),_0x8d00bd(0x1c7)+yamlString(_0x45994a['name']),_0x45994a[_0x8d00bd(0x1d8)]?_0x8d00bd(0x1c1)+yamlString(_0x45994a[_0x8d00bd(0x1d8)]):undefined,'description:\x20'+yamlString(_0x45994a[_0x8d00bd(0x1ce)]),_0x8d00bd(0x1ec),'',_0x57a4d7][_0x8d00bd(0x1cd)](_0xa0211c=>_0xa0211c!==undefined)[_0x8d00bd(0x1ed)]('\x0a');}function yamlString(_0x1beb60){const _0x65c76e=a161_0x472d;return JSON[_0x65c76e(0x1ef)](_0x1beb60[_0x65c76e(0x1ca)](/\r/g,'')['trim']());}function skillDisplayName(_0x5f13e2,_0x2e52e3){const _0x2c4cdf=a161_0x472d,_0x43a170=_0x5f13e2[_0x2c4cdf(0x1dc)]?.[_0x2c4cdf(0x1c3)]();return _0x43a170||_0x2e52e3;}function a161_0x12b3(){const _0x434f96=['appCode','3773sjBydU','Runtime\x20Skill\x20package\x20is\x20missing\x20','map','isFile','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','---\x0a','34260KVgbVW','11150NHqhjt','3211zqlyeD','status','delete','test','pulledAt','1131721FoXGBf','validation','accessKey','1218875JNmwGJ','set','35854tznUzN','displayName:\x20','14KpZFel','trim','contentHash','entries','length','name:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','errors','replace','fileHashes','slice','filter','description','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','skillCode','161612hUQGyW','hasOwn','force','has','version','flow','toString','displayName','9495XTemXQ','paths','keys','skillName','69CHmnEm','find','utf8','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','path','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','schemaVersion','trimEnd','packageBytes','env','\x0a---\x0a\x0a','2oWYxoz','30JhbPWk','303648eyZEzp','example','---','join','Managed\x20file\x20was\x20removed\x20locally:\x20','stringify'];a161_0x12b3=function(){return _0x434f96;};return a161_0x12b3();}function withSyncedDisplayName(_0xe5f9fe,_0x2f9e33){const _0x221169=a161_0x472d,_0x3ef56c=_0xe5f9fe['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3ef56c)return _0xe5f9fe;const _0x419af8=_0x3ef56c[0x1]??'',_0x4e2f37=_0x3ef56c[0x2]??'',_0x156c67=parseDocument(_0x4e2f37);if(_0x156c67[_0x221169(0x1c9)][_0x221169(0x1c6)]>0x0||!isMap(_0x156c67['contents']))return _0xe5f9fe;if(_0x2f9e33)_0x156c67[_0x221169(0x1bf)]('displayName',_0x2f9e33);else{if(_0x156c67[_0x221169(0x1d4)]('displayName'))_0x156c67[_0x221169(0x1b8)](_0x221169(0x1d8));else return _0xe5f9fe;}forceBlockCollections(_0x156c67['contents']);const _0x5e825e=_0x156c67[_0x221169(0x1d7)]({'lineWidth':0x0})[_0x221169(0x1e4)](),_0x3773d7=_0xe5f9fe[_0x221169(0x1cc)](_0x3ef56c[0x0][_0x221169(0x1c6)])['replace'](/^\r?\n/,'');return _0x419af8+_0x221169(0x1f6)+_0x5e825e+_0x221169(0x1e7)+_0x3773d7;}function forceBlockCollections(_0x1bf774){if(!isNode(_0x1bf774))return;visit(_0x1bf774,(_0x1d1a82,_0x2490b2)=>{const _0x5a5a8c=a161_0x472d;isCollection(_0x2490b2)&&(_0x2490b2[_0x5a5a8c(0x1d6)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0xc623fc,_0x573d3e,_0x1cffff,_0x1526f2){const _0x137be2=a161_0x472d;if(_0x1526f2||!existsSync(_0x573d3e))return;const _0x46c305=readMetadataIfPresent(_0x573d3e);if(!_0x46c305)return;const _0x190a50=_0x46c305[_0x137be2(0x1cb)]&&Object[_0x137be2(0x1db)](_0x46c305['fileHashes'])['length']>0x0?_0x46c305[_0x137be2(0x1cb)]:undefined;if(_0x190a50)for(const [_0x2108de,_0xf6aad5]of Object['entries'](_0x190a50)){const _0x1981ca=resolveManagedFilePath(_0xc623fc,_0x2108de);if(!existsSync(_0x1981ca))throw CliErrors[_0x137be2(0x1bc)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0xc623fc,_0x137be2(0x1ee)+_0x2108de);const _0x11e323=lstatSync(_0x1981ca);if(!_0x11e323['isFile']())throw CliErrors[_0x137be2(0x1bc)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0xc623fc,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x2108de);const _0x5670e9=bufferSha256(readFileSync(_0x1981ca));if(_0x5670e9!==_0xf6aad5)throw CliErrors[_0x137be2(0x1bc)](_0x137be2(0x1c8)+_0xc623fc+'.\x20Changed\x20file:\x20'+_0x2108de,_0x137be2(0x1f5)+_0x2108de);}else{const _0x2c5715=resolve(_0xc623fc,SKILL_FILE);if(existsSync(_0x2c5715)&&_0x46c305[_0x137be2(0x1c4)]){const _0x11cb21=contentHash(readFileSync(_0x2c5715,_0x137be2(0x1df)));if(_0x11cb21!==_0x46c305['contentHash'])throw CliErrors[_0x137be2(0x1bc)](_0x137be2(0x1cf)+_0x2c5715,_0x137be2(0x1e2));}}for(const _0x6d3b64 of normalizeLocalFiles(_0x1cffff)){if(_0x190a50?.[_0x6d3b64[_0x137be2(0x1e1)]])continue;if(!_0x190a50&&_0x6d3b64['path']===SKILL_FILE)continue;const _0x1012f2=resolveManagedFilePath(_0xc623fc,_0x6d3b64[_0x137be2(0x1e1)]);if(!existsSync(_0x1012f2))continue;const _0x3ef1ff=lstatSync(_0x1012f2);if(!_0x3ef1ff[_0x137be2(0x1f4)]())throw CliErrors[_0x137be2(0x1bc)](_0x137be2(0x1c8)+_0xc623fc,_0x137be2(0x1e0)+_0x6d3b64[_0x137be2(0x1e1)]);const _0xaef0dc=bufferSha256(readFileSync(_0x1012f2));if(_0xaef0dc!==fileHash(_0x6d3b64))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0xc623fc,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x6d3b64[_0x137be2(0x1e1)]);}}function materializeFiles(_0x312f8c,_0x2c9564){for(const _0x5ebcfc of normalizeLocalFiles(_0x2c9564)){const _0x1db323=resolveManagedFilePath(_0x312f8c,_0x5ebcfc['path']);mkdirSync(dirname(_0x1db323),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1db323,fileContent(_0x5ebcfc),0x180);}}function removeStaleManagedFiles(_0x10182a,_0x4b5cf9,_0x2f48e1){const _0x557e24=a161_0x472d;if(!_0x4b5cf9)return;const _0x139b73=new Set(normalizeLocalFiles(_0x2f48e1)[_0x557e24(0x1f3)](_0x33d773=>_0x33d773[_0x557e24(0x1e1)]));for(const _0x4d9afd of Object['keys'](_0x4b5cf9)){if(_0x139b73['has'](_0x4d9afd))continue;const _0x43b47b=resolveManagedFilePath(_0x10182a,_0x4d9afd);existsSync(_0x43b47b)&&lstatSync(_0x43b47b)[_0x557e24(0x1f4)]()&&rmSync(_0x43b47b,{'force':!![]});}}
|
|
1
|
+
(function(_0x3c49c1,_0x37ec17){const _0x5b366b=a161_0x3b0d,_0x56359d=_0x3c49c1();while(!![]){try{const _0x93869f=parseInt(_0x5b366b(0x128))/0x1+-parseInt(_0x5b366b(0x14d))/0x2*(-parseInt(_0x5b366b(0x14c))/0x3)+parseInt(_0x5b366b(0x138))/0x4+parseInt(_0x5b366b(0x157))/0x5*(-parseInt(_0x5b366b(0x155))/0x6)+-parseInt(_0x5b366b(0x142))/0x7+parseInt(_0x5b366b(0x13f))/0x8*(-parseInt(_0x5b366b(0x148))/0x9)+-parseInt(_0x5b366b(0x132))/0xa*(-parseInt(_0x5b366b(0x12c))/0xb);if(_0x93869f===_0x37ec17)break;else _0x56359d['push'](_0x56359d['shift']());}catch(_0x1a6d1b){_0x56359d['push'](_0x56359d['shift']());}}}(a161_0x3898,0x47893));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a161_0x3b0d(_0x14cf5d,_0x9350df){_0x14cf5d=_0x14cf5d-0x119;const _0x389802=a161_0x3898();let _0x3b0d62=_0x389802[_0x14cf5d];return _0x3b0d62;}import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x4a0a85,_0x966697,_0x2c3ff4){const _0x5482bb=a161_0x3b0d,_0x16e6cd=requireSkillCode(_0x4a0a85),_0x33883c=requirePackageBytes(_0x16e6cd,_0x2c3ff4[_0x5482bb(0x11c)]),_0x58aabb=extractDownloadedPackage(_0x33883c),_0x7aec9d=_0x58aabb[_0x5482bb(0x154)](_0x4b5d8e=>_0x4b5d8e[_0x5482bb(0x14b)]===SKILL_FILE);if(!_0x7aec9d)throw CliErrors[_0x5482bb(0x153)](_0x5482bb(0x13a)+SKILL_FILE+':\x20'+_0x16e6cd);const _0x24d81d=withMaterializedSkillFrontmatter(_0x58aabb,_0x4a0a85,_0x16e6cd),_0x221ee3=_0x24d81d[_0x5482bb(0x154)](_0x1e93c0=>_0x1e93c0['path']===SKILL_FILE),_0x50ae83=fileText(_0x221ee3),_0x27fe61=getRuntimeSkillDir(_0x2c3ff4[_0x5482bb(0x151)],_0x2c3ff4[_0x5482bb(0x146)],_0x2c3ff4[_0x5482bb(0x13e)],_0x966697,_0x16e6cd,_0x2c3ff4[_0x5482bb(0x11a)]),_0x38d3c6=resolve(_0x27fe61,SKILL_FILE),_0x103c8d=resolve(_0x27fe61,METADATA_FILE),_0x1f6c59=contentHash(_0x50ae83),_0x15fdf5=readMetadataIfPresent(_0x103c8d)?.[_0x5482bb(0x156)];ensurePulledFilesCanBeOverwritten(_0x27fe61,_0x103c8d,_0x24d81d,_0x2c3ff4[_0x5482bb(0x122)]===!![]),mkdirSync(_0x27fe61,{'recursive':!![],'mode':0x1c0});const _0x11165e=existsSync(_0x38d3c6)?readFileSync(_0x38d3c6,'utf8'):undefined;return materializeFiles(_0x27fe61,_0x24d81d),removeStaleManagedFiles(_0x27fe61,_0x15fdf5,_0x24d81d),writeJsonAtomic(_0x103c8d,buildMetadata(_0x4a0a85,_0x966697,_0x2c3ff4['appCode'],_0x1f6c59,_0x2c3ff4['pulledAt'],_0x24d81d,_0x33883c)),{'skill':_0x4a0a85,'scope':_0x966697,'dir':_0x27fe61,'skillMdPath':_0x38d3c6,'metadataPath':_0x103c8d,'contentHash':_0x1f6c59,'changed':_0x11165e!==_0x50ae83};}export function reuseMaterializedRuntimeSkill(_0x281d19,_0x504922,_0x5aa10c){const _0x33952e=a161_0x3b0d,_0x39bfa4=_0x281d19[_0x33952e(0x124)]?.['trim']();if(!_0x39bfa4)return undefined;const _0x4da890=requireSkillCode(_0x281d19),_0x6708ae=getRuntimeSkillDir(_0x5aa10c[_0x33952e(0x151)],_0x5aa10c[_0x33952e(0x146)],_0x5aa10c[_0x33952e(0x13e)],_0x504922,_0x4da890,_0x5aa10c[_0x33952e(0x11a)]),_0x41f13d=resolve(_0x6708ae,SKILL_FILE),_0x223fbe=resolve(_0x6708ae,METADATA_FILE),_0x508119=readMetadataIfPresent(_0x223fbe);if(!_0x508119||_0x508119[_0x33952e(0x141)]!==0x2||_0x508119['appCode']!==_0x5aa10c[_0x33952e(0x13e)]||_0x508119[_0x33952e(0x144)]!==_0x504922||_0x508119['skillCode']!==_0x4da890||_0x508119[_0x33952e(0x124)]!==_0x39bfa4||_0x508119['id']!==_0x281d19['id']||_0x508119[_0x33952e(0x150)]!==_0x281d19[_0x33952e(0x150)]||_0x508119[_0x33952e(0x12e)]!==_0x281d19['description']||_0x508119[_0x33952e(0x131)]!==_0x281d19['example']||_0x508119[_0x33952e(0x14f)]!==_0x281d19[_0x33952e(0x14f)]||!_0x508119[_0x33952e(0x12d)]||!_0x508119[_0x33952e(0x156)]||!Object[_0x33952e(0x12a)](_0x508119[_0x33952e(0x156)],SKILL_FILE))return undefined;for(const [_0x1dde9d,_0x54b83e]of Object[_0x33952e(0x119)](_0x508119[_0x33952e(0x156)])){if(!/^[a-f0-9]{64}$/[_0x33952e(0x11b)](_0x54b83e))return undefined;const _0xe6d06d=resolveManagedFilePath(_0x6708ae,_0x1dde9d);if(!existsSync(_0xe6d06d)||!lstatSync(_0xe6d06d)[_0x33952e(0x158)]())return undefined;if(bufferSha256(readFileSync(_0xe6d06d))!==_0x54b83e)return undefined;}return{'skill':_0x281d19,'scope':_0x504922,'dir':_0x6708ae,'skillMdPath':_0x41f13d,'metadataPath':_0x223fbe,'contentHash':_0x508119[_0x33952e(0x12d)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x5f5c10,_0x54f35d,_0x30ff7e){const _0xa49374=a161_0x3b0d,_0x28fb56=skillDisplayName(_0x54f35d,_0x30ff7e),_0x468fed=_0x54f35d[_0xa49374(0x12e)]?.[_0xa49374(0x13c)]()||_0x28fb56||_0x30ff7e;return normalizeLocalFiles(_0x5f5c10)[_0xa49374(0x12b)](_0x21965e=>{const _0x2e297d=_0xa49374,_0x2adbe9=fileText(_0x21965e);if(_0x21965e[_0x2e297d(0x14b)]!==SKILL_FILE)return _0x21965e;if(hasYamlFrontmatter(_0x2adbe9))return{'path':_0x21965e[_0x2e297d(0x14b)],'content':withSyncedDisplayName(_0x2adbe9,_0x28fb56)};return{'path':_0x21965e['path'],'content':prependSkillFrontmatter(_0x2adbe9,{'name':_0x30ff7e,'displayName':_0x28fb56,'description':_0x468fed})};});}function hasYamlFrontmatter(_0x21a38c){const _0x48b761=a161_0x3b0d;return/^\uFEFF?---\s*\r?\n/[_0x48b761(0x11b)](_0x21a38c);}function prependSkillFrontmatter(_0x1cab16,_0xc06c37){const _0x5add66=a161_0x3b0d,_0x2c6a9a=_0x1cab16[_0x5add66(0x13b)](/^\uFEFF/,'');return[_0x5add66(0x12f),'name:\x20'+yamlString(_0xc06c37['name']),_0xc06c37['displayName']?_0x5add66(0x130)+yamlString(_0xc06c37[_0x5add66(0x149)]):undefined,_0x5add66(0x139)+yamlString(_0xc06c37[_0x5add66(0x12e)]),_0x5add66(0x12f),'',_0x2c6a9a][_0x5add66(0x136)](_0x3d4a92=>_0x3d4a92!==undefined)[_0x5add66(0x14a)]('\x0a');}function yamlString(_0x51bfb1){const _0xd7dc=a161_0x3b0d;return JSON[_0xd7dc(0x127)](_0x51bfb1[_0xd7dc(0x13b)](/\r/g,'')['trim']());}function skillDisplayName(_0x53808d,_0x1402cd){const _0x56cf79=a161_0x3b0d,_0x2d5e14=_0x53808d['skillName']?.[_0x56cf79(0x13c)]();return _0x2d5e14||_0x1402cd;}function withSyncedDisplayName(_0x226e36,_0x453053){const _0x49bd1c=a161_0x3b0d,_0x4e0111=_0x226e36[_0x49bd1c(0x147)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4e0111)return _0x226e36;const _0x1b979d=_0x4e0111[0x1]??'',_0x2864bd=_0x4e0111[0x2]??'',_0x28f6e6=parseDocument(_0x2864bd);if(_0x28f6e6[_0x49bd1c(0x14e)][_0x49bd1c(0x137)]>0x0||!isMap(_0x28f6e6[_0x49bd1c(0x143)]))return _0x226e36;if(_0x453053)_0x28f6e6['set'](_0x49bd1c(0x149),_0x453053);else{if(_0x28f6e6[_0x49bd1c(0x123)]('displayName'))_0x28f6e6[_0x49bd1c(0x11f)](_0x49bd1c(0x149));else return _0x226e36;}forceBlockCollections(_0x28f6e6['contents']);const _0x54f7c0=_0x28f6e6[_0x49bd1c(0x11d)]({'lineWidth':0x0})[_0x49bd1c(0x133)](),_0x4fbe3d=_0x226e36[_0x49bd1c(0x145)](_0x4e0111[0x0][_0x49bd1c(0x137)])[_0x49bd1c(0x13b)](/^\r?\n/,'');return _0x1b979d+_0x49bd1c(0x135)+_0x54f7c0+_0x49bd1c(0x152)+_0x4fbe3d;}function a161_0x3898(){const _0x233b9a=['filter','length','1048340rvLxOS','description:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','replace','trim','Managed\x20file\x20was\x20removed\x20locally:\x20','appCode','376qpHTvj','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','schemaVersion','1195845eVkzga','contents','scope','slice','accessKey','match','63531JmaSXg','displayName','join','path','119319mmrxxx','8xovYaJ','errors','status','skillName','env','\x0a---\x0a\x0a','validation','find','1206iKRmIV','fileHashes','5165fdRGxv','isFile','entries','paths','test','packageBytes','toString','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','delete','.\x20Changed\x20file:\x20','utf8','force','has','version','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','stringify','290563FlVxAZ','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','hasOwn','map','246664kPWnRN','contentHash','description','---','displayName:\x20','example','130IpZaUb','trimEnd','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','---\x0a'];a161_0x3898=function(){return _0x233b9a;};return a161_0x3898();}function forceBlockCollections(_0x19361b){if(!isNode(_0x19361b))return;visit(_0x19361b,(_0xb790eb,_0x489349)=>{isCollection(_0x489349)&&(_0x489349['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x559113,_0x197240,_0xe74325,_0x2fb8a7){const _0x38652d=a161_0x3b0d;if(_0x2fb8a7||!existsSync(_0x197240))return;const _0x3d636e=readMetadataIfPresent(_0x197240);if(!_0x3d636e)return;const _0xcc0a0d=_0x3d636e[_0x38652d(0x156)]&&Object['keys'](_0x3d636e[_0x38652d(0x156)])[_0x38652d(0x137)]>0x0?_0x3d636e[_0x38652d(0x156)]:undefined;if(_0xcc0a0d)for(const [_0x434e30,_0x47acdf]of Object['entries'](_0xcc0a0d)){const _0x2ceeea=resolveManagedFilePath(_0x559113,_0x434e30);if(!existsSync(_0x2ceeea))throw CliErrors[_0x38652d(0x153)](_0x38652d(0x140)+_0x559113,_0x38652d(0x13d)+_0x434e30);const _0x2263dd=lstatSync(_0x2ceeea);if(!_0x2263dd[_0x38652d(0x158)]())throw CliErrors[_0x38652d(0x153)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x559113,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x434e30);const _0x1ee50b=bufferSha256(readFileSync(_0x2ceeea));if(_0x1ee50b!==_0x47acdf)throw CliErrors[_0x38652d(0x153)](_0x38652d(0x140)+_0x559113+_0x38652d(0x120)+_0x434e30,_0x38652d(0x129)+_0x434e30);}else{const _0x471f1f=resolve(_0x559113,SKILL_FILE);if(existsSync(_0x471f1f)&&_0x3d636e['contentHash']){const _0x14c3d8=contentHash(readFileSync(_0x471f1f,_0x38652d(0x121)));if(_0x14c3d8!==_0x3d636e[_0x38652d(0x12d)])throw CliErrors['validation'](_0x38652d(0x126)+_0x471f1f,_0x38652d(0x134));}}for(const _0x2b5c3b of normalizeLocalFiles(_0xe74325)){if(_0xcc0a0d?.[_0x2b5c3b[_0x38652d(0x14b)]])continue;if(!_0xcc0a0d&&_0x2b5c3b[_0x38652d(0x14b)]===SKILL_FILE)continue;const _0x5930a7=resolveManagedFilePath(_0x559113,_0x2b5c3b['path']);if(!existsSync(_0x5930a7))continue;const _0x2b8ca8=lstatSync(_0x5930a7);if(!_0x2b8ca8['isFile']())throw CliErrors['validation'](_0x38652d(0x140)+_0x559113,_0x38652d(0x125)+_0x2b5c3b['path']);const _0x15bc05=bufferSha256(readFileSync(_0x5930a7));if(_0x15bc05!==fileHash(_0x2b5c3b))throw CliErrors[_0x38652d(0x153)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x559113,_0x38652d(0x11e)+_0x2b5c3b[_0x38652d(0x14b)]);}}function materializeFiles(_0x241f1,_0x4f6da7){const _0x28d632=a161_0x3b0d;for(const _0x435cf5 of normalizeLocalFiles(_0x4f6da7)){const _0x1fe5e0=resolveManagedFilePath(_0x241f1,_0x435cf5[_0x28d632(0x14b)]);mkdirSync(dirname(_0x1fe5e0),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1fe5e0,fileContent(_0x435cf5),0x180);}}function removeStaleManagedFiles(_0x2aed1e,_0x5d209a,_0x1ed285){const _0x9f989f=a161_0x3b0d;if(!_0x5d209a)return;const _0x583b02=new Set(normalizeLocalFiles(_0x1ed285)[_0x9f989f(0x12b)](_0x219929=>_0x219929[_0x9f989f(0x14b)]));for(const _0x319d54 of Object['keys'](_0x5d209a)){if(_0x583b02['has'](_0x319d54))continue;const _0x8f56d8=resolveManagedFilePath(_0x2aed1e,_0x319d54);existsSync(_0x8f56d8)&&lstatSync(_0x8f56d8)[_0x9f989f(0x158)]()&&rmSync(_0x8f56d8,{'force':!![]});}}
|