@lovrabet/lovrabet-cli 2.3.8-beta.5 → 2.3.8-beta.7
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 +3 -3
- 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
|
+
const a150_0x131b16=a150_0x8ac0;(function(_0x115342,_0x4cc29a){const _0x24f3ff=a150_0x8ac0,_0x39432c=_0x115342();while(!![]){try{const _0x4bf237=parseInt(_0x24f3ff(0x141))/0x1+-parseInt(_0x24f3ff(0x112))/0x2*(parseInt(_0x24f3ff(0x15d))/0x3)+-parseInt(_0x24f3ff(0x130))/0x4*(parseInt(_0x24f3ff(0x106))/0x5)+-parseInt(_0x24f3ff(0x11b))/0x6+-parseInt(_0x24f3ff(0x168))/0x7*(parseInt(_0x24f3ff(0x100))/0x8)+-parseInt(_0x24f3ff(0x16c))/0x9+parseInt(_0x24f3ff(0x159))/0xa*(parseInt(_0x24f3ff(0x107))/0xb);if(_0x4bf237===_0x4cc29a)break;else _0x39432c['push'](_0x39432c['shift']());}catch(_0x5939da){_0x39432c['push'](_0x39432c['shift']());}}}(a150_0x13ee,0x24e25));import{randomBytes,randomUUID}from'node:crypto';function a150_0x8ac0(_0x3a3640,_0x35efb8){_0x3a3640=_0x3a3640-0xf0;const _0x13ee65=a150_0x13ee();let _0x8ac0f=_0x13ee65[_0x3a3640];return _0x8ac0f;}import{lstat,open,readFile,realpath,rename,unlink}from'node:fs/promises';import{resolve,dirname,basename}from'node:path';export function canonical(_0x23dc1d){const _0x47ef73=a150_0x8ac0;if(Array[_0x47ef73(0x138)](_0x23dc1d))return'['+_0x23dc1d[_0x47ef73(0x115)](canonical)[_0x47ef73(0x104)](',')+']';if(_0x23dc1d&&typeof _0x23dc1d===_0x47ef73(0x131))return'{'+Object[_0x47ef73(0x122)](_0x23dc1d)[_0x47ef73(0x15a)]()[_0x47ef73(0x115)](_0x524eb3=>JSON[_0x47ef73(0x17b)](_0x524eb3)+':'+canonical(_0x23dc1d[_0x524eb3]))[_0x47ef73(0x104)](',')+'}';return JSON[_0x47ef73(0x17b)](_0x23dc1d)??'undefined';}const EMPTY_IMAGE_LOCATION_FIELDS=new Set(['time',a150_0x131b16(0x120),a150_0x131b16(0x15b),a150_0x131b16(0xf5),a150_0x131b16(0x14b),a150_0x131b16(0x10d),a150_0x131b16(0x13d),a150_0x131b16(0x10f),a150_0x131b16(0x105),a150_0x131b16(0x10a),a150_0x131b16(0x119),'netType','resultCode',a150_0x131b16(0x161),a150_0x131b16(0x177),a150_0x131b16(0x155),a150_0x131b16(0x144),a150_0x131b16(0x149),a150_0x131b16(0x123),a150_0x131b16(0x136)]);export function sameImportValue(_0x3068f4,_0x489f16,_0x1327e8=![]){const _0x59b311=a150_0x131b16;if(_0x1327e8){const _0x4ac820=_0x47fe83=>Array[_0x59b311(0x138)](_0x47fe83)?_0x47fe83[_0x59b311(0x115)](_0x2affd5=>{const _0x3ec7e7=_0x59b311;if(!_0x2affd5||typeof _0x2affd5!==_0x3ec7e7(0x131)||Array[_0x3ec7e7(0x138)](_0x2affd5))return _0x2affd5;const _0x16dc1c={..._0x2affd5};delete _0x16dc1c[_0x3ec7e7(0x171)],delete _0x16dc1c[_0x3ec7e7(0x151)];if(_0x16dc1c[_0x3ec7e7(0x158)]==='')delete _0x16dc1c[_0x3ec7e7(0x158)];if(_0x16dc1c[_0x3ec7e7(0xf6)]==null)delete _0x16dc1c[_0x3ec7e7(0xf6)];if(_0x16dc1c[_0x3ec7e7(0x154)]==null)delete _0x16dc1c[_0x3ec7e7(0x154)];if(_0x16dc1c['geolocation']==null||typeof _0x16dc1c[_0x3ec7e7(0x15e)]===_0x3ec7e7(0x131)&&!Array[_0x3ec7e7(0x138)](_0x16dc1c[_0x3ec7e7(0x15e)])&&Object[_0x3ec7e7(0x17e)](_0x16dc1c[_0x3ec7e7(0x15e)])[_0x3ec7e7(0xf8)](([_0x1f2f58,_0x5119ff])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x3ec7e7(0x135)](_0x1f2f58)&&_0x5119ff===null))delete _0x16dc1c[_0x3ec7e7(0x15e)];for(const _0x35863d of[_0x3ec7e7(0x10e),_0x3ec7e7(0x110),_0x3ec7e7(0x127)])if(!(_0x35863d in _0x16dc1c))_0x16dc1c[_0x35863d]='';if(_0x16dc1c[_0x3ec7e7(0x134)]==null)_0x16dc1c[_0x3ec7e7(0x134)]=0x0;return _0x16dc1c;}):_0x47fe83;return canonical(_0x4ac820(_0x3068f4))===canonical(_0x4ac820(_0x489f16));}return _0x3068f4===null?_0x489f16===null||_0x489f16===undefined:canonical(_0x489f16)===canonical(_0x3068f4);}async function rejectSymlink(_0x21e12c){const _0x1c857d=a150_0x131b16;try{if((await lstat(_0x21e12c))[_0x1c857d(0x14e)]())throw Error(_0x1c857d(0x12a));}catch(_0x41d9e5){if(_0x41d9e5[_0x1c857d(0x166)]!==_0x1c857d(0x178))throw _0x41d9e5;}}export async function resolveImportOutputPath(_0x557667){return await rejectSymlink(_0x557667),resolve(await realpath(dirname(resolve(_0x557667))),basename(_0x557667));}export function assertImportPaths(_0x1cd525,_0x4ba403,_0x4275db=[]){const _0x5316e5=a150_0x131b16,_0x6c4642=[..._0x4275db,_0x1cd525,_0x4ba403,_0x1cd525+_0x5316e5(0x16e),_0x1cd525+_0x5316e5(0x11c)]['map'](_0x562490=>resolve(_0x562490));if(new Set(_0x6c4642)[_0x5316e5(0x134)]!==_0x6c4642['length'])throw Error('Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.');}export async function saveImportJson(_0x46b925,_0x3cc7de){const _0x90c22c=a150_0x131b16;await rejectSymlink(_0x46b925);const _0x421a17=_0x46b925+'.tmp-'+randomUUID(),_0x354fb9=await open(_0x421a17,'wx',0x180);try{await _0x354fb9[_0x90c22c(0x125)](JSON['stringify'](_0x3cc7de,null,0x2)),await _0x354fb9[_0x90c22c(0x13b)]();}finally{await _0x354fb9[_0x90c22c(0x12e)]();}try{await rename(_0x421a17,_0x46b925);}catch(_0x224b1b){await unlink(_0x421a17)[_0x90c22c(0x102)](()=>{});throw _0x224b1b;}}export async function acquireLock(_0x23530c){const _0x20e9e7=a150_0x131b16,_0x377aea=_0x23530c+_0x20e9e7(0x16e),_0x10c3c6=randomUUID();await rejectSymlink(_0x377aea);const _0x437355=_0x377aea+_0x20e9e7(0x11d);let _0x54ae7f,_0x5b2333;try{try{_0x54ae7f=await open(_0x377aea,'wx',0x180);}catch(_0x25c6a4){if(_0x25c6a4['code']!=='EEXIST')throw _0x25c6a4;try{_0x5b2333=await open(_0x437355,'wx',0x180);}catch(_0x211271){if(_0x211271[_0x20e9e7(0x166)]===_0x20e9e7(0x12b))throw Error(_0x20e9e7(0xfe));throw _0x211271;}await _0x5b2333['writeFile'](JSON['stringify']({'pid':process[_0x20e9e7(0x108)],'token':_0x10c3c6})),await _0x5b2333[_0x20e9e7(0x13b)](),await rejectSymlink(_0x377aea);let _0x5be820;try{_0x5be820=await readFile(_0x377aea,'utf8');}catch(_0x334021){if(_0x334021[_0x20e9e7(0x166)]!==_0x20e9e7(0x178))throw _0x334021;}if(_0x5be820!==undefined){let _0x3017a3;try{_0x3017a3=JSON[_0x20e9e7(0x11e)](_0x5be820);}catch{throw Error(_0x20e9e7(0x114));}if(!_0x3017a3||!Number[_0x20e9e7(0x16a)](_0x3017a3[_0x20e9e7(0x108)])||_0x3017a3[_0x20e9e7(0x108)]<=0x0)throw Error(_0x20e9e7(0xff));try{process[_0x20e9e7(0xfc)](_0x3017a3['pid'],0x0);throw Error(_0x20e9e7(0xf0));}catch(_0xf21176){if(_0xf21176[_0x20e9e7(0x166)]!==_0x20e9e7(0x142))throw _0xf21176;}if(await readFile(_0x377aea,_0x20e9e7(0x129))!==_0x5be820)throw Error(_0x20e9e7(0x13e));await unlink(_0x377aea);}_0x54ae7f=await open(_0x377aea,'wx',0x180);}await _0x54ae7f[_0x20e9e7(0x125)](JSON[_0x20e9e7(0x17b)]({'pid':process['pid'],'token':_0x10c3c6})),await _0x54ae7f[_0x20e9e7(0x13b)]();}finally{try{await _0x54ae7f?.['close']();}finally{if(_0x5b2333)try{await _0x5b2333[_0x20e9e7(0x12e)]();}finally{await unlink(_0x437355);}}}return async()=>{const _0x41eff8=_0x20e9e7;if(JSON['parse'](await readFile(_0x377aea,_0x41eff8(0x129)))[_0x41eff8(0x139)]===_0x10c3c6)await unlink(_0x377aea);};}export function assertImportContract(_0x198637,_0x595861,_0x275c82){const _0x21db76=a150_0x131b16;if(!_0x198637||!(_0x198637[_0x21db76(0x113)]===0x1&&_0x198637['strategy']===_0x21db76(0xfa)||_0x198637['schemaVersion']===0x2&&_0x198637[_0x21db76(0xf1)]==='auto-id-task-marker')||_0x198637[_0x21db76(0x11a)]!==_0x21db76(0x17d)||_0x198637[_0x21db76(0x179)]!==_0x595861||_0x198637[_0x21db76(0x156)]!==_0x275c82||typeof _0x198637[_0x21db76(0xfd)]!==_0x21db76(0x153)||!_0x198637[_0x21db76(0xfd)]||typeof _0x198637[_0x21db76(0x14f)]!==_0x21db76(0x153)||!_0x198637[_0x21db76(0x14f)]||!Number[_0x21db76(0x16a)](_0x198637['maxBatchSize'])||_0x198637[_0x21db76(0x148)]<0x1||_0x198637[_0x21db76(0x148)]>0x3e8||!Number['isSafeInteger'](_0x198637['maxBatchBytes'])||_0x198637[_0x21db76(0x165)]<0x1||_0x198637['maxBatchBytes']>0x14*0x400*0x400)throw Error(_0x21db76(0x16f));}export async function runExcelImport(_0x4912bd){const _0x320219=a150_0x131b16;_0x4912bd={..._0x4912bd,'checkpoint':await resolveImportOutputPath(_0x4912bd[_0x320219(0x121)]),'report':await resolveImportOutputPath(_0x4912bd[_0x320219(0x11f)])};const {manifest:_0x13875d,contract:_0x26c776,api:_0x1f3318}=_0x4912bd;assertImportContract(_0x26c776,_0x4912bd[_0x320219(0x179)],_0x4912bd[_0x320219(0x156)]);if(_0x26c776['schemaVersion']!==0x1)throw Error('The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.');if(_0x13875d[_0x320219(0x137)][_0x320219(0x132)])throw Error(_0x320219(0x170));if(!_0x13875d['rows'][_0x320219(0x132)])throw Error(_0x320219(0x145));if(!Number[_0x320219(0x152)](_0x4912bd[_0x320219(0x14a)])||_0x4912bd[_0x320219(0x14a)]<0x1||_0x4912bd['batchSize']>_0x26c776[_0x320219(0x148)])throw Error(_0x320219(0xf9));for(const _0x220a40 of _0x13875d[_0x320219(0x103)]){if(Buffer[_0x320219(0x14c)](JSON[_0x320219(0x17b)]({'schemaFingerprint':_0x26c776[_0x320219(0x14f)],'items':[{..._0x220a40[_0x320219(0x143)],'id':-0x1fffffffffffff}]}),_0x320219(0x129))>_0x26c776[_0x320219(0x165)])throw Error(_0x320219(0x10c)+_0x220a40[_0x320219(0x17a)]+'\x20exceeds\x20the\x20import\x20request\x20size\x20limit.');}assertImportPaths(_0x4912bd['checkpoint'],_0x4912bd['report']);const _0x20587c={'appCode':_0x4912bd[_0x320219(0x179)],'datasetCode':_0x4912bd[_0x320219(0x156)],'runtimeDomain':_0x4912bd[_0x320219(0x13c)],'actorId':_0x26c776[_0x320219(0xfd)],'fileHash':_0x13875d['fileHash'],'mappingHash':_0x13875d[_0x320219(0xf3)],'schemaHash':_0x13875d[_0x320219(0x10b)],'remoteSchemaHash':_0x26c776[_0x320219(0x14f)],'batchSize':_0x4912bd[_0x320219(0x14a)],'sheet':_0x13875d['sheet']},_0x50c3ce=await acquireLock(_0x4912bd[_0x320219(0x121)]);let _0x4391e8;const _0x50837=Date['now']();let _0x462732=0x0;const _0x43c990=[],_0x4f70aa=()=>({'importId':_0x4391e8?.['importId'],'sourceRows':_0x13875d[_0x320219(0x103)][_0x320219(0x132)],'emptyRows':_0x13875d['emptyRows']['length'],'succeeded':_0x4391e8?.[_0x320219(0x103)][_0x320219(0x174)](_0xa74c8e=>_0xa74c8e[_0x320219(0x160)]===_0x320219(0x157))[_0x320219(0x132)]??0x0,'unknown':_0x4391e8?.[_0x320219(0x103)][_0x320219(0x174)](_0x101ace=>_0x101ace[_0x320219(0x160)]===_0x320219(0x16b))[_0x320219(0x132)]??0x0,'conflicts':_0x4391e8?.['rows']['filter'](_0x4b0046=>_0x4b0046[_0x320219(0x160)]===_0x320219(0xf2))[_0x320219(0x132)]??0x0,'notAttempted':_0x4391e8?.[_0x320219(0x103)][_0x320219(0x174)](_0x31c621=>_0x31c621[_0x320219(0x160)]===_0x320219(0x14d))[_0x320219(0x132)]??_0x13875d['rows']['length'],'batches':_0x462732,'batchResults':_0x43c990,'elapsedMs':Date[_0x320219(0xf7)]()-_0x50837,'checkpoint':resolve(_0x4912bd[_0x320219(0x121)]),'report':resolve(_0x4912bd[_0x320219(0x11f)]),'warnings':_0x13875d[_0x320219(0x150)]});try{await rejectSymlink(_0x4912bd[_0x320219(0x121)]);if(_0x4912bd[_0x320219(0x12f)]){try{_0x4391e8=JSON[_0x320219(0x11e)](await readFile(_0x4912bd[_0x320219(0x121)],'utf8'));}catch{throw Error(_0x320219(0x16d));}if(!_0x4391e8||_0x4391e8[_0x320219(0x162)]!==0x1||typeof _0x4391e8['importId']!=='string'||canonical(_0x4391e8[_0x320219(0x101)])!==canonical(_0x20587c)||!Array[_0x320219(0x138)](_0x4391e8['rows'])||_0x4391e8['rows']['length']!==_0x13875d[_0x320219(0x103)]['length']||new Set(_0x4391e8[_0x320219(0x103)][_0x320219(0x115)](_0x3d5f62=>_0x3d5f62['id']))['size']!==_0x4391e8[_0x320219(0x103)][_0x320219(0x132)]||_0x4391e8[_0x320219(0x103)][_0x320219(0x116)]((_0x506c7f,_0x50a373)=>!Number[_0x320219(0x16a)](_0x506c7f['id'])||_0x506c7f['id']>=0x0||_0x506c7f['rowNumber']!==_0x13875d[_0x320219(0x103)][_0x50a373][_0x320219(0x17a)]||![_0x320219(0x14d),_0x320219(0x16b),_0x320219(0x157),_0x320219(0xf2)][_0x320219(0x140)](_0x506c7f[_0x320219(0x160)])))throw Error(_0x320219(0x169));}else{try{await lstat(_0x4912bd[_0x320219(0x121)]);throw Error(_0x320219(0x173));}catch(_0x544374){if(_0x544374[_0x320219(0x166)]!==_0x320219(0x178))throw _0x544374;}const _0x3fe79e=new Set();_0x4391e8={'version':0x1,'importId':randomUUID(),'binding':_0x20587c,'rows':_0x13875d['rows'][_0x320219(0x115)](_0x16802a=>{const _0x2acabd=_0x320219;let _0xa8f34c;do{_0xa8f34c=-(Number(BigInt('0x'+randomBytes(0x7)['toString'](_0x2acabd(0x126)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x3fe79e['has'](_0xa8f34c));return _0x3fe79e[_0x2acabd(0xfb)](_0xa8f34c),{'id':_0xa8f34c,'rowNumber':_0x16802a[_0x2acabd(0x17a)],'status':'unsent'};})},await saveImportJson(_0x4912bd['checkpoint'],_0x4391e8);}await _0x4912bd[_0x320219(0x15f)]?.();const _0x28bb56=_0x4391e8;if(_0x28bb56['rows']['some'](_0x316a07=>_0x316a07[_0x320219(0x160)]===_0x320219(0xf2)))throw Error(_0x320219(0x109));const _0x584d03=async _0x144a57=>{const _0x303ecf=_0x320219,_0xd753cb=await _0x1f3318[_0x303ecf(0xf4)](_0x144a57[_0x303ecf(0x115)](_0x2ed8f9=>_0x28bb56[_0x303ecf(0x103)][_0x2ed8f9]['id']));if(!Array[_0x303ecf(0x138)](_0xd753cb))throw Error(_0x303ecf(0x111));const _0x36c4c0=new Set(_0x144a57['map'](_0x440605=>_0x28bb56[_0x303ecf(0x103)][_0x440605]['id'])),_0x15372e=new Map();for(const _0x2291af of _0xd753cb){const _0x107604=Number(_0x2291af?.['id']);if(!_0x36c4c0['has'](_0x107604)||_0x15372e[_0x303ecf(0x135)](_0x107604))throw Error(_0x303ecf(0x146));_0x15372e[_0x303ecf(0x17c)](_0x107604,_0x2291af);}for(const _0x2fc597 of _0x144a57){const _0x4eaa67=_0x15372e[_0x303ecf(0x164)](_0x28bb56[_0x303ecf(0x103)][_0x2fc597]['id']);if(!_0x4eaa67)continue;if(_0x28bb56['rows'][_0x2fc597][_0x303ecf(0x160)]===_0x303ecf(0x14d)){_0x28bb56[_0x303ecf(0x103)][_0x2fc597][_0x303ecf(0x160)]='conflict',await saveImportJson(_0x4912bd['checkpoint'],_0x28bb56);throw Error(_0x303ecf(0x124));}const _0x38fa51=_0x13875d['rows'][_0x2fc597][_0x303ecf(0x143)];if(Object[_0x303ecf(0x122)](_0x38fa51)[_0x303ecf(0x116)](_0x4a40b7=>!sameImportValue(_0x38fa51[_0x4a40b7],_0x4eaa67[_0x4a40b7],_0x13875d[_0x303ecf(0x147)]?.[_0x303ecf(0x140)](_0x4a40b7)&&!_0x13875d[_0x303ecf(0x128)]?.[_0x303ecf(0x140)](_0x4a40b7)))){_0x28bb56['rows'][_0x2fc597][_0x303ecf(0x160)]='conflict',await saveImportJson(_0x4912bd[_0x303ecf(0x121)],_0x28bb56);throw Error('Import\x20content\x20conflict\x20at\x20Excel\x20row\x20'+_0x28bb56['rows'][_0x2fc597][_0x303ecf(0x17a)]+'.');}_0x28bb56[_0x303ecf(0x103)][_0x2fc597]['status']=_0x303ecf(0x157);}return await saveImportJson(_0x4912bd['checkpoint'],_0x28bb56),_0x15372e;};if(_0x4912bd[_0x320219(0x12f)])for(let _0x47f93a=0x0;_0x47f93a<_0x28bb56['rows'][_0x320219(0x132)];_0x47f93a+=_0x4912bd['batchSize']){const _0x4aad87=_0x28bb56[_0x320219(0x103)][_0x320219(0x118)](_0x47f93a,_0x47f93a+_0x4912bd[_0x320219(0x14a)])[_0x320219(0x115)]((_0x23140d,_0x24420d)=>_0x47f93a+_0x24420d),_0x5aa243=_0x4aad87[_0x320219(0x174)](_0x1d20f2=>_0x28bb56['rows'][_0x1d20f2][_0x320219(0x160)]===_0x320219(0x157)),_0x4d1ab4=await _0x584d03(_0x4aad87),_0x1d24a8=_0x5aa243[_0x320219(0x174)](_0x2334be=>!_0x4d1ab4[_0x320219(0x135)](_0x28bb56['rows'][_0x2334be]['id']));if(_0x1d24a8['length']){_0x1d24a8['forEach'](_0x53b871=>{const _0x27a03a=_0x320219;_0x28bb56[_0x27a03a(0x103)][_0x53b871][_0x27a03a(0x160)]=_0x27a03a(0xf2);}),await saveImportJson(_0x4912bd[_0x320219(0x121)],_0x28bb56);throw Error(_0x320219(0x117));}}for(let _0x189af3=0x0;_0x189af3<_0x28bb56['rows'][_0x320219(0x132)];){const _0xbfca41=[],_0x4ea1d2=[];while(_0x189af3<_0x28bb56[_0x320219(0x103)][_0x320219(0x132)]&&_0x4ea1d2['length']<_0x4912bd[_0x320219(0x14a)]){const _0x3fc617=_0x189af3++;if(_0x28bb56[_0x320219(0x103)][_0x3fc617]['status']==='succeeded')continue;const _0x26817f={..._0x13875d[_0x320219(0x103)][_0x3fc617][_0x320219(0x143)],'id':_0x28bb56[_0x320219(0x103)][_0x3fc617]['id']};if(Buffer[_0x320219(0x14c)](JSON[_0x320219(0x17b)]({'schemaFingerprint':_0x26c776[_0x320219(0x14f)],'items':[..._0x4ea1d2,_0x26817f]}),_0x320219(0x129))>_0x26c776[_0x320219(0x165)]){if(!_0x4ea1d2[_0x320219(0x132)])throw Error(_0x320219(0x10c)+_0x28bb56['rows'][_0x3fc617][_0x320219(0x17a)]+'\x20exceeds\x20the\x20import\x20request\x20size\x20limit.');_0x189af3--;break;}_0xbfca41['push'](_0x3fc617),_0x4ea1d2[_0x320219(0x12c)](_0x26817f);}if(!_0x4ea1d2[_0x320219(0x132)])continue;const _0x7f2c08=_0xbfca41['filter'](_0x490401=>_0x28bb56[_0x320219(0x103)][_0x490401][_0x320219(0x160)]===_0x320219(0x14d));if(_0x7f2c08['length']){const _0x23550f=await _0x1f3318['readback'](_0x7f2c08['map'](_0x2d7627=>_0x28bb56['rows'][_0x2d7627]['id']));if(!Array[_0x320219(0x138)](_0x23550f))throw Error(_0x320219(0x111));if(_0x23550f[_0x320219(0x132)])throw Error(_0x320219(0x124));}_0xbfca41[_0x320219(0x12d)](_0x3ca260=>{const _0x18ea40=_0x320219;_0x28bb56[_0x18ea40(0x103)][_0x3ca260][_0x18ea40(0x160)]=_0x18ea40(0x16b);}),await saveImportJson(_0x4912bd[_0x320219(0x121)],_0x28bb56),_0x462732++;const _0x4c4aca=Date[_0x320219(0xf7)](),_0x53443c={'batch':_0x462732,'rowStart':_0x28bb56['rows'][_0xbfca41[0x0]][_0x320219(0x17a)],'rowEnd':_0x28bb56[_0x320219(0x103)][_0xbfca41[_0xbfca41['length']-0x1]][_0x320219(0x17a)],'count':_0x4ea1d2['length'],'bytes':Buffer[_0x320219(0x14c)](JSON[_0x320219(0x17b)]({'schemaFingerprint':_0x26c776[_0x320219(0x14f)],'items':_0x4ea1d2}),_0x320219(0x129)),'elapsedMs':0x0,'status':_0x320219(0x176)};_0x43c990['push'](_0x53443c);try{const _0x3aa8ed=await _0x1f3318[_0x320219(0x13a)](_0x4ea1d2);if(!_0x3aa8ed||_0x3aa8ed[_0x320219(0x15c)]!==_0x4ea1d2[_0x320219(0x132)]||!Array['isArray'](_0x3aa8ed['ids'])||_0x3aa8ed['ids'][_0x320219(0x132)]!==_0x4ea1d2[_0x320219(0x132)]||_0x3aa8ed['ids'][_0x320219(0x116)]((_0x1a834d,_0x1aa398)=>Number(_0x1a834d)!==_0x28bb56['rows'][_0xbfca41[_0x1aa398]]['id']))throw Error(_0x320219(0x13f));await _0x584d03(_0xbfca41);if(_0xbfca41[_0x320219(0x116)](_0x3c3202=>_0x28bb56['rows'][_0x3c3202][_0x320219(0x160)]!=='succeeded'))throw Error(_0x320219(0x172));}catch(_0x20056e){if(_0x28bb56[_0x320219(0x103)][_0x320219(0x116)](_0x5f4c2a=>_0x5f4c2a[_0x320219(0x160)]==='conflict'))throw _0x20056e;try{await _0x584d03(_0xbfca41);}catch(_0x5544b5){if(_0x28bb56[_0x320219(0x103)]['some'](_0x2acc27=>_0x2acc27[_0x320219(0x160)]===_0x320219(0xf2)))throw _0x5544b5;}if(_0xbfca41['some'](_0x161511=>_0x28bb56[_0x320219(0x103)][_0x161511]['status']!==_0x320219(0x157)))throw Error(_0x320219(0x175));}finally{_0x53443c[_0x320219(0x167)]=Date[_0x320219(0xf7)]()-_0x4c4aca;if(_0xbfca41[_0x320219(0xf8)](_0x1e229d=>_0x28bb56['rows'][_0x1e229d][_0x320219(0x160)]==='succeeded'))_0x53443c[_0x320219(0x160)]=_0x320219(0x157);else{if(_0xbfca41[_0x320219(0x116)](_0x3cb56b=>_0x28bb56['rows'][_0x3cb56b][_0x320219(0x160)]==='conflict'))_0x53443c[_0x320219(0x160)]=_0x320219(0xf2);}}}const _0x35775e={'status':'completed',..._0x4f70aa()};return await saveImportJson(_0x4912bd[_0x320219(0x11f)],_0x35775e),_0x35775e;}catch(_0x2f0569){if(_0x4391e8)await saveImportJson(_0x4912bd[_0x320219(0x11f)],{'status':_0x320219(0x163),..._0x4f70aa(),'message':_0x2f0569[_0x320219(0x133)]});throw _0x2f0569;}finally{await _0x50c3ce();}}function a150_0x13ee(){const _0x271e9e=['city','source','160488EKTyet','.lock.recovery','.recovery','parse','report','operatorType','checkpoint','keys','address','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','writeFile','hex','key','uploadFields','utf8','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','EEXIST','push','forEach','close','resume','20204GRfQHB','object','length','message','size','has','lbswuaCacheId','errors','isArray','token','write','sync','runtimeDomain','country','Import\x20lock\x20changed;\x20retry\x20recovery.','Invalid\x20write\x20result.','includes','42099xzySAV','ESRCH','values','cityAdcode','Excel\x20contains\x20no\x20valid\x20data\x20rows.','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','imageFields','maxBatchSize','errorMessage','batchSize','pois','byteLength','unsent','isSymbolicLink','schemaFingerprint','warnings','previewUrl','isInteger','string','createUserName','longitude','datasetCode','succeeded','dingTalkUrl','10EnfcIX','sort','districtAdcode','count','3MNsFup','geolocation','onCheckpointReady','status','streetNumber','version','incomplete','get','maxBatchBytes','code','elapsedMs','88249zBbTbs','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','isSafeInteger','pending','11412iZmrks','Cannot\x20read\x20the\x20import\x20checkpoint.','.lock','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','url','Incomplete\x20readback.','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','filter','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','unknown','accuracy','ENOENT','appCode','rowNumber','stringify','set','METADATA','entries','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','strategy','conflict','mappingHash','readback','district','createUserId','now','every','Invalid\x20import\x20batch\x20size.','fixed-negative-id','add','kill','actorId','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','Invalid\x20import\x20lock\x20owner.','24IvfYsq','binding','catch','rows','join','province','205dssjxq','5972758yOxkxq','pid','Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','latitude','schemaHash','Excel\x20row\x20','road','name','countryCode','type','Invalid\x20import\x20readback\x20response.','322144TASeLc','schemaVersion','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','map','some','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','slice'];a150_0x13ee=function(){return _0x271e9e;};return a150_0x13ee();}
|
|
@@ -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_0x7b2715=a152_0x12d1;(function(_0x46629a,_0x39e349){const _0x496288=a152_0x12d1,_0x20580b=_0x46629a();while(!![]){try{const _0x507adc=parseInt(_0x496288(0xb8))/0x1+parseInt(_0x496288(0xd2))/0x2*(-parseInt(_0x496288(0x8f))/0x3)+-parseInt(_0x496288(0xd1))/0x4*(-parseInt(_0x496288(0xc0))/0x5)+-parseInt(_0x496288(0xb9))/0x6*(-parseInt(_0x496288(0xce))/0x7)+-parseInt(_0x496288(0xa0))/0x8*(-parseInt(_0x496288(0xa4))/0x9)+parseInt(_0x496288(0x9e))/0xa*(-parseInt(_0x496288(0xad))/0xb)+-parseInt(_0x496288(0xa6))/0xc;if(_0x507adc===_0x39e349)break;else _0x20580b['push'](_0x20580b['shift']());}catch(_0x21ade2){_0x20580b['push'](_0x20580b['shift']());}}}(a152_0x1729,0xf3c49));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';function a152_0x1729(){const _0x5e7f10=['isDirectory','987SqjYyp','SKILL.md','Unsafe\x20manifest\x20path:\x20','264WHazvC','3663592UAxXNj','join','skills@latest\x20exited\x20','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','lovrabet.manifest.json','skipped','3RTzBxG','packageVersion',':\x5cs*(.+)$','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','packageRoot','version_mismatch','VERIFY_FAILED','Unsupported\x20Skill\x20entry:\x20','present','content_mismatch','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','name','root','missing','Installed\x20Skill\x20state\x20is\x20','14293390tPoTcl','sort','520aEYoby','home','split','Symbolic\x20link\x20is\x20not\x20allowed:\x20','220338vgjoSY','installedPath','9130296TbozrT','count','status','output','reason','skills','log','11vVdgzb','includes','isFile','startsWith','manifest','CLI\x20Built-in\x20Skill\x20','parse','state','error','message','match','1106509SAAhMJ','14754lOJhtv','lovrabet\x20cli-skill\x20install','partialFailure','\x20verified;\x20','utf8','unknown','flatMap','149690njgIYO','trim','version','current','path','skillVersion','unverifiable','digest','absent','length','update','lovrabet-skills','INSTALL_FAILED'];a152_0x1729=function(){return _0x5e7f10;};return a152_0x1729();}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_0x7b2715(0xba),SKILL_NAME='lovrabet',debug=debuglog(a152_0x7b2715(0xcb));function frontmatterValue(_0x537af5,_0x6190bd){const _0x35416a=a152_0x7b2715;return _0x537af5[_0x35416a(0xb7)](new RegExp('^'+_0x6190bd+_0x35416a(0x91),'m'))?.[0x1]?.[_0x35416a(0xc1)]()??'';}function listFiles(_0x562f24,_0x212654=_0x562f24){const _0x2b6970=a152_0x7b2715;return readdirSync(_0x212654,{'withFileTypes':!![]})[_0x2b6970(0xbf)](_0x3e2f6e=>{const _0x1a43fc=_0x2b6970,_0x1850dc=join(_0x212654,_0x3e2f6e[_0x1a43fc(0x9a)]),_0x445522=lstatSync(_0x1850dc);if(_0x445522['isSymbolicLink']())throw new Error(_0x1a43fc(0xa3)+_0x1850dc);if(_0x445522[_0x1a43fc(0xcd)]())return listFiles(_0x562f24,_0x1850dc);if(!_0x445522[_0x1a43fc(0xaf)]())throw new Error(_0x1a43fc(0x96)+_0x1850dc);return[relative(_0x562f24,_0x1850dc)[_0x1a43fc(0xa2)](sep)[_0x1a43fc(0xd3)]('/')];})[_0x2b6970(0x9f)]((_0x390006,_0x45ef73)=>_0x390006<_0x45ef73?-0x1:_0x390006>_0x45ef73?0x1:0x0);}function digestFiles(_0x4c5e4e,_0x55685a){const _0x4ca32d=a152_0x7b2715,_0x3a5087=createHash('sha256');for(const _0x46a505 of _0x55685a){if(_0x46a505[_0x4ca32d(0xb0)]('/')||_0x46a505[_0x4ca32d(0xa2)]('/')[_0x4ca32d(0xae)]('..')||_0x46a505[_0x4ca32d(0xae)]('\x5c'))throw new Error(_0x4ca32d(0xd0)+_0x46a505);_0x3a5087[_0x4ca32d(0xca)](_0x46a505),_0x3a5087['update']('\x00'),_0x3a5087[_0x4ca32d(0xca)](readFileSync(join(_0x4c5e4e,..._0x46a505[_0x4ca32d(0xa2)]('/')))),_0x3a5087[_0x4ca32d(0xca)]('\x00');}return _0x3a5087[_0x4ca32d(0xc7)]('hex');}function sameFiles(_0x2a45b0,_0x588c55){const _0x408504=a152_0x7b2715;return _0x2a45b0[_0x408504(0xc9)]===_0x588c55[_0x408504(0xc9)]&&_0x2a45b0['every']((_0x5c5eb9,_0x3ba1f7)=>_0x5c5eb9===_0x588c55[_0x3ba1f7]);}function readSource(_0x31cd1b){const _0x5e10da=a152_0x7b2715,_0x4a4e52=JSON[_0x5e10da(0xb3)](readFileSync(join(_0x31cd1b,'package.json'),_0x5e10da(0xbd))),_0x1eea68=JSON[_0x5e10da(0xb3)](readFileSync(join(_0x31cd1b,'skills',_0x5e10da(0xd6)),_0x5e10da(0xbd))),_0x4f187d=join(_0x31cd1b,_0x5e10da(0xab),SKILL_NAME),_0x220130=frontmatterValue(readFileSync(join(_0x4f187d,_0x5e10da(0xcf)),_0x5e10da(0xbd)),_0x5e10da(0xc2)),_0x485c4d=listFiles(_0x4f187d);if(_0x1eea68['schemaVersion']!==0x1||_0x1eea68['name']!==SKILL_NAME||!_0x4a4e52['version']||_0x1eea68[_0x5e10da(0x90)]!==_0x4a4e52['version']||_0x1eea68[_0x5e10da(0xc5)]!==_0x4a4e52[_0x5e10da(0xc2)]||_0x220130!==_0x4a4e52[_0x5e10da(0xc2)]||!sameFiles(_0x485c4d,_0x1eea68['files'])||digestFiles(_0x4f187d,_0x485c4d)!==_0x1eea68[_0x5e10da(0xc7)])throw new Error(_0x5e10da(0x92));return{'packageVersion':_0x4a4e52[_0x5e10da(0xc2)],'skillVersion':_0x220130,'root':_0x4f187d,'manifest':_0x1eea68};}function installedSkillPath(_0x48dc09){const _0x2ff53f=a152_0x7b2715,_0x2f5d77=resolveInstalledSkill(SKILL_NAME,{'home':_0x48dc09});if(_0x2f5d77[_0x2ff53f(0xb4)]===_0x2ff53f(0x97))return{'state':'present','path':dirname(_0x2f5d77[_0x2ff53f(0xc4)])};if(_0x2f5d77['state']===_0x2ff53f(0xc8))return{'state':'missing'};return{'state':_0x2ff53f(0xc6),'reason':_0x2f5d77[_0x2ff53f(0xaa)]};}export function inspectInstalledBuiltinSkillVersion(_0x4a4559,_0x23395f={}){const _0x525cc5=a152_0x7b2715,_0x5697f4=installedSkillPath(_0x23395f[_0x525cc5(0xa1)]??homedir());if(_0x5697f4[_0x525cc5(0xb4)]==='missing')return{'state':_0x525cc5(0x9c),'expectedVersion':_0x4a4559,'repairCommand':REPAIR_COMMAND};if(_0x5697f4[_0x525cc5(0xb4)]===_0x525cc5(0xc6))return{'state':_0x525cc5(0xc6),'expectedVersion':_0x4a4559,'reason':_0x5697f4[_0x525cc5(0xaa)],'repairCommand':REPAIR_COMMAND};try{const _0x59eee9=frontmatterValue(readFileSync(join(_0x5697f4[_0x525cc5(0xc4)],_0x525cc5(0xcf)),_0x525cc5(0xbd)),_0x525cc5(0xc2));return{'state':_0x59eee9===_0x4a4559?_0x525cc5(0xc3):_0x525cc5(0x94),'expectedVersion':_0x4a4559,'skillVersion':_0x59eee9,'installedPath':_0x5697f4['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x495082){return{'state':_0x525cc5(0xc6),'expectedVersion':_0x4a4559,'installedPath':_0x5697f4['path'],'reason':_0x495082 instanceof Error?_0x495082['message']:String(_0x495082),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x1bb20c={}){const _0xa7fa61=a152_0x7b2715,_0x4a7830=_0x1bb20c[_0xa7fa61(0x93)]??DEFAULT_PACKAGE_ROOT;let _0x4593ea;try{_0x4593ea=readSource(_0x4a7830);}catch(_0x11d89e){return{'state':_0xa7fa61(0xc6),'packageVersion':'unknown','reason':_0x11d89e instanceof Error?_0x11d89e[_0xa7fa61(0xb6)]:String(_0x11d89e),'repairCommand':REPAIR_COMMAND};}const _0x2a04c7=installedSkillPath(_0x1bb20c[_0xa7fa61(0xa1)]??homedir());if(_0x2a04c7[_0xa7fa61(0xb4)]==='missing')return{'state':_0xa7fa61(0x9c),'packageVersion':_0x4593ea[_0xa7fa61(0x90)],'repairCommand':REPAIR_COMMAND};if(_0x2a04c7[_0xa7fa61(0xb4)]===_0xa7fa61(0xc6))return{'state':_0xa7fa61(0xc6),'packageVersion':_0x4593ea[_0xa7fa61(0x90)],'reason':_0x2a04c7[_0xa7fa61(0xaa)],'repairCommand':REPAIR_COMMAND};try{const _0x2616c6=frontmatterValue(readFileSync(join(_0x2a04c7[_0xa7fa61(0xc4)],_0xa7fa61(0xcf)),_0xa7fa61(0xbd)),_0xa7fa61(0xc2));if(_0x2616c6!==_0x4593ea[_0xa7fa61(0xc5)])return{'state':_0xa7fa61(0x94),'packageVersion':_0x4593ea['packageVersion'],'skillVersion':_0x2616c6,'installedPath':_0x2a04c7[_0xa7fa61(0xc4)],'repairCommand':REPAIR_COMMAND};const _0x125c24=listFiles(_0x2a04c7['path']),_0x5a2a77=digestFiles(_0x2a04c7[_0xa7fa61(0xc4)],_0x125c24);return{'state':sameFiles(_0x125c24,_0x4593ea[_0xa7fa61(0xb1)]['files'])&&_0x5a2a77===_0x4593ea['manifest'][_0xa7fa61(0xc7)]?_0xa7fa61(0xc3):_0xa7fa61(0x98),'packageVersion':_0x4593ea['packageVersion'],'skillVersion':_0x2616c6,'installedPath':_0x2a04c7[_0xa7fa61(0xc4)],'digest':_0x5a2a77,'repairCommand':REPAIR_COMMAND};}catch(_0x3cca6a){return{'state':_0xa7fa61(0xc6),'packageVersion':_0x4593ea[_0xa7fa61(0x90)],'installedPath':_0x2a04c7['path'],'reason':_0x3cca6a instanceof Error?_0x3cca6a[_0xa7fa61(0xb6)]:String(_0x3cca6a),'repairCommand':REPAIR_COMMAND};}}function a152_0x12d1(_0x3328fa,_0x352504){_0x3328fa=_0x3328fa-0x8f;const _0x17299b=a152_0x1729();let _0x12d17e=_0x17299b[_0x3328fa];return _0x12d17e;}function failure(_0x52f320,_0x2a7f9d,_0x3a6382,_0x20745c){const _0x3597a6=a152_0x7b2715;return{'ok':![],'code':_0x52f320,'packageVersion':_0x2a7f9d[_0x3597a6(0x90)],'skillVersion':_0x2a7f9d[_0x3597a6(0xc5)],'installedPath':_0x20745c,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x3a6382 instanceof Error?_0x3a6382[_0x3597a6(0xb6)]:String(_0x3a6382)};}export function installBuiltinSkill(_0x41296b={}){const _0x526afd=a152_0x7b2715,_0x339a1e=_0x41296b[_0x526afd(0x93)]??DEFAULT_PACKAGE_ROOT,_0x6b48d8=_0x41296b[_0x526afd(0xa1)]??homedir();let _0x4f56e2;try{_0x4f56e2=readSource(_0x339a1e);}catch(_0x1af6c3){return failure('SOURCE_INVALID',{'packageVersion':_0x526afd(0xbe),'skillVersion':_0x526afd(0xbe)},_0x1af6c3);}const _0x2395e1=inspectBuiltinSkill({'packageRoot':_0x339a1e,'home':_0x6b48d8}),_0x13119=runNpxSkillsAddGlobal(_0x339a1e,_0x4f56e2[_0x526afd(0x9b)],{'stdio':_0x41296b['stdio']??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x6b48d8}});if(_0x13119[_0x526afd(0xd7)])return{'ok':!![],'packageVersion':_0x4f56e2[_0x526afd(0x90)],'skillVersion':_0x4f56e2[_0x526afd(0xc5)],'installedPath':_0x2395e1[_0x526afd(0xa5)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x13119['ok'])return failure(_0x526afd(0xcc),_0x4f56e2,_0x13119[_0x526afd(0xb5)]??_0x526afd(0xd4)+_0x13119[_0x526afd(0xa8)]);const _0xa4b2ca=inspectBuiltinSkill({'packageRoot':_0x339a1e,'home':_0x6b48d8});if(_0xa4b2ca['state']!==_0x526afd(0xc3)){const _0x259299=_0xa4b2ca[_0x526afd(0xaa)]??_0x526afd(0x9d)+_0xa4b2ca[_0x526afd(0xb4)];return failure(_0x526afd(0x95),_0x4f56e2,_0x13119[_0x526afd(0xbb)]?_0x259299+'\x0a'+_0x13119[_0x526afd(0xbb)][_0x526afd(0xa9)]:_0x259299,_0xa4b2ca[_0x526afd(0xa5)]);}return _0x13119[_0x526afd(0xbb)]&&(debug(_0x526afd(0x99),_0x13119[_0x526afd(0xbb)][_0x526afd(0xa9)]),console[_0x526afd(0xac)](_0x526afd(0xb2)+_0x4f56e2['skillVersion']+_0x526afd(0xbc)+_0x13119[_0x526afd(0xbb)][_0x526afd(0xa7)]+_0x526afd(0xd5))),{'ok':!![],'packageVersion':_0x4f56e2[_0x526afd(0x90)],'skillVersion':_0x4f56e2['skillVersion'],'installedPath':_0xa4b2ca[_0x526afd(0xa5)],'changed':_0x2395e1[_0x526afd(0xb4)]!==_0x526afd(0xc3),'repairCommand':REPAIR_COMMAND};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x4156b7=a153_0x3486;(function(_0x4150f0,_0x2ee399){const _0x125842=a153_0x3486,_0x133e41=_0x4150f0();while(!![]){try{const _0xc84015=parseInt(_0x125842(0x149))/0x1+parseInt(_0x125842(0x13b))/0x2*(parseInt(_0x125842(0x15e))/0x3)+-parseInt(_0x125842(0x167))/0x4+-parseInt(_0x125842(0x14c))/0x5*(-parseInt(_0x125842(0x150))/0x6)+parseInt(_0x125842(0x13d))/0x7+-parseInt(_0x125842(0x15a))/0x8*(parseInt(_0x125842(0x143))/0x9)+-parseInt(_0x125842(0x16a))/0xa;if(_0xc84015===_0x2ee399)break;else _0x133e41['push'](_0x133e41['shift']());}catch(_0x4aa3a5){_0x133e41['push'](_0x133e41['shift']());}}}(a153_0x5233,0x96ad8));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a153_0x5c0b91}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';function a153_0x3486(_0x3a3ed6,_0x11e06f){_0x3a3ed6=_0x3a3ed6-0x134;const _0x5233a6=a153_0x5233();let _0x3486df=_0x5233a6[_0x3a3ed6];return _0x3486df;}import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a153_0x5c0b91;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a153_0x4156b7(0x165)];function a153_0x5233(){const _0x2ad82a=['!\x20Could\x20not\x20verify\x20\x22','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','npx\x20failed\x20to\x20start','trim','9UGNAPR','stderr','unknown','globalSkillName','skills@latest','presence','878290mDTOiH','NPX_NOT_FOUND','CHILD_TERMINATED','212375QnMKnC','add','match','expectedSkillName','96mZKKIU','join','\x22\x20install\x20state:\x20','log','npx\x20terminated\x20by\x20signal\x20','message','CHILD_EXIT_NONZERO','absent','exitCode','stdio','1102344UkoERC','stdout','EACCES','npm_config_global','30bLMJHu','state','checked','unverifiable','exit\x20','\x20failed\x20target(s)','npx','internalSkillSource','signal','2091704xlZQhe','SPAWN_FAILED','PERMISSION_DENIED','8439860OCeGli','SKILL_NOT_INSTALLED','filter','present','code','Installer\x20reported\x20','shortMessage','EPERM','37442YajtTM','reason','2637467OsnnVt','Skill\x20\x22'];a153_0x5233=function(){return _0x2ad82a;};return a153_0x5233();}export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a153_0x4156b7(0x146)];export function resolveGlobalSkillName(_0x3c8701){const _0x30d1aa=a153_0x4156b7;switch(_0x3c8701[_0x30d1aa(0x142)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG['skipNpxSkillsEnvSuffix']);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x3ea8ba,_0x688f34,_0x37815c){return{'ok':![],'status':_0x688f34,'code':_0x3ea8ba,'error':'['+_0x3ea8ba+']\x20'+_0x37815c};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x4eba5d,_0x5dcc0a=LOVRABET_SKILL_SOURCE,_0x12b735){const _0x43986f=a153_0x4156b7;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x32b3e0=['-y',_0x43986f(0x147),_0x43986f(0x14d),_0x5dcc0a,'-g','-y'],_0x5d87ef=['npx',..._0x32b3e0][_0x43986f(0x151)]('\x20');console['log']('*\x20'+_0x5d87ef);const _0x1b7e48={...process.env};delete _0x1b7e48[_0x43986f(0x15d)],delete _0x1b7e48['NPM_CONFIG_GLOBAL'];const _0x4a8ca7=execaSync(_0x43986f(0x164),_0x32b3e0,{'cwd':_0x4eba5d,'stdio':'pipe','env':_0x1b7e48,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x5f1bcb=[_0x4a8ca7[_0x43986f(0x15b)]?String(_0x4a8ca7[_0x43986f(0x15b)]):'',_0x4a8ca7[_0x43986f(0x144)]?String(_0x4a8ca7[_0x43986f(0x144)]):''][_0x43986f(0x135)](Boolean)[_0x43986f(0x151)]('\x0a')[_0x43986f(0x142)](),_0x4c53d2=_0x4a8ca7[_0x43986f(0x158)]??null,_0x3377a2=_0x3747f8=>{const _0x338281=_0x43986f;return _0x12b735?.[_0x338281(0x159)]!=='pipe'&&!_0x3747f8['partialFailure']&&_0x5f1bcb&&console[_0x338281(0x153)](_0x5f1bcb),_0x3747f8;};if(_0x4a8ca7[_0x43986f(0x137)]){const _0x799f02=_0x4a8ca7[_0x43986f(0x137)]==='ENOENT'?_0x43986f(0x14a):_0x4a8ca7[_0x43986f(0x137)]===_0x43986f(0x13a)||_0x4a8ca7[_0x43986f(0x137)]===_0x43986f(0x15c)?_0x43986f(0x169):_0x43986f(0x168);return _0x3377a2(failure(_0x799f02,_0x4c53d2,_0x4a8ca7[_0x43986f(0x139)]??_0x4a8ca7[_0x43986f(0x155)]??_0x4a8ca7[_0x43986f(0x137)]));}if(_0x4a8ca7[_0x43986f(0x166)])return _0x3377a2(failure(_0x43986f(0x14b),_0x4c53d2,_0x43986f(0x154)+_0x4a8ca7[_0x43986f(0x166)]));if(_0x4a8ca7['failed']&&_0x4c53d2===null)return _0x3377a2(failure(_0x43986f(0x168),_0x4c53d2,_0x4a8ca7[_0x43986f(0x139)]??_0x4a8ca7[_0x43986f(0x155)]??_0x43986f(0x141)));if(_0x4c53d2!==0x0)return _0x3377a2(failure(_0x43986f(0x156),_0x4c53d2,_0x5f1bcb||_0x4a8ca7[_0x43986f(0x139)]||_0x43986f(0x162)+(_0x4c53d2??_0x43986f(0x145))));const _0x3dbde4=_0x12b735?.[_0x43986f(0x14f)]??resolveGlobalSkillName(_0x5dcc0a),_0x28ab5b=_0x3dbde4?resolveInstalledSkill(_0x3dbde4,_0x12b735?.[_0x43986f(0x148)]):undefined,_0x4ec755=_0x5f1bcb[_0x43986f(0x14e)](/Failed to install\s+(\d+)/i);if(_0x4ec755&&Number(_0x4ec755[0x1])>0x0){const _0x378a31=_0x43986f(0x138)+_0x4ec755[0x1]+_0x43986f(0x163)+(_0x5f1bcb?':\x0a'+_0x5f1bcb:'');if(_0x28ab5b?.['state']===_0x43986f(0x136))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x4ec755[0x1]),'output':_0x5f1bcb}};return _0x3377a2(failure('INSTALL_PARTIAL',0x0,_0x378a31));}if(_0x3dbde4&&_0x28ab5b){if(_0x28ab5b[_0x43986f(0x15f)]===_0x43986f(0x157))return _0x3377a2(failure(_0x43986f(0x134),0x0,_0x43986f(0x13e)+_0x3dbde4+_0x43986f(0x140)+_0x28ab5b[_0x43986f(0x160)][_0x43986f(0x151)](',\x20')+')'));_0x28ab5b[_0x43986f(0x15f)]===_0x43986f(0x161)&&console['warn'](_0x43986f(0x13f)+_0x3dbde4+_0x43986f(0x152)+_0x28ab5b[_0x43986f(0x13c)]);}return _0x3377a2({'ok':!![],'status':0x0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a154_0x4f3f6d=a154_0x4a40;function a154_0x30ec(){const _0x27d11e=['6nGOzKA','144674wuBWuf','.DS_Store','126186snftrb','SKILL.md','9532780ZUwwKV','.svn','2306150BVChsf','491261gaRFhn','build','dist','2115VipdZT','.turbo','9832yoatzK','node_modules','20WUzSAU','1738260IPOgru','.git'];a154_0x30ec=function(){return _0x27d11e;};return a154_0x30ec();}function a154_0x4a40(_0x3dea83,_0x4defe1){_0x3dea83=_0x3dea83-0xec;const _0x30ec88=a154_0x30ec();let _0x4a4019=_0x30ec88[_0x3dea83];return _0x4a4019;}(function(_0xec51af,_0x1dfb0c){const _0x3a886f=a154_0x4a40,_0x8105cd=_0xec51af();while(!![]){try{const _0x238c10=-parseInt(_0x3a886f(0xf7))/0x1+-parseInt(_0x3a886f(0xf0))/0x2*(parseInt(_0x3a886f(0xef))/0x3)+-parseInt(_0x3a886f(0xed))/0x4+-parseInt(_0x3a886f(0xec))/0x5*(parseInt(_0x3a886f(0xf2))/0x6)+parseInt(_0x3a886f(0xf6))/0x7+-parseInt(_0x3a886f(0xfc))/0x8*(-parseInt(_0x3a886f(0xfa))/0x9)+parseInt(_0x3a886f(0xf4))/0xa;if(_0x238c10===_0x1dfb0c)break;else _0x8105cd['push'](_0x8105cd['shift']());}catch(_0x551e99){_0x8105cd['push'](_0x8105cd['shift']());}}}(a154_0x30ec,0x65c97));export const METADATA_FILE='lovrabet.skill.json';export const SKILL_FILE=a154_0x4f3f6d(0xf3);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a154_0x4f3f6d(0xf1)]);export const IGNORED_DIR_NAMES=new Set([a154_0x4f3f6d(0xee),'.hg',a154_0x4f3f6d(0xf5),a154_0x4f3f6d(0xfd),'.next',a154_0x4f3f6d(0xf9),a154_0x4f3f6d(0xf8),'coverage',a154_0x4f3f6d(0xfb),'.cache']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2818c9,_0x3fb26b){const _0x475f1e=a155_0x21f5,_0xd358d=_0x2818c9();while(!![]){try{const _0x1dc1b6=parseInt(_0x475f1e(0x182))/0x1+-parseInt(_0x475f1e(0x17d))/0x2*(-parseInt(_0x475f1e(0x185))/0x3)+parseInt(_0x475f1e(0x186))/0x4+-parseInt(_0x475f1e(0x184))/0x5+parseInt(_0x475f1e(0x177))/0x6*(-parseInt(_0x475f1e(0x17b))/0x7)+parseInt(_0x475f1e(0x17c))/0x8*(-parseInt(_0x475f1e(0x189))/0x9)+parseInt(_0x475f1e(0x17a))/0xa;if(_0x1dc1b6===_0x3fb26b)break;else _0xd358d['push'](_0xd358d['shift']());}catch(_0x3152f6){_0xd358d['push'](_0xd358d['shift']());}}}(a155_0x1e6f,0x70bb3));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';function a155_0x1e6f(){const _0x409161=['Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','9jnCBzu','validation','2094IJxTKU','split','Unsafe\x20Skill\x20file\x20path:\x20','452220wMPwtV','7581NjyYFe','3399776SqjbpO','24jnINFd','.tmp','isSymbolicLink','endsWith','from','142523oRLZEg','startsWith','1232665NKKzEg','209130YxMizE','1947816vBvzCY','stringify'];a155_0x1e6f=function(){return _0x409161;};return a155_0x1e6f();}import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x15e465,_0x4e99ef){const _0x3670c0=a155_0x21f5,_0x1f99eb=normalizeSkillRelativePath(_0x4e99ef),_0x5e3e84=realOrResolved(_0x15e465),_0x3c24a2=resolve(_0x5e3e84,..._0x1f99eb[_0x3670c0(0x178)]('/'));if(!isPathInside(_0x3c24a2,_0x5e3e84))throw CliErrors['validation'](_0x3670c0(0x179)+_0x4e99ef);return ensureNoSymlinkInManagedPath(_0x5e3e84,_0x1f99eb),_0x3c24a2;}export function ensureNoSymlinkInManagedPath(_0x27bce5,_0x597cf8){const _0x1067a2=a155_0x21f5;let _0xacd639=_0x27bce5;for(const _0x1fffc4 of _0x597cf8[_0x1067a2(0x178)]('/')){_0xacd639=resolve(_0xacd639,_0x1fffc4);const _0x53410b=lstatIfPresent(_0xacd639);if(_0x53410b?.[_0x1067a2(0x17f)]())throw CliErrors[_0x1067a2(0x18a)](_0x1067a2(0x188)+_0x597cf8);}}export function isDanglingSymlink(_0xa53d3a){const _0x255683=a155_0x21f5;try{return lstatSync(_0xa53d3a)[_0x255683(0x17f)]();}catch{return![];}}export function resolveSymlinkTarget(_0x37c485){const _0x6c4f92=readlinkSync(_0x37c485);return isAbsolute(_0x6c4f92)?_0x6c4f92:resolve(dirname(_0x37c485),_0x6c4f92);}export function isPathInside(_0x597593,_0x1f9aed){const _0x1f400a=a155_0x21f5,_0x411320=_0x597593[_0x1f400a(0x180)](sep)?_0x597593:''+_0x597593+sep,_0x323548=_0x1f9aed[_0x1f400a(0x180)](sep)?_0x1f9aed:''+_0x1f9aed+sep;return _0x597593===_0x1f9aed||_0x411320[_0x1f400a(0x183)](_0x323548);}export function realOrResolved(_0x27d941){try{return realpathSync(_0x27d941);}catch{return resolve(_0x27d941);}}function a155_0x21f5(_0x5a4129,_0x5a5c2a){_0x5a4129=_0x5a4129-0x177;const _0x1e6fb5=a155_0x1e6f();let _0x21f5f8=_0x1e6fb5[_0x5a4129];return _0x21f5f8;}export function lstatIfPresent(_0x27d4cd){try{return lstatSync(_0x27d4cd);}catch{return undefined;}}export function writeTextAtomic(_0x259162,_0x1b916e,_0x5b063f){const _0x2a0464=a155_0x21f5;writeBytesAtomic(_0x259162,Buffer[_0x2a0464(0x181)](_0x1b916e,'utf8'),_0x5b063f);}export function writeBytesAtomic(_0xa1ca5f,_0x1ae40d,_0x4e68be){const _0x526069=a155_0x21f5,_0x5563b7=_0xa1ca5f+_0x526069(0x17e);try{writeFileSync(_0x5563b7,_0x1ae40d,{'mode':_0x4e68be}),renameSync(_0x5563b7,_0xa1ca5f);}catch(_0x544c54){try{rmSync(_0x5563b7,{'force':!![]});}catch{}throw _0x544c54;}}export function writeJsonAtomic(_0x54dd01,_0x2cea66){const _0x2612e5=a155_0x21f5;writeTextAtomic(_0x54dd01,JSON[_0x2612e5(0x187)](_0x2cea66,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ee866,_0x40e34d){const _0x103c75=a156_0x28b4,_0x2fa8e4=_0x1ee866();while(!![]){try{const _0x4dc985=-parseInt(_0x103c75(0xe1))/0x1+parseInt(_0x103c75(0xde))/0x2+-parseInt(_0x103c75(0xe4))/0x3+parseInt(_0x103c75(0xdd))/0x4*(parseInt(_0x103c75(0xe9))/0x5)+-parseInt(_0x103c75(0xeb))/0x6*(parseInt(_0x103c75(0xdf))/0x7)+-parseInt(_0x103c75(0xe8))/0x8*(parseInt(_0x103c75(0xe3))/0x9)+parseInt(_0x103c75(0xed))/0xa*(parseInt(_0x103c75(0xe0))/0xb);if(_0x4dc985===_0x40e34d)break;else _0x2fa8e4['push'](_0x2fa8e4['shift']());}catch(_0x1702b4){_0x2fa8e4['push'](_0x2fa8e4['shift']());}}}(a156_0x3c7a,0xba285));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x472138){const _0x2f7dc7=a156_0x28b4;return createHash('sha256')['update'](_0x472138)['digest'](_0x2f7dc7(0xea));}export function fileHash(_0x3b2131){return bufferSha256(fileContent(_0x3b2131));}function a156_0x28b4(_0x5e523e,_0x30f7aa){_0x5e523e=_0x5e523e-0xdd;const _0x3c7aea=a156_0x3c7a();let _0x28b4fa=_0x3c7aea[_0x5e523e];return _0x28b4fa;}export function bufferSha256(_0x25eb09){const _0x553186=a156_0x28b4;return createHash(_0x553186(0xe7))[_0x553186(0xe6)](_0x25eb09)[_0x553186(0xe2)]('hex');}export function fileTreeHash(_0x160090){const _0x1987ef=a156_0x28b4,_0x4a3df6=createHash(_0x1987ef(0xe7));for(const _0xb4c3e8 of normalizeManifestFiles(_0x160090)){_0x4a3df6['update'](_0xb4c3e8[_0x1987ef(0xec)]),_0x4a3df6['update']('\x00'),_0x4a3df6[_0x1987ef(0xe6)](_0xb4c3e8[_0x1987ef(0xe7)]),_0x4a3df6[_0x1987ef(0xe6)]('\x00'),_0x4a3df6[_0x1987ef(0xe6)](String(_0xb4c3e8[_0x1987ef(0xe5)])),_0x4a3df6[_0x1987ef(0xe6)]('\x00');}return _0x4a3df6[_0x1987ef(0xe2)](_0x1987ef(0xea));}function a156_0x3c7a(){const _0x3873bc=['246909CZyDuj','digest','3548817MSUCuo','917295buztAp','size','update','sha256','24qVPuSE','17065AshIQd','hex','617670qPadbx','path','10smLQjr','336GYvsle','2171660KPBcmx','77UbcnMP','24837857mbzSxI'];a156_0x3c7a=function(){return _0x3873bc;};return a156_0x3c7a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a157_0x3779f1=a157_0x4d35;(function(_0x312327,_0x19dbbe){const _0x1b1a50=a157_0x4d35,_0x532cd2=_0x312327();while(!![]){try{const _0x583b7c=-parseInt(_0x1b1a50(0xb7))/0x1+-parseInt(_0x1b1a50(0xba))/0x2+-parseInt(_0x1b1a50(0xb9))/0x3+parseInt(_0x1b1a50(0xac))/0x4*(-parseInt(_0x1b1a50(0xb4))/0x5)+parseInt(_0x1b1a50(0xb3))/0x6+-parseInt(_0x1b1a50(0xb5))/0x7+-parseInt(_0x1b1a50(0xb2))/0x8*(-parseInt(_0x1b1a50(0xb8))/0x9);if(_0x583b7c===_0x19dbbe)break;else _0x532cd2['push'](_0x532cd2['shift']());}catch(_0x1455b3){_0x532cd2['push'](_0x532cd2['shift']());}}}(a157_0x23a9,0xbeb75));function a157_0x23a9(){const _0x3bbe75=['9368UAQVeP','4568844vQCGFm','974095cdlMJd','10202290xtcpDB','global','427620besGYZ','36774THFMnM','3269247qdYaRQ','2801060heWXCA','8gpSyWs','skills','managedRoot','appCode','.agents','cwd'];a157_0x23a9=function(){return _0x3bbe75;};return a157_0x23a9();}import{resolve}from'node:path';function a157_0x4d35(_0x4a73cc,_0x3a1258){_0x4a73cc=_0x4a73cc-0xac;const _0x23a9fc=a157_0x23a9();let _0x4d3538=_0x23a9fc[_0x4a73cc];return _0x4d3538;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x51dd55,_0x8e3b09=a157_0x3779f1(0xb6),_0x2c8e37={}){const _0x22e245=a157_0x3779f1,_0x32d62e=resolveSkillSyncPaths(_0x2c8e37),_0x5c77e4=safePathSegment(_0x51dd55,_0x22e245(0xaf)),_0x2f60f7=_0x8e3b09==='project'?[resolve(_0x2c8e37[_0x22e245(0xb1)]??process['cwd'](),_0x22e245(0xb0),_0x22e245(0xad))]:runtimeAgentSkillRoots(_0x32d62e);return Object['freeze']({'scope':_0x8e3b09,'appCode':_0x5c77e4,'skillRoots':Object['freeze'](_0x2f60f7),'managedRoot':_0x32d62e[_0x22e245(0xae)]});}
|
|
@@ -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
|
+
function a158_0x1b15(_0x10ac39,_0x327be7){_0x10ac39=_0x10ac39-0x165;const _0x115e1b=a158_0x115e();let _0x1b15ad=_0x115e1b[_0x10ac39];return _0x1b15ad;}const a158_0xfd3dc7=a158_0x1b15;(function(_0x2df83a,_0x4aeb42){const _0x310eea=a158_0x1b15,_0x27d59b=_0x2df83a();while(!![]){try{const _0x347416=-parseInt(_0x310eea(0x18e))/0x1*(parseInt(_0x310eea(0x17a))/0x2)+parseInt(_0x310eea(0x17e))/0x3*(-parseInt(_0x310eea(0x165))/0x4)+-parseInt(_0x310eea(0x184))/0x5+-parseInt(_0x310eea(0x18b))/0x6+parseInt(_0x310eea(0x174))/0x7*(parseInt(_0x310eea(0x170))/0x8)+parseInt(_0x310eea(0x17d))/0x9+parseInt(_0x310eea(0x18c))/0xa;if(_0x347416===_0x4aeb42)break;else _0x27d59b['push'](_0x27d59b['shift']());}catch(_0x415bd0){_0x27d59b['push'](_0x27d59b['shift']());}}}(a158_0x115e,0x5bc15));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0x3ed558 from'fs-extra';function a158_0x115e(){const _0xb461e3=['trim','managedRoot','name','not-managed-symlink','secret-retriever','275224HcHURW','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','isSymbolicLink','metadataPath','126fjBmFv','env','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','set','personal','929018ekySDk','pruneSkillCodes','lovrabet','2232207yhsWDm','58785sGRHNw','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','isDirectory','has','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','1250620CRATjF','skill','metadata-mismatch','skipped','builtin','accessKey','skillRoots','1906782vyXDJf','5801720DruIxM','company','1IzxbbG','filter','contentHash','updated','agentsSkillsDir','activeSkillCodes','runtime-observe','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','startsWith','push','length','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','dir','created','project','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','unchanged','protectedLinkRoots','skillCode','8sWcYGr','map','scopes','scope','validation','appCode'];a158_0x115e=function(){return _0xb461e3;};return a158_0x115e();}import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a158_0x3ed558,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0xfd3dc7(0x17c),a158_0xfd3dc7(0x194),a158_0xfd3dc7(0x16f)]);export function linkEffectiveRuntimeSkills(_0x155624,_0x13cc8c){const _0x552b17=a158_0xfd3dc7,_0x13feac=new Map();for(const _0x38aee0 of _0x155624){const _0x510788=_0x38aee0[_0x552b17(0x185)][_0x552b17(0x1a1)];if(!_0x510788)continue;const _0x3be1b4=_0x13feac['get'](_0x510788);(!_0x3be1b4||_0x38aee0[_0x552b17(0x168)]===_0x552b17(0x179))&&_0x13feac[_0x552b17(0x178)](_0x510788,_0x38aee0);}const _0x4bdf96=[];for(const _0xe9fb11 of _0x13feac['values']()){const _0x90157b=requireSkillCode(_0xe9fb11[_0x552b17(0x185)]),_0x54206a=readMetadataIfPresent(_0xe9fb11[_0x552b17(0x173)]);if(_0x54206a?.['appCode']!==_0x13cc8c[_0x552b17(0x16a)]||_0x54206a[_0x552b17(0x1a1)]!==_0x90157b)throw CliErrors[_0x552b17(0x169)](_0x552b17(0x17f)+_0x13cc8c[_0x552b17(0x16a)]+':\x20'+_0xe9fb11[_0x552b17(0x173)]);const _0xf8ad57=runtimeSkillLinkName(_0x13cc8c,_0x90157b);for(const _0x4cfa10 of _0x13cc8c[_0x552b17(0x18a)]){_0x4bdf96[_0x552b17(0x197)](ensureManagedSymlink(resolve(_0x4cfa10,_0xf8ad57),_0xe9fb11[_0x552b17(0x19b)],_0x13cc8c,_0x90157b));}}return _0x4bdf96;}export function pruneStaleRuntimeSkillLinks(_0x3eecb1,_0x357ae2,_0x1985b2){const _0x267feb=a158_0xfd3dc7,_0x32a56b=new Set([..._0x357ae2][_0x267feb(0x166)](_0x5af471=>_0x5af471[_0x267feb(0x16b)]())[_0x267feb(0x18f)](Boolean)),_0xd8b925=_0x1985b2?new Set([..._0x1985b2][_0x267feb(0x166)](_0x18bdbb=>_0x18bdbb[_0x267feb(0x16b)]())[_0x267feb(0x18f)](Boolean)):undefined,_0x38434c=[];for(const _0x3089ed of _0x3eecb1[_0x267feb(0x18a)]){for(const _0x5a72e5 of managedTargetSkillLinkPaths(_0x3089ed,_0x3eecb1)){const _0xfb4502=runtimeSkillCodeFromLink(_0x3eecb1,_0x5a72e5);if(_0xd8b925&&!_0xd8b925[_0x267feb(0x181)](_0xfb4502))continue;if(_0x32a56b[_0x267feb(0x181)](_0xfb4502))continue;_0x38434c[_0x267feb(0x197)](removeManagedSkillLink(_0x5a72e5,_0x3eecb1,_0xfb4502));}}return _0x38434c;}export function pruneStaleRuntimeSkillCache(_0x8fcddf,_0x2e1f9a={}){const _0x46e297=a158_0xfd3dc7,_0x2a87ef=new Set([..._0x8fcddf[_0x46e297(0x193)]]['map'](_0x493c08=>_0x493c08['trim']())[_0x46e297(0x18f)](Boolean)),_0x213b0f=_0x8fcddf[_0x46e297(0x17b)]?new Set([..._0x8fcddf[_0x46e297(0x17b)]][_0x46e297(0x166)](_0x1beeaf=>_0x1beeaf[_0x46e297(0x16b)]())[_0x46e297(0x18f)](Boolean)):undefined,_0x2bde51=_0x8fcddf[_0x46e297(0x167)]??[_0x46e297(0x179),_0x46e297(0x18d)],_0x59fc57=resolve(getRuntimeSkillCacheRoot(_0x8fcddf[_0x46e297(0x175)],_0x8fcddf[_0x46e297(0x189)],_0x2e1f9a),safePathSegment(_0x8fcddf[_0x46e297(0x16a)],'appCode')),_0x4dea5f=[];for(const _0x3edd8b of _0x2bde51){const _0x318765=resolve(_0x59fc57,_0x3edd8b);if(!existsSync(_0x318765))continue;for(const _0x2452c1 of readdirSync(_0x318765,{'withFileTypes':!![]})){if(!_0x2452c1[_0x46e297(0x180)]())continue;const _0x1046ec=_0x2452c1[_0x46e297(0x16d)];if(_0x213b0f&&!_0x213b0f['has'](_0x1046ec))continue;if(_0x2a87ef[_0x46e297(0x181)](_0x1046ec))continue;const _0xfe4abb=resolve(_0x318765,_0x1046ec),_0x2536f5=readMetadataIfPresent(resolve(_0xfe4abb,METADATA_FILE));if(_0x2536f5?.[_0x46e297(0x16a)]!==_0x8fcddf[_0x46e297(0x16a)]||_0x2536f5[_0x46e297(0x168)]!==_0x3edd8b||_0x2536f5[_0x46e297(0x1a1)]!==_0x1046ec){_0x4dea5f[_0x46e297(0x197)]({'path':_0xfe4abb,'action':_0x46e297(0x187),'reason':_0x46e297(0x186)});continue;}if(isLinkedFromAnyRoot(_0xfe4abb,_0x8fcddf[_0x46e297(0x1a0)]??[])){_0x4dea5f[_0x46e297(0x197)]({'path':_0xfe4abb,'action':_0x46e297(0x187),'reason':'linked-from-protected-root'});continue;}removeSync(_0xfe4abb),_0x4dea5f[_0x46e297(0x197)]({'path':_0xfe4abb,'action':'removed'});}}return _0x4dea5f;}export function linkGlobalRuntimeSkills(_0x4e817f,_0x723581={}){const _0x3d5e05=a158_0xfd3dc7,_0x15bea3=resolveSkillSyncPaths(_0x723581),_0x5ad552=[];for(const _0x3cef30 of _0x4e817f){if(_0x3cef30[_0x3d5e05(0x168)]!==_0x3d5e05(0x188))throw CliErrors[_0x3d5e05(0x169)](_0x3d5e05(0x171)+_0x3cef30[_0x3d5e05(0x168)]);const _0x557293=requireSkillCode(_0x3cef30[_0x3d5e05(0x185)]),_0x566e4a=copyManagedSkillDirectory(_0x3cef30[_0x3d5e05(0x19b)],resolve(_0x15bea3[_0x3d5e05(0x192)],_0x557293));_0x5ad552['push']({..._0x566e4a,'contentHash':_0x3cef30[_0x3d5e05(0x190)]});}return _0x5ad552;}function ensureManagedSymlink(_0x11e17e,_0xe02921,_0x326aae,_0x422e4d){const _0x2a470a=a158_0xfd3dc7;mkdirSync(dirname(_0x11e17e),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x11e17e)||isDanglingSymlink(_0x11e17e)){const _0x1f5974=lstatSync(_0x11e17e);if(!_0x1f5974['isSymbolicLink']())throw CliErrors[_0x2a470a(0x169)](_0x2a470a(0x177)+_0x11e17e);const _0x35a294=resolveSymlinkTarget(_0x11e17e);if(!isPathInside(realOrResolved(_0x35a294),realOrResolved(_0x326aae[_0x2a470a(0x16c)])))throw CliErrors['validation'](_0x2a470a(0x199)+_0x11e17e);if(realOrResolved(_0x35a294)===realOrResolved(_0xe02921))return{'path':_0x11e17e,'target':_0xe02921,'action':_0x2a470a(0x19f)};const _0x5f4cd2=readMetadataIfPresent(resolve(_0x35a294,METADATA_FILE));if(_0x326aae[_0x2a470a(0x168)]===_0x2a470a(0x19d)&&(_0x5f4cd2?.[_0x2a470a(0x16a)]!==_0x326aae[_0x2a470a(0x16a)]||_0x5f4cd2[_0x2a470a(0x1a1)]!==_0x422e4d))throw CliErrors[_0x2a470a(0x169)](_0x2a470a(0x183)+_0x11e17e);return unlinkSync(_0x11e17e),symlinkSync(_0xe02921,_0x11e17e,_0x2a470a(0x19b)),{'path':_0x11e17e,'target':_0xe02921,'action':_0x2a470a(0x191)};}return symlinkSync(_0xe02921,_0x11e17e,_0x2a470a(0x19b)),{'path':_0x11e17e,'target':_0xe02921,'action':_0x2a470a(0x19c)};}function managedTargetSkillLinkPaths(_0x368b17,_0x51dae7){const _0x1cc634=a158_0xfd3dc7;if(!existsSync(_0x368b17))return[];const _0x76d021=_0x51dae7[_0x1cc634(0x16a)]+'--';return readdirSync(_0x368b17,{'withFileTypes':!![]})[_0x1cc634(0x18f)](_0x34992c=>_0x51dae7['scope']==='project'||_0x34992c[_0x1cc634(0x16d)][_0x1cc634(0x196)](_0x76d021))[_0x1cc634(0x166)](_0x2b969e=>resolve(_0x368b17,_0x2b969e[_0x1cc634(0x16d)]));}function removeManagedSkillLink(_0x1352e2,_0x17837b,_0x39d373){const _0x23bf3f=a158_0xfd3dc7,_0x4a2644=lstatIfPresent(_0x1352e2);if(!_0x4a2644?.['isSymbolicLink']())return{'path':_0x1352e2,'action':_0x23bf3f(0x187),'reason':_0x23bf3f(0x16e)};const _0x5312d2=resolveSymlinkTarget(_0x1352e2);if(!isPathInside(realOrResolved(_0x5312d2),realOrResolved(_0x17837b[_0x23bf3f(0x16c)])))return{'path':_0x1352e2,'action':_0x23bf3f(0x187),'reason':'external-symlink'};const _0x21c1ac=readMetadataIfPresent(resolve(_0x5312d2,METADATA_FILE));if(_0x17837b[_0x23bf3f(0x168)]===_0x23bf3f(0x19d)&&(_0x21c1ac?.[_0x23bf3f(0x16a)]!==_0x17837b[_0x23bf3f(0x16a)]||_0x21c1ac[_0x23bf3f(0x1a1)]!==_0x39d373))return{'path':_0x1352e2,'action':_0x23bf3f(0x187),'reason':_0x23bf3f(0x186)};return unlinkSync(_0x1352e2),{'path':_0x1352e2,'action':'removed'};}function isLinkedFromAnyRoot(_0x53b232,_0x46c4e9){const _0x3d8173=a158_0xfd3dc7,_0x594ba7=realOrResolved(_0x53b232);for(const _0x28a90b of _0x46c4e9){if(!existsSync(_0x28a90b))continue;for(const _0x461751 of readdirSync(_0x28a90b,{'withFileTypes':!![]})){if(!_0x461751[_0x3d8173(0x172)]())continue;const _0x3564c3=resolve(_0x28a90b,_0x461751[_0x3d8173(0x16d)]);if(realOrResolved(resolveSymlinkTarget(_0x3564c3))===_0x594ba7)return!![];}}return![];}function runtimeSkillLinkName(_0x222668,_0x27d1f9){const _0x44d028=a158_0xfd3dc7,_0x5aff15=safePathSegment(_0x27d1f9,_0x44d028(0x1a1));if(_0x222668[_0x44d028(0x168)]===_0x44d028(0x19d)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x5aff15))throw CliErrors[_0x44d028(0x169)](_0x44d028(0x182)+_0x5aff15);return _0x222668[_0x44d028(0x168)]==='project'?_0x5aff15:_0x222668[_0x44d028(0x16a)]+'--'+_0x5aff15;}function runtimeSkillCodeFromLink(_0x388e8a,_0x56903a){const _0x4f2b83=a158_0xfd3dc7,_0x3aa61b=basename(_0x56903a);return _0x388e8a[_0x4f2b83(0x168)]===_0x4f2b83(0x19d)?_0x3aa61b:_0x3aa61b['slice']((_0x388e8a['appCode']+'--')[_0x4f2b83(0x198)]);}export function copyManagedSkillDirectory(_0x3debaf,_0xe48a14){const _0x2e0f7c=a158_0xfd3dc7,_0x2a09cc=resolve(_0xe48a14,METADATA_FILE),_0x3a03d8=existsSync(_0xe48a14);if(_0x3a03d8){const _0x23befb=lstatSync(_0xe48a14);if(_0x23befb[_0x2e0f7c(0x172)]())throw CliErrors['validation'](_0x2e0f7c(0x19a)+_0xe48a14);if(!_0x23befb[_0x2e0f7c(0x180)]())throw CliErrors['validation'](_0x2e0f7c(0x176)+_0xe48a14);const _0x5b75a1=readMetadataIfPresent(_0x2a09cc);if(_0x5b75a1?.[_0x2e0f7c(0x168)]!==_0x2e0f7c(0x188))throw CliErrors['validation'](_0x2e0f7c(0x19e)+_0xe48a14);}ensureDirSync(dirname(_0xe48a14));const _0x1b72a5=_0x3a03d8?readMetadataIfPresent(_0x2a09cc)?.['contentHash']:undefined,_0x865e80=readMetadataIfPresent(resolve(_0x3debaf,METADATA_FILE))?.[_0x2e0f7c(0x190)];return _0x3a03d8&&removeSync(_0xe48a14),copySkillDirectory(_0x3debaf,_0xe48a14),{'path':_0xe48a14,'target':_0x3debaf,'action':!_0x3a03d8?_0x2e0f7c(0x19c):_0x1b72a5===_0x865e80?'unchanged':_0x2e0f7c(0x191)};}function copySkillDirectory(_0x5d41f6,_0x42b300){copySync(_0x5d41f6,_0x42b300,{'dereference':![],'overwrite':!![],'filter'(_0x3165c2){const _0x45451c=a158_0x1b15;if(lstatSync(_0x3165c2)[_0x45451c(0x172)]())throw CliErrors[_0x45451c(0x169)](_0x45451c(0x195)+_0x3165c2);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x482ab1,_0xeb4a8b){const _0x38699c=a159_0x1d26,_0x4ba762=_0x482ab1();while(!![]){try{const _0x1c6dde=-parseInt(_0x38699c(0x106))/0x1*(-parseInt(_0x38699c(0xee))/0x2)+-parseInt(_0x38699c(0xf4))/0x3*(-parseInt(_0x38699c(0xe8))/0x4)+parseInt(_0x38699c(0x104))/0x5+-parseInt(_0x38699c(0xf3))/0x6*(-parseInt(_0x38699c(0xf1))/0x7)+parseInt(_0x38699c(0x108))/0x8*(-parseInt(_0x38699c(0x10a))/0x9)+parseInt(_0x38699c(0xef))/0xa*(parseInt(_0x38699c(0xf9))/0xb)+-parseInt(_0x38699c(0x105))/0xc*(parseInt(_0x38699c(0x103))/0xd);if(_0x1c6dde===_0xeb4a8b)break;else _0x4ba762['push'](_0x4ba762['shift']());}catch(_0x2306ae){_0x4ba762['push'](_0x4ba762['shift']());}}}(a159_0xc578,0xbddf0));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x49656a,_0x1e57d9,_0x5a97ba={}){const _0x185dd4=a159_0x1d26,_0x301893=safePathSegment(_0x49656a[_0x185dd4(0x102)],_0x185dd4(0x102));if(_0x1e57d9[_0x185dd4(0x102)]!==_0x301893)throw CliErrors[_0x185dd4(0xfb)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x1e57d9['appCode']+_0x185dd4(0xf8)+_0x301893);const _0x2a9b59=normalizeRuntimeSkillScopes(_0x49656a[_0x185dd4(0xe1)]),_0x43bfed=new Set(_0x2a9b59),_0x314482=_0x49656a[_0x185dd4(0xf5)]?.[_0x185dd4(0xe9)](),_0x4e5fd6=new Map(),_0x11bf8e=resolve(getRuntimeSkillCacheRoot(_0x49656a['env'],_0x49656a[_0x185dd4(0x109)],_0x5a97ba),_0x301893);for(const _0x2d1bb5 of _0x2a9b59){for(const _0x122cec of localSkillEntryDirs(resolve(_0x11bf8e,_0x2d1bb5))){collectLocalRuntimeSkill(_0x4e5fd6,_0x122cec,{'appCode':_0x301893,'scopes':_0x43bfed,'code':_0x314482,'source':_0x185dd4(0x10b)});}}for(const _0x124ff2 of _0x1e57d9[_0x185dd4(0xe0)]){for(const _0x209a7e of localSkillLinkCandidates(_0x124ff2,_0x1e57d9,_0x43bfed)){collectLocalRuntimeSkill(_0x4e5fd6,_0x209a7e,{'appCode':_0x301893,'scopes':_0x43bfed,'code':_0x314482,'source':_0x185dd4(0xff),'linkedPath':_0x209a7e});}}return Array[_0x185dd4(0xfe)](_0x4e5fd6[_0x185dd4(0x101)]())[_0x185dd4(0xec)](compareLocalRuntimeSkills);}function a159_0xc578(){const _0x4fe0b3=['has','values','appCode','5550233muiZKr','3922320hPiVHu','84toflBC','84932KNASEJ','dir','472BEmItU','accessKey','169578jXeDgm','cache','tags','skillRoots','scopes','localeCompare','linkedPaths','set','isSymbolicLink','get','isDirectory','40CDmbqy','trim','source','scope','sort','linkedPath','32JsDFqS','10WLXMsH','name','287OkMHCB','builtin','212424EBQalq','207285rVJNAA','code','skillCode','local','\x20!=\x20','6512957tfhYrK','project','validation','startsWith','metadataPath','from','link'];a159_0xc578=function(){return _0x4fe0b3;};return a159_0xc578();}function localSkillEntryDirs(_0x8d2b9d){const _0x5e5c84=a159_0x1d26;if(!existsSync(_0x8d2b9d))return[];return readdirSync(_0x8d2b9d,{'withFileTypes':!![]})['filter'](_0x475bf1=>_0x475bf1[_0x5e5c84(0xe7)]()||_0x475bf1[_0x5e5c84(0xe5)]())['map'](_0x112def=>resolve(_0x8d2b9d,_0x112def[_0x5e5c84(0xf0)]));}function localSkillLinkCandidates(_0x5ab75,_0xe3dcfa,_0x4cb675){const _0x5a7a2d=a159_0x1d26;if(!existsSync(_0x5ab75))return[];const _0xa42b00=_0xe3dcfa[_0x5a7a2d(0x102)]+'--';return readdirSync(_0x5ab75,{'withFileTypes':!![]})['filter'](_0xde8625=>_0xde8625[_0x5a7a2d(0xe7)]()||_0xde8625[_0x5a7a2d(0xe5)]())['filter'](_0x1526b4=>_0xe3dcfa[_0x5a7a2d(0xeb)]===_0x5a7a2d(0xfa)||_0x1526b4[_0x5a7a2d(0xf0)][_0x5a7a2d(0xfc)](_0xa42b00)||_0x4cb675[_0x5a7a2d(0x100)](_0x5a7a2d(0xf2)))['map'](_0x9aa8d6=>resolve(_0x5ab75,_0x9aa8d6[_0x5a7a2d(0xf0)]));}function a159_0x1d26(_0x34f1b5,_0x4bbd37){_0x34f1b5=_0x34f1b5-0xe0;const _0xc57848=a159_0xc578();let _0x1d266d=_0xc57848[_0x34f1b5];return _0x1d266d;}function collectLocalRuntimeSkill(_0x5678c7,_0xc31592,_0x5bd54d){const _0x9d4875=a159_0x1d26,_0x4be31d=resolve(_0xc31592,METADATA_FILE),_0x326e11=readMetadataIfPresent(_0x4be31d);if(!_0x326e11)return;if(_0x326e11[_0x9d4875(0x102)]!==_0x5bd54d['appCode'])return;if(!isRuntimeSkillScope(_0x326e11[_0x9d4875(0xeb)])||!_0x5bd54d[_0x9d4875(0xe1)][_0x9d4875(0x100)](_0x326e11[_0x9d4875(0xeb)]))return;const _0x3d7e3b=_0x326e11[_0x9d4875(0xf6)]?.[_0x9d4875(0xe9)]();if(!_0x3d7e3b)return;if(_0x5bd54d[_0x9d4875(0xf5)]&&_0x3d7e3b!==_0x5bd54d[_0x9d4875(0xf5)])return;const _0x1389f9=_0x326e11['scope']+':'+_0x3d7e3b,_0x11ec82=_0x5bd54d[_0x9d4875(0xed)]?[_0x5bd54d[_0x9d4875(0xed)]]:[],_0x588e9a=_0x5678c7[_0x9d4875(0xe6)](_0x1389f9);if(_0x588e9a){_0x5bd54d[_0x9d4875(0xea)]==='cache'&&(_0x588e9a['dir']=_0xc31592,_0x588e9a['cacheDir']=_0xc31592,_0x588e9a['skillMdPath']=resolve(_0xc31592,SKILL_FILE),_0x588e9a[_0x9d4875(0xfd)]=_0x4be31d);for(const _0x23f93b of _0x11ec82){!_0x588e9a[_0x9d4875(0xe3)]['includes'](_0x23f93b)&&_0x588e9a[_0x9d4875(0xe3)]['push'](_0x23f93b);}_0x588e9a[_0x9d4875(0xe3)][_0x9d4875(0xec)]();return;}_0x5678c7[_0x9d4875(0xe4)](_0x1389f9,{..._0x326e11,'tags':Array['isArray'](_0x326e11[_0x9d4875(0x10c)])?_0x326e11[_0x9d4875(0x10c)]:[],'scope':_0x326e11[_0x9d4875(0xeb)],'source':_0x9d4875(0xf7),'dir':_0xc31592,'cacheDir':_0x5bd54d[_0x9d4875(0xea)]===_0x9d4875(0x10b)?_0xc31592:undefined,'skillMdPath':resolve(_0xc31592,SKILL_FILE),'metadataPath':_0x4be31d,'linkedPaths':_0x11ec82});}function compareLocalRuntimeSkills(_0x37b7db,_0x5d3ae5){const _0x318e7b=a159_0x1d26,_0xa7569b={'personal':0x0,'company':0x1,'builtin':0x2};return _0xa7569b[_0x37b7db[_0x318e7b(0xeb)]]-_0xa7569b[_0x5d3ae5[_0x318e7b(0xeb)]]||_0x37b7db[_0x318e7b(0xf6)]['localeCompare'](_0x5d3ae5['skillCode'])||_0x37b7db['dir'][_0x318e7b(0xe2)](_0x5d3ae5[_0x318e7b(0x107)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a160_0x4550(){const _0x32c1ea=['204YZwXrS','Skill\x20file\x20path\x20must\x20be\x20text.','toLowerCase','sort','trim','12384904TUBXAm','isDirectory','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','4898028fQlGgU','bytes','string','values','test','isBuffer','add','replace','has','excludedFilePaths','Skill\x20file\x20size\x20is\x20invalid:\x20','9LhBrIx','object','60IYVuxA','includes','compare','toString','589708NTPXbX','size','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','startsWith','sha256','isArray','set','4281470zHzYxn','utf8','566235sRzaAK','3nlEPui','validation','length','10974vbnZlK','Duplicate\x20Skill\x20file\x20path:\x20','content','path','name','isFile','4403dJSnRI','split','Unsafe\x20Skill\x20file\x20path:\x20','isSymbolicLink','push','1349183ZExKdA','localeCompare','from'];a160_0x4550=function(){return _0x32c1ea;};return a160_0x4550();}(function(_0x5a5f13,_0x3132db){const _0x400158=a160_0x46e7,_0x47eb4c=_0x5a5f13();while(!![]){try{const _0x2f5c1d=parseInt(_0x400158(0xec))/0x1*(-parseInt(_0x400158(0xe2))/0x2)+-parseInt(_0x400158(0x105))/0x3+parseInt(_0x400158(0xde))/0x4*(-parseInt(_0x400158(0xeb))/0x5)+-parseInt(_0x400158(0xef))/0x6*(-parseInt(_0x400158(0xf5))/0x7)+parseInt(_0x400158(0x102))/0x8+-parseInt(_0x400158(0x110))/0x9*(-parseInt(_0x400158(0xe9))/0xa)+parseInt(_0x400158(0xfa))/0xb*(parseInt(_0x400158(0xfd))/0xc);if(_0x2f5c1d===_0x3132db)break;else _0x47eb4c['push'](_0x47eb4c['shift']());}catch(_0x383d51){_0x47eb4c['push'](_0x47eb4c['shift']());}}}(a160_0x4550,0xf3213));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';function a160_0x46e7(_0x36214f,_0x25322d){_0x36214f=_0x36214f-0xde;const _0x455018=a160_0x4550();let _0x46e794=_0x455018[_0x36214f];return _0x46e794;}import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x591f82){const _0x3b45c1=a160_0x46e7;return _0x591f82[_0x3b45c1(0x106)]??Buffer[_0x3b45c1(0xfc)](_0x591f82[_0x3b45c1(0xf1)]??'',_0x3b45c1(0xea));}export function fileText(_0x51a696){const _0x51778e=a160_0x46e7;return fileContent(_0x51a696)[_0x51778e(0xe1)](_0x51778e(0xea));}export function normalizeLocalFiles(_0x5c9e2d){const _0x349224=a160_0x46e7;if(!Array[_0x349224(0xe7)](_0x5c9e2d)||_0x5c9e2d['length']===0x0)return[];const _0x538675=new Map();for(const _0x19941e of _0x5c9e2d){if(!_0x19941e||typeof _0x19941e!==_0x349224(0x111)||typeof _0x19941e[_0x349224(0xf2)]!==_0x349224(0x107))throw CliErrors[_0x349224(0xed)](_0x349224(0xfe));const _0x4bb382=normalizeSkillRelativePath(_0x19941e[_0x349224(0xf2)]);if(_0x538675[_0x349224(0x10d)](_0x4bb382))throw CliErrors[_0x349224(0xed)](_0x349224(0xf0)+_0x4bb382);if(_0x19941e['bytes']!==undefined&&!Buffer[_0x349224(0x10a)](_0x19941e[_0x349224(0x106)]))throw CliErrors[_0x349224(0xed)](_0x349224(0xe4)+_0x4bb382);if(_0x19941e[_0x349224(0x106)]===undefined&&typeof _0x19941e[_0x349224(0xf1)]!==_0x349224(0x107))throw CliErrors[_0x349224(0xed)](_0x349224(0x104)+_0x4bb382);const _0x3e4ef9=fileContent(_0x19941e);_0x538675[_0x349224(0xe8)](_0x4bb382,{'path':_0x4bb382,'bytes':_0x3e4ef9});}return Array['from'](_0x538675[_0x349224(0x108)]())[_0x349224(0x100)](compareSkillFiles);}export function normalizeManifestFiles(_0x511cf7){const _0x23f92a=a160_0x46e7;if(!Array[_0x23f92a(0xe7)](_0x511cf7)||_0x511cf7[_0x23f92a(0xee)]===0x0)return[];const _0x52eb94=new Map();for(const _0x1e9690 of _0x511cf7){if(!_0x1e9690||typeof _0x1e9690!=='object'||typeof _0x1e9690[_0x23f92a(0xf2)]!==_0x23f92a(0x107))throw CliErrors[_0x23f92a(0xed)](_0x23f92a(0xfe));const _0x201bb7=normalizeSkillRelativePath(_0x1e9690['path']);if(_0x52eb94[_0x23f92a(0x10d)](_0x201bb7))throw CliErrors[_0x23f92a(0xed)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x201bb7);if(!isSha256Hex(_0x1e9690[_0x23f92a(0xe6)]))throw CliErrors[_0x23f92a(0xed)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x201bb7);if(!Number['isSafeInteger'](_0x1e9690[_0x23f92a(0xe3)])||_0x1e9690[_0x23f92a(0xe3)]<0x0)throw CliErrors[_0x23f92a(0xed)](_0x23f92a(0x10f)+_0x201bb7);_0x52eb94['set'](_0x201bb7,{'path':_0x201bb7,'sha256':_0x1e9690['sha256'][_0x23f92a(0xff)](),'size':_0x1e9690[_0x23f92a(0xe3)]});}return Array[_0x23f92a(0xfc)](_0x52eb94[_0x23f92a(0x108)]())[_0x23f92a(0x100)](compareSkillFiles);}export function scanSkillDirectory(_0x4e635a,_0x1d03ee={}){const _0x293bef=a160_0x46e7,_0x263136=realpathSync(_0x4e635a),_0x2bb37d=canonicalExcludedFilePaths(_0x1d03ee[_0x293bef(0x10e)]),_0x4ef25e=[];function _0x3b8099(_0x553e21){const _0x2fc787=_0x293bef,_0x42b5f0=readdirSync(_0x553e21,{'withFileTypes':!![]})[_0x2fc787(0x100)]((_0x6e9e43,_0x439001)=>_0x6e9e43['name'][_0x2fc787(0xfb)](_0x439001[_0x2fc787(0xf3)]));for(const _0xa475c2 of _0x42b5f0){if(_0xa475c2[_0x2fc787(0x103)]()&&IGNORED_DIR_NAMES[_0x2fc787(0x10d)](_0xa475c2[_0x2fc787(0xf3)]))continue;if(IGNORED_FILE_NAMES[_0x2fc787(0x10d)](_0xa475c2[_0x2fc787(0xf3)]))continue;const _0x2eeaab=resolve(_0x553e21,_0xa475c2['name']);if(isExcludedFilePath(_0x2eeaab,_0x2bb37d))continue;if(_0xa475c2[_0x2fc787(0xf8)]())throw CliErrors[_0x2fc787(0xed)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x2eeaab);const _0x446883=toPosixPath(relative(_0x263136,_0x2eeaab));if(_0xa475c2[_0x2fc787(0x103)]()){_0x3b8099(_0x2eeaab);continue;}if(!_0xa475c2[_0x2fc787(0xf4)]())continue;validateSkillRelativePath(_0x446883);const _0x455f25=readFileSync(_0x2eeaab);_0x4ef25e[_0x2fc787(0xf9)]({'path':_0x446883,'bytes':_0x455f25});}}return _0x3b8099(_0x263136),normalizeLocalFiles(_0x4ef25e);}function canonicalExcludedFilePaths(_0x4b425a){const _0x37fda2=a160_0x46e7,_0xbe6913=new Set();for(const _0x12d488 of _0x4b425a??[]){const _0x4126ec=resolve(_0x12d488);_0xbe6913[_0x37fda2(0x10b)](_0x4126ec);try{_0xbe6913['add'](realpathSync(_0x4126ec));}catch{}}return _0xbe6913;}function isExcludedFilePath(_0x17504c,_0x32d011){const _0x3a9ee3=a160_0x46e7;if(_0x32d011['has'](_0x17504c))return!![];if(_0x32d011['size']===0x0)return![];try{return _0x32d011[_0x3a9ee3(0x10d)](realpathSync(_0x17504c));}catch{return![];}}export function compareSkillFiles(_0x44ee5a,_0x2c11b6){const _0x25e519=a160_0x46e7;if(_0x44ee5a['path']===SKILL_FILE)return _0x2c11b6[_0x25e519(0xf2)]===SKILL_FILE?0x0:-0x1;if(_0x2c11b6['path']===SKILL_FILE)return 0x1;return Buffer[_0x25e519(0xe0)](Buffer[_0x25e519(0xfc)](_0x44ee5a[_0x25e519(0xf2)],'utf8'),Buffer[_0x25e519(0xfc)](_0x2c11b6[_0x25e519(0xf2)],_0x25e519(0xea)));}export function normalizeSkillRelativePath(_0x573791){const _0x3d72e5=a160_0x46e7,_0x39e163=toPosixPath(_0x573791[_0x3d72e5(0x101)]());return validateSkillRelativePath(_0x39e163),_0x39e163;}export function validateSkillRelativePath(_0x3d8f74){const _0x4957b0=a160_0x46e7;if(!_0x3d8f74||_0x3d8f74[_0x4957b0(0xe5)]('/')||_0x3d8f74[_0x4957b0(0xdf)]('//'))throw CliErrors[_0x4957b0(0xed)](_0x4957b0(0xf7)+_0x3d8f74);for(const _0x5eb255 of _0x3d8f74[_0x4957b0(0xf6)]('/')){if(!_0x5eb255||_0x5eb255==='.'||_0x5eb255==='..')throw CliErrors[_0x4957b0(0xed)](_0x4957b0(0xf7)+_0x3d8f74);}}export function toPosixPath(_0x28502c){const _0x575cf6=a160_0x46e7;return _0x28502c[_0x575cf6(0x10c)](/\\/g,'/');}export function isSha256Hex(_0x27dcfb){const _0x44d1f0=a160_0x46e7;return typeof _0x27dcfb===_0x44d1f0(0x107)&&/^[a-fA-F0-9]{64}$/[_0x44d1f0(0x109)](_0x27dcfb);}
|
|
@@ -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(_0x37314c,_0x2be040){const _0x37fc4e=a161_0x481f,_0x2b774e=_0x37314c();while(!![]){try{const _0xb00b9e=-parseInt(_0x37fc4e(0xbb))/0x1*(-parseInt(_0x37fc4e(0x8e))/0x2)+parseInt(_0x37fc4e(0x8a))/0x3+parseInt(_0x37fc4e(0xae))/0x4+parseInt(_0x37fc4e(0xac))/0x5+parseInt(_0x37fc4e(0x9a))/0x6+-parseInt(_0x37fc4e(0x93))/0x7+parseInt(_0x37fc4e(0xa1))/0x8*(-parseInt(_0x37fc4e(0x92))/0x9);if(_0xb00b9e===_0x2be040)break;else _0x2b774e['push'](_0x2b774e['shift']());}catch(_0x2ebd9a){_0x2b774e['push'](_0x2b774e['shift']());}}}(a161_0x2862,0x9c4f4));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';function a161_0x2862(){const _0x3898b2=['entries','description','trimEnd','status','example','trim','1185445swsoTw','skillName','3568892ucnTMl','displayName','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','.\x20Changed\x20file:\x20','description:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','name','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','contents','\x0a---\x0a\x0a','match','keys','59zqzJbG','length','scope','errors','version','utf8','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','isFile','env','paths','3183636YKyBnZ','pulledAt','appCode','displayName:\x20','42958WvHyNR','test','has','Runtime\x20Skill\x20package\x20is\x20missing\x20','36fSiMSB','2193184eKhzGX','flow','fileHashes','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','path','contentHash','---','7611522gVAsAT','map','set','stringify','delete','schemaVersion','validation','7545632CwhAYg','replace','accessKey','toString','skillCode'];a161_0x2862=function(){return _0x3898b2;};return a161_0x2862();}import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a161_0x481f(_0x42313f,_0x3f0f67){_0x42313f=_0x42313f-0x81;const _0x286204=a161_0x2862();let _0x481f74=_0x286204[_0x42313f];return _0x481f74;}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(_0x20dc37,_0x489480,_0x29f06a){const _0x391854=a161_0x481f,_0x2d0690=requireSkillCode(_0x20dc37),_0x4d4af2=requirePackageBytes(_0x2d0690,_0x29f06a['packageBytes']),_0x303b36=extractDownloadedPackage(_0x4d4af2),_0x2d083a=_0x303b36['find'](_0x4dbed7=>_0x4dbed7[_0x391854(0x97)]===SKILL_FILE);if(!_0x2d083a)throw CliErrors[_0x391854(0xa0)](_0x391854(0x91)+SKILL_FILE+':\x20'+_0x2d0690);const _0x54418c=withMaterializedSkillFrontmatter(_0x303b36,_0x20dc37,_0x2d0690),_0x526c9a=_0x54418c['find'](_0x57b283=>_0x57b283[_0x391854(0x97)]===SKILL_FILE),_0x2e6db=fileText(_0x526c9a),_0x2de133=getRuntimeSkillDir(_0x29f06a[_0x391854(0x88)],_0x29f06a[_0x391854(0xa3)],_0x29f06a[_0x391854(0x8c)],_0x489480,_0x2d0690,_0x29f06a[_0x391854(0x89)]),_0x12977a=resolve(_0x2de133,SKILL_FILE),_0x5ad435=resolve(_0x2de133,METADATA_FILE),_0x13f00a=contentHash(_0x2e6db),_0x5db8a8=readMetadataIfPresent(_0x5ad435)?.[_0x391854(0x95)];ensurePulledFilesCanBeOverwritten(_0x2de133,_0x5ad435,_0x54418c,_0x29f06a['force']===!![]),mkdirSync(_0x2de133,{'recursive':!![],'mode':0x1c0});const _0x1eedba=existsSync(_0x12977a)?readFileSync(_0x12977a,'utf8'):undefined;return materializeFiles(_0x2de133,_0x54418c),removeStaleManagedFiles(_0x2de133,_0x5db8a8,_0x54418c),writeJsonAtomic(_0x5ad435,buildMetadata(_0x20dc37,_0x489480,_0x29f06a[_0x391854(0x8c)],_0x13f00a,_0x29f06a[_0x391854(0x8b)],_0x54418c,_0x4d4af2)),{'skill':_0x20dc37,'scope':_0x489480,'dir':_0x2de133,'skillMdPath':_0x12977a,'metadataPath':_0x5ad435,'contentHash':_0x13f00a,'changed':_0x1eedba!==_0x2e6db};}export function reuseMaterializedRuntimeSkill(_0x40e3f2,_0x4a9a8d,_0x1d7a37){const _0x4856e8=a161_0x481f,_0x43491e=_0x40e3f2[_0x4856e8(0x84)]?.[_0x4856e8(0xab)]();if(!_0x43491e)return undefined;const _0x15743d=requireSkillCode(_0x40e3f2),_0x4dc05a=getRuntimeSkillDir(_0x1d7a37[_0x4856e8(0x88)],_0x1d7a37[_0x4856e8(0xa3)],_0x1d7a37[_0x4856e8(0x8c)],_0x4a9a8d,_0x15743d,_0x1d7a37['paths']),_0x5ec687=resolve(_0x4dc05a,SKILL_FILE),_0x3cc41a=resolve(_0x4dc05a,METADATA_FILE),_0x38aece=readMetadataIfPresent(_0x3cc41a);if(!_0x38aece||_0x38aece[_0x4856e8(0x9f)]!==0x2||_0x38aece['appCode']!==_0x1d7a37[_0x4856e8(0x8c)]||_0x38aece[_0x4856e8(0x82)]!==_0x4a9a8d||_0x38aece[_0x4856e8(0xa5)]!==_0x15743d||_0x38aece[_0x4856e8(0x84)]!==_0x43491e||_0x38aece['id']!==_0x40e3f2['id']||_0x38aece[_0x4856e8(0xad)]!==_0x40e3f2['skillName']||_0x38aece['description']!==_0x40e3f2[_0x4856e8(0xa7)]||_0x38aece[_0x4856e8(0xaa)]!==_0x40e3f2[_0x4856e8(0xaa)]||_0x38aece[_0x4856e8(0xa9)]!==_0x40e3f2['status']||!_0x38aece[_0x4856e8(0x98)]||!_0x38aece[_0x4856e8(0x95)]||!Object['hasOwn'](_0x38aece[_0x4856e8(0x95)],SKILL_FILE))return undefined;for(const [_0x2bfcd0,_0x5c2d78]of Object[_0x4856e8(0xa6)](_0x38aece[_0x4856e8(0x95)])){if(!/^[a-f0-9]{64}$/['test'](_0x5c2d78))return undefined;const _0x5cbeb0=resolveManagedFilePath(_0x4dc05a,_0x2bfcd0);if(!existsSync(_0x5cbeb0)||!lstatSync(_0x5cbeb0)[_0x4856e8(0x87)]())return undefined;if(bufferSha256(readFileSync(_0x5cbeb0))!==_0x5c2d78)return undefined;}return{'skill':_0x40e3f2,'scope':_0x4a9a8d,'dir':_0x4dc05a,'skillMdPath':_0x5ec687,'metadataPath':_0x3cc41a,'contentHash':_0x38aece[_0x4856e8(0x98)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x3b5522,_0x7ae0e9,_0x49c56b){const _0x495880=a161_0x481f,_0x4495e9=skillDisplayName(_0x7ae0e9,_0x49c56b),_0xfe0f9a=_0x7ae0e9[_0x495880(0xa7)]?.[_0x495880(0xab)]()||_0x4495e9||_0x49c56b;return normalizeLocalFiles(_0x3b5522)[_0x495880(0x9b)](_0x3bf8c0=>{const _0x89a936=_0x495880,_0x47b769=fileText(_0x3bf8c0);if(_0x3bf8c0[_0x89a936(0x97)]!==SKILL_FILE)return _0x3bf8c0;if(hasYamlFrontmatter(_0x47b769))return{'path':_0x3bf8c0[_0x89a936(0x97)],'content':withSyncedDisplayName(_0x47b769,_0x4495e9)};return{'path':_0x3bf8c0[_0x89a936(0x97)],'content':prependSkillFrontmatter(_0x47b769,{'name':_0x49c56b,'displayName':_0x4495e9,'description':_0xfe0f9a})};});}function hasYamlFrontmatter(_0x1c9d40){const _0x463ca3=a161_0x481f;return/^\uFEFF?---\s*\r?\n/[_0x463ca3(0x8f)](_0x1c9d40);}function prependSkillFrontmatter(_0x26a6dd,_0x5dd1d0){const _0x117bc1=a161_0x481f,_0x2ab80=_0x26a6dd[_0x117bc1(0xa2)](/^\uFEFF/,'');return[_0x117bc1(0x99),'name:\x20'+yamlString(_0x5dd1d0[_0x117bc1(0xb5)]),_0x5dd1d0['displayName']?_0x117bc1(0x8d)+yamlString(_0x5dd1d0[_0x117bc1(0xaf)]):undefined,_0x117bc1(0xb2)+yamlString(_0x5dd1d0[_0x117bc1(0xa7)]),_0x117bc1(0x99),'',_0x2ab80]['filter'](_0x378d96=>_0x378d96!==undefined)['join']('\x0a');}function yamlString(_0x4cd759){const _0x5eb49d=a161_0x481f;return JSON[_0x5eb49d(0x9d)](_0x4cd759[_0x5eb49d(0xa2)](/\r/g,'')[_0x5eb49d(0xab)]());}function skillDisplayName(_0x4ab92b,_0x52c1fc){const _0x4eb099=_0x4ab92b['skillName']?.['trim']();return _0x4eb099||_0x52c1fc;}function withSyncedDisplayName(_0x525d6b,_0x21f0bc){const _0x191a68=a161_0x481f,_0x38cfa6=_0x525d6b[_0x191a68(0xb9)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x38cfa6)return _0x525d6b;const _0x535a37=_0x38cfa6[0x1]??'',_0x1f1565=_0x38cfa6[0x2]??'',_0x2479a9=parseDocument(_0x1f1565);if(_0x2479a9[_0x191a68(0x83)][_0x191a68(0x81)]>0x0||!isMap(_0x2479a9[_0x191a68(0xb7)]))return _0x525d6b;if(_0x21f0bc)_0x2479a9[_0x191a68(0x9c)](_0x191a68(0xaf),_0x21f0bc);else{if(_0x2479a9[_0x191a68(0x90)](_0x191a68(0xaf)))_0x2479a9[_0x191a68(0x9e)](_0x191a68(0xaf));else return _0x525d6b;}forceBlockCollections(_0x2479a9[_0x191a68(0xb7)]);const _0x479f4d=_0x2479a9[_0x191a68(0xa4)]({'lineWidth':0x0})[_0x191a68(0xa8)](),_0x4c5854=_0x525d6b['slice'](_0x38cfa6[0x0]['length'])[_0x191a68(0xa2)](/^\r?\n/,'');return _0x535a37+'---\x0a'+_0x479f4d+_0x191a68(0xb8)+_0x4c5854;}function forceBlockCollections(_0x307f30){if(!isNode(_0x307f30))return;visit(_0x307f30,(_0x3b7ecc,_0x43b88c)=>{const _0x5334c9=a161_0x481f;isCollection(_0x43b88c)&&(_0x43b88c[_0x5334c9(0x94)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0xc3468c,_0x358dfe,_0x156b2c,_0x2577a1){const _0x7af7b4=a161_0x481f;if(_0x2577a1||!existsSync(_0x358dfe))return;const _0x323405=readMetadataIfPresent(_0x358dfe);if(!_0x323405)return;const _0x37fc6b=_0x323405[_0x7af7b4(0x95)]&&Object[_0x7af7b4(0xba)](_0x323405['fileHashes'])[_0x7af7b4(0x81)]>0x0?_0x323405['fileHashes']:undefined;if(_0x37fc6b)for(const [_0x3e16a3,_0x1f8786]of Object[_0x7af7b4(0xa6)](_0x37fc6b)){const _0x45933a=resolveManagedFilePath(_0xc3468c,_0x3e16a3);if(!existsSync(_0x45933a))throw CliErrors['validation'](_0x7af7b4(0xb0)+_0xc3468c,_0x7af7b4(0xb4)+_0x3e16a3);const _0x5e48ff=lstatSync(_0x45933a);if(!_0x5e48ff['isFile']())throw CliErrors[_0x7af7b4(0xa0)](_0x7af7b4(0xb0)+_0xc3468c,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x3e16a3);const _0x30e42e=bufferSha256(readFileSync(_0x45933a));if(_0x30e42e!==_0x1f8786)throw CliErrors[_0x7af7b4(0xa0)](_0x7af7b4(0xb0)+_0xc3468c+_0x7af7b4(0xb1)+_0x3e16a3,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x3e16a3);}else{const _0x529f03=resolve(_0xc3468c,SKILL_FILE);if(existsSync(_0x529f03)&&_0x323405[_0x7af7b4(0x98)]){const _0x241a8f=contentHash(readFileSync(_0x529f03,_0x7af7b4(0x85)));if(_0x241a8f!==_0x323405[_0x7af7b4(0x98)])throw CliErrors[_0x7af7b4(0xa0)](_0x7af7b4(0xb3)+_0x529f03,_0x7af7b4(0x96));}}for(const _0x41e469 of normalizeLocalFiles(_0x156b2c)){if(_0x37fc6b?.[_0x41e469[_0x7af7b4(0x97)]])continue;if(!_0x37fc6b&&_0x41e469['path']===SKILL_FILE)continue;const _0x2b5aa7=resolveManagedFilePath(_0xc3468c,_0x41e469['path']);if(!existsSync(_0x2b5aa7))continue;const _0x414c16=lstatSync(_0x2b5aa7);if(!_0x414c16[_0x7af7b4(0x87)]())throw CliErrors[_0x7af7b4(0xa0)](_0x7af7b4(0xb0)+_0xc3468c,_0x7af7b4(0xb6)+_0x41e469['path']);const _0x10eb37=bufferSha256(readFileSync(_0x2b5aa7));if(_0x10eb37!==fileHash(_0x41e469))throw CliErrors['validation'](_0x7af7b4(0xb0)+_0xc3468c,_0x7af7b4(0x86)+_0x41e469['path']);}}function materializeFiles(_0x59e166,_0x1a317a){const _0x5a0bf0=a161_0x481f;for(const _0xb035c of normalizeLocalFiles(_0x1a317a)){const _0x55f614=resolveManagedFilePath(_0x59e166,_0xb035c[_0x5a0bf0(0x97)]);mkdirSync(dirname(_0x55f614),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x55f614,fileContent(_0xb035c),0x180);}}function removeStaleManagedFiles(_0xe1983e,_0x10fbbf,_0xe121ea){const _0x254b47=a161_0x481f;if(!_0x10fbbf)return;const _0x1cc040=new Set(normalizeLocalFiles(_0xe121ea)[_0x254b47(0x9b)](_0x715bb=>_0x715bb[_0x254b47(0x97)]));for(const _0x1d6e1a of Object[_0x254b47(0xba)](_0x10fbbf)){if(_0x1cc040['has'](_0x1d6e1a))continue;const _0x2d3b40=resolveManagedFilePath(_0xe1983e,_0x1d6e1a);existsSync(_0x2d3b40)&&lstatSync(_0x2d3b40)[_0x254b47(0x87)]()&&rmSync(_0x2d3b40,{'force':!![]});}}
|