@lovrabet/lovrabet-cli 2.3.11 → 2.3.12-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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.d.ts +13 -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.d.ts +3 -2
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a148_0x4e8d(_0x22ec1f,_0x5eab08){_0x22ec1f=_0x22ec1f-0x1f1;const _0xe2e07c=a148_0xe2e0();let _0x4e8d33=_0xe2e07c[_0x22ec1f];return _0x4e8d33;}(function(_0x5e81e4,_0x22e546){const _0x59c456=a148_0x4e8d,_0x5304d6=_0x5e81e4();while(!![]){try{const _0x4d6792=-parseInt(_0x59c456(0x1f6))/0x1+parseInt(_0x59c456(0x1f4))/0x2+parseInt(_0x59c456(0x203))/0x3*(parseInt(_0x59c456(0x1f9))/0x4)+parseInt(_0x59c456(0x1fb))/0x5+parseInt(_0x59c456(0x1f3))/0x6*(parseInt(_0x59c456(0x200))/0x7)+-parseInt(_0x59c456(0x1f7))/0x8*(parseInt(_0x59c456(0x206))/0x9)+-parseInt(_0x59c456(0x205))/0xa*(-parseInt(_0x59c456(0x1fe))/0xb);if(_0x4d6792===_0x22e546)break;else _0x5304d6['push'](_0x5304d6['shift']());}catch(_0x4618ed){_0x5304d6['push'](_0x5304d6['shift']());}}}(a148_0xe2e0,0xec0b5));function a148_0xe2e0(){const _0x149684=['2794722oxaaux','107548vtdwiT','datasetCode','1850127lQuIOn','8jVVuoc','object','772pYnQFs','dataset','8100420nsGLMt','some','code','1804858PvWNWl','Dataset\x20source\x20metadata\x20is\x20inconsistent.','14ewNdPA','length','sourceType','6651tZsyyQ','appCode','80PXgJzX','13760757YnSaZv','string','source','Dataset\x20metadata\x20is\x20missing.','filter'];a148_0xe2e0=function(){return _0x149684;};return a148_0xe2e0();}export function assertDatasetImportTarget(_0x5d68c0,_0xf28da0,_0xd5d1ca){const _0x8e8b85=a148_0x4e8d;if(!_0x5d68c0||typeof _0x5d68c0!==_0x8e8b85(0x1f8)||Array['isArray'](_0x5d68c0))throw Error(_0x8e8b85(0x1f1));const _0x47b213=[_0x5d68c0[_0x8e8b85(0x1fd)],_0x5d68c0['modelCode'],_0x5d68c0[_0x8e8b85(0x1fa)]?.[_0x8e8b85(0x1f5)]][_0x8e8b85(0x1f2)](_0x19ded=>_0x19ded!=null);if(!_0x47b213[_0x8e8b85(0x201)]||_0x47b213[_0x8e8b85(0x1fc)](_0x24a53d=>_0x24a53d!==_0xd5d1ca)||_0x5d68c0['appCode']!=null&&_0x5d68c0[_0x8e8b85(0x204)]!==_0xf28da0||_0x5d68c0[_0x8e8b85(0x1fa)]?.[_0x8e8b85(0x204)]!=null&&_0x5d68c0[_0x8e8b85(0x1fa)][_0x8e8b85(0x204)]!==_0xf28da0)throw Error('Dataset\x20metadata\x20does\x20not\x20match\x20the\x20requested\x20target.');const _0xd274=[_0x5d68c0[_0x8e8b85(0x208)],_0x5d68c0[_0x8e8b85(0x1fa)]?.[_0x8e8b85(0x202)]][_0x8e8b85(0x1f2)](_0x4d9c34=>_0x4d9c34!=null);if(_0xd274[_0x8e8b85(0x1fc)](_0x24ec9f=>typeof _0x24ec9f!==_0x8e8b85(0x207)||_0x24ec9f!==_0xd274[0x0]))throw Error(_0x8e8b85(0x1ff));return _0xd274[0x0];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1bc41f,_0xac493c){const _0x4a5cc5=a149_0x5666,_0x348b1f=_0x1bc41f();while(!![]){try{const _0x50b740=parseInt(_0x4a5cc5(0x1d3))/0x1+parseInt(_0x4a5cc5(0x1c3))/0x2*(-parseInt(_0x4a5cc5(0x1c5))/0x3)+parseInt(_0x4a5cc5(0x1c7))/0x4+-parseInt(_0x4a5cc5(0x1ca))/0x5*(-parseInt(_0x4a5cc5(0x1c1))/0x6)+parseInt(_0x4a5cc5(0x1c2))/0x7*(-parseInt(_0x4a5cc5(0x1c4))/0x8)+-parseInt(_0x4a5cc5(0x1c6))/0x9*(parseInt(_0x4a5cc5(0x1d5))/0xa)+parseInt(_0x4a5cc5(0x1cd))/0xb*(parseInt(_0x4a5cc5(0x1d6))/0xc);if(_0x50b740===_0xac493c)break;else _0x348b1f['push'](_0x348b1f['shift']());}catch(_0x18d199){_0x348b1f['push'](_0x348b1f['shift']());}}}(a149_0x54d1,0x5fec4));function a149_0x5666(_0x5d4502,_0x6f73a0){_0x5d4502=_0x5d4502-0x1c1;const _0x54d1f8=a149_0x54d1();let _0x566690=_0x54d1f8[_0x5d4502];return _0x566690;}function a149_0x54d1(){const _0x50f88c=['225YXjtat','2069728LirYvS','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','push','8600dSivXB','length','rows','682WqgyRG','schemaVersion','rowNumber','values','maxBatchBytes','map','228703AKWwEg','stringify','139850NsIlRG','110952KWCYjR','Excel\x20row\x20','2064yUPwUH','14xfkBQZ','724GBFMaz','1863600YhJugE','5823TznMvy'];a149_0x54d1=function(){return _0x50f88c;};return a149_0x54d1();}export function previewImportBatchCount(_0x36eadf,_0x573d84,_0x4e14b3){const _0x4bf4fb=a149_0x5666,_0x936135=_0x4c1598=>_0x4c1598[_0x4bf4fb(0x1d2)](_0x5d564e=>_0x573d84[_0x4bf4fb(0x1ce)]===0x1?{..._0x36eadf['rows'][_0x5d564e]['values'],'id':-0x1fffffffffffff}:_0x36eadf[_0x4bf4fb(0x1cc)][_0x5d564e][_0x4bf4fb(0x1d0)]),_0x33187a=_0x250dcf=>Buffer['byteLength'](JSON[_0x4bf4fb(0x1d4)]({'schemaFingerprint':_0x573d84['schemaFingerprint'],..._0x573d84[_0x4bf4fb(0x1ce)]===0x2?{'taskId':0x2**0x34}:{},'items':_0x936135(_0x250dcf)}),'utf8');let _0x4f9e99=0x0,_0x562054=[];for(let _0x50b39f=0x0;_0x50b39f<_0x36eadf['rows'][_0x4bf4fb(0x1cb)];_0x50b39f++){if(_0x33187a([_0x50b39f])>_0x573d84['maxBatchBytes'])throw Error(_0x4bf4fb(0x1d7)+_0x36eadf['rows'][_0x50b39f][_0x4bf4fb(0x1cf)]+_0x4bf4fb(0x1c8));_0x562054[_0x4bf4fb(0x1cb)]&&(_0x562054[_0x4bf4fb(0x1cb)]===_0x4e14b3||_0x33187a([..._0x562054,_0x50b39f])>_0x573d84[_0x4bf4fb(0x1d1)])&&(_0x4f9e99++,_0x562054=[]),_0x562054[_0x4bf4fb(0x1c9)](_0x50b39f);}return _0x4f9e99+Number(_0x562054[_0x4bf4fb(0x1cb)]>0x0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a150_0x4d21b9=a150_0x2ad4;(function(_0x4614e0,_0x4167b6){const _0x43e265=a150_0x2ad4,_0x361d6e=_0x4614e0();while(!![]){try{const _0x2676ea=parseInt(_0x43e265(0xf3))/0x1*(-parseInt(_0x43e265(0x134))/0x2)+parseInt(_0x43e265(0x128))/0x3+-parseInt(_0x43e265(0xd2))/0x4+parseInt(_0x43e265(0x12f))/0x5*(parseInt(_0x43e265(0x10f))/0x6)+parseInt(_0x43e265(0xd3))/0x7*(-parseInt(_0x43e265(0xdd))/0x8)+-parseInt(_0x43e265(0xfe))/0x9+-parseInt(_0x43e265(0xd8))/0xa*(-parseInt(_0x43e265(0x14b))/0xb);if(_0x2676ea===_0x4167b6)break;else _0x361d6e['push'](_0x361d6e['shift']());}catch(_0x119ec){_0x361d6e['push'](_0x361d6e['shift']());}}}(a150_0xb6e9,0x53416));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(_0x5ea0bd){const _0x2323bc=a150_0x2ad4;if(Array['isArray'](_0x5ea0bd))return'['+_0x5ea0bd[_0x2323bc(0x12a)](canonical)[_0x2323bc(0x120)](',')+']';if(_0x5ea0bd&&typeof _0x5ea0bd===_0x2323bc(0x12b))return'{'+Object[_0x2323bc(0x122)](_0x5ea0bd)[_0x2323bc(0xfd)]()[_0x2323bc(0x12a)](_0x3551f5=>JSON[_0x2323bc(0x112)](_0x3551f5)+':'+canonical(_0x5ea0bd[_0x3551f5]))['join'](',')+'}';return JSON[_0x2323bc(0x112)](_0x5ea0bd)??'undefined';}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a150_0x4d21b9(0x119),a150_0x4d21b9(0x13b),a150_0x4d21b9(0xe4),'district',a150_0x4d21b9(0xe5),a150_0x4d21b9(0x108),a150_0x4d21b9(0xdb),a150_0x4d21b9(0x14c),a150_0x4d21b9(0xd7),a150_0x4d21b9(0x109),a150_0x4d21b9(0x10b),a150_0x4d21b9(0xfa),a150_0x4d21b9(0xca),'streetNumber',a150_0x4d21b9(0xef),'longitude',a150_0x4d21b9(0xf5),a150_0x4d21b9(0xcd),a150_0x4d21b9(0x102),'lbswuaCacheId']);export function sameImportValue(_0x467ead,_0x5c9431,_0x18d152=![]){const _0x589077=a150_0x4d21b9;if(_0x18d152){const _0x24d7be=_0x24fde2=>Array[_0x589077(0xf1)](_0x24fde2)?_0x24fde2[_0x589077(0x12a)](_0x2ca634=>{const _0xe9b191=_0x589077;if(!_0x2ca634||typeof _0x2ca634!=='object'||Array[_0xe9b191(0xf1)](_0x2ca634))return _0x2ca634;const _0x15a459={..._0x2ca634};delete _0x15a459[_0xe9b191(0x123)],delete _0x15a459[_0xe9b191(0xfc)];if(_0x15a459['dingTalkUrl']==='')delete _0x15a459[_0xe9b191(0x105)];if(_0x15a459[_0xe9b191(0xce)]==null)delete _0x15a459[_0xe9b191(0xce)];if(_0x15a459[_0xe9b191(0xf4)]==null)delete _0x15a459[_0xe9b191(0xf4)];if(_0x15a459[_0xe9b191(0x127)]==null||typeof _0x15a459[_0xe9b191(0x127)]===_0xe9b191(0x12b)&&!Array[_0xe9b191(0xf1)](_0x15a459[_0xe9b191(0x127)])&&Object['entries'](_0x15a459['geolocation'])[_0xe9b191(0x133)](([_0x3d5631,_0x10d909])=>EMPTY_IMAGE_LOCATION_FIELDS[_0xe9b191(0xf6)](_0x3d5631)&&_0x10d909===null))delete _0x15a459[_0xe9b191(0x127)];for(const _0x414630 of[_0xe9b191(0xf7),'type',_0xe9b191(0xf0)])if(!(_0x414630 in _0x15a459))_0x15a459[_0x414630]='';if(_0x15a459['size']==null)_0x15a459[_0xe9b191(0x149)]=0x0;return _0x15a459;}):_0x24fde2;return canonical(_0x24d7be(_0x467ead))===canonical(_0x24d7be(_0x5c9431));}return _0x467ead===null?_0x5c9431===null||_0x5c9431===undefined:canonical(_0x5c9431)===canonical(_0x467ead);}function a150_0x2ad4(_0x132c35,_0x33c772){_0x132c35=_0x132c35-0xc9;const _0xb6e9f2=a150_0xb6e9();let _0x2ad47b=_0xb6e9f2[_0x132c35];return _0x2ad47b;}async function rejectSymlink(_0x1fc9f5){const _0x212d93=a150_0x4d21b9;try{if((await lstat(_0x1fc9f5))[_0x212d93(0x13f)]())throw Error(_0x212d93(0xdc));}catch(_0x508266){if(_0x508266[_0x212d93(0xe1)]!==_0x212d93(0x116))throw _0x508266;}}export async function resolveImportOutputPath(_0x594209){return await rejectSymlink(_0x594209),resolve(await realpath(dirname(resolve(_0x594209))),basename(_0x594209));}export function assertImportPaths(_0xf07847,_0x45198e,_0x156e50=[]){const _0x905ce6=a150_0x4d21b9,_0x4231ca=[..._0x156e50,_0xf07847,_0x45198e,_0xf07847+_0x905ce6(0x144),_0xf07847+_0x905ce6(0x136)][_0x905ce6(0x12a)](_0x43cf5c=>resolve(_0x43cf5c));if(new Set(_0x4231ca)[_0x905ce6(0x149)]!==_0x4231ca['length'])throw Error(_0x905ce6(0x13a));}export async function saveImportJson(_0x1d1700,_0x3107aa){const _0x368c4f=a150_0x4d21b9;await rejectSymlink(_0x1d1700);const _0x1c8490=_0x1d1700+_0x368c4f(0xec)+randomUUID(),_0x37af18=await open(_0x1c8490,'wx',0x180);try{await _0x37af18[_0x368c4f(0xeb)](JSON[_0x368c4f(0x112)](_0x3107aa,null,0x2)),await _0x37af18['sync']();}finally{await _0x37af18[_0x368c4f(0xf9)]();}try{await rename(_0x1c8490,_0x1d1700);}catch(_0x2356c0){await unlink(_0x1c8490)['catch'](()=>{});throw _0x2356c0;}}export async function acquireLock(_0x2223e7){const _0x5a85a3=a150_0x4d21b9,_0x1eb2dd=_0x2223e7+'.lock',_0x2aabe1=randomUUID();await rejectSymlink(_0x1eb2dd);const _0x5b90c5=_0x1eb2dd+_0x5a85a3(0x114);let _0x94810f,_0x60f696;try{try{_0x94810f=await open(_0x1eb2dd,'wx',0x180);}catch(_0x5c559e){if(_0x5c559e[_0x5a85a3(0xe1)]!==_0x5a85a3(0x104))throw _0x5c559e;try{_0x60f696=await open(_0x5b90c5,'wx',0x180);}catch(_0x4b11cd){if(_0x4b11cd[_0x5a85a3(0xe1)]===_0x5a85a3(0x104))throw Error(_0x5a85a3(0x10c));throw _0x4b11cd;}await _0x60f696['writeFile'](JSON[_0x5a85a3(0x112)]({'pid':process[_0x5a85a3(0x113)],'token':_0x2aabe1})),await _0x60f696[_0x5a85a3(0x148)](),await rejectSymlink(_0x1eb2dd);let _0x23bbc8;try{_0x23bbc8=await readFile(_0x1eb2dd,_0x5a85a3(0x126));}catch(_0x12196b){if(_0x12196b[_0x5a85a3(0xe1)]!=='ENOENT')throw _0x12196b;}if(_0x23bbc8!==undefined){let _0x1e8b0b;try{_0x1e8b0b=JSON['parse'](_0x23bbc8);}catch{throw Error(_0x5a85a3(0x131));}if(!_0x1e8b0b||!Number[_0x5a85a3(0x147)](_0x1e8b0b[_0x5a85a3(0x113)])||_0x1e8b0b[_0x5a85a3(0x113)]<=0x0)throw Error('Invalid\x20import\x20lock\x20owner.');try{process['kill'](_0x1e8b0b[_0x5a85a3(0x113)],0x0);throw Error('The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.');}catch(_0x5a5f6a){if(_0x5a5f6a[_0x5a85a3(0xe1)]!==_0x5a85a3(0x12d))throw _0x5a5f6a;}if(await readFile(_0x1eb2dd,_0x5a85a3(0x126))!==_0x23bbc8)throw Error('Import\x20lock\x20changed;\x20retry\x20recovery.');await unlink(_0x1eb2dd);}_0x94810f=await open(_0x1eb2dd,'wx',0x180);}await _0x94810f[_0x5a85a3(0xeb)](JSON['stringify']({'pid':process[_0x5a85a3(0x113)],'token':_0x2aabe1})),await _0x94810f[_0x5a85a3(0x148)]();}finally{try{await _0x94810f?.[_0x5a85a3(0xf9)]();}finally{if(_0x60f696)try{await _0x60f696['close']();}finally{await unlink(_0x5b90c5);}}}return async()=>{const _0x4c50e1=_0x5a85a3;if(JSON[_0x4c50e1(0xe3)](await readFile(_0x1eb2dd,_0x4c50e1(0x126)))[_0x4c50e1(0xed)]===_0x2aabe1)await unlink(_0x1eb2dd);};}function a150_0xb6e9(){const _0x231b89=['city','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','schemaFingerprint','batchSize','4710PSvbyv','count','incomplete','stringify','pid','.recovery','Cannot\x20read\x20the\x20import\x20checkpoint.','ENOENT','forEach','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','time','Incomplete\x20readback.','ids','includes','report','filter','set','join','mappingHash','keys','url','rows','onCheckpointReady','utf8','geolocation','666219lmZzUR','status','map','object','runtimeDomain','ESRCH','now','2915LcIPeG','Excel\x20contains\x20no\x20valid\x20data\x20rows.','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','importId','every','714088xeQMLs','push','.lock.recovery','message','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','conflict','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','operatorType','values','toString','completed','isSymbolicLink','binding','rowNumber','hex','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','.lock','METADATA','pending','isSafeInteger','sync','size','maxBatchBytes','2343ZdAOcC','countryCode','some','Excel\x20row\x20','length','resultCode','uploadFields','imageFields','errorMessage','createUserId','appCode','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','string','944304NtjUws','18508qSakCt','succeeded','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','checkpoint','province','61300eFzZhw','resume','unsent','country','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','1504RnQtIg','maxBatchSize','Invalid\x20import\x20readback\x20response.','get','code','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','parse','districtAdcode','pois','Invalid\x20import\x20batch\x20size.','isInteger','strategy','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','readback','writeFile','.tmp-','token','actorId','accuracy','key','isArray','datasetCode','1HOzTTm','createUserName','cityAdcode','has','name','schemaVersion','close','netType','add','previewUrl','sort','4987908nbXAJb','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','source','version','address','elapsedMs','EEXIST','dingTalkUrl','byteLength','fileHash','road','latitude','auto-id-task-marker'];a150_0xb6e9=function(){return _0x231b89;};return a150_0xb6e9();}export function assertImportContract(_0x532f8d,_0x2d49d6,_0x3acc3d){const _0x5e2db9=a150_0x4d21b9;if(!_0x532f8d||!(_0x532f8d[_0x5e2db9(0xf8)]===0x1&&_0x532f8d[_0x5e2db9(0xe8)]==='fixed-negative-id'||_0x532f8d['schemaVersion']===0x2&&_0x532f8d['strategy']===_0x5e2db9(0x10a))||_0x532f8d[_0x5e2db9(0x100)]!==_0x5e2db9(0x145)||_0x532f8d[_0x5e2db9(0xcf)]!==_0x2d49d6||_0x532f8d[_0x5e2db9(0xf2)]!==_0x3acc3d||typeof _0x532f8d[_0x5e2db9(0xee)]!==_0x5e2db9(0xd1)||!_0x532f8d['actorId']||typeof _0x532f8d[_0x5e2db9(0x10d)]!==_0x5e2db9(0xd1)||!_0x532f8d[_0x5e2db9(0x10d)]||!Number[_0x5e2db9(0x147)](_0x532f8d[_0x5e2db9(0xde)])||_0x532f8d['maxBatchSize']<0x1||_0x532f8d[_0x5e2db9(0xde)]>0x3e8||!Number[_0x5e2db9(0x147)](_0x532f8d[_0x5e2db9(0x14a)])||_0x532f8d[_0x5e2db9(0x14a)]<0x1||_0x532f8d[_0x5e2db9(0x14a)]>0x14*0x400*0x400)throw Error('The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.');}export async function runExcelImport(_0x21c078){const _0x265bdb=a150_0x4d21b9;_0x21c078={..._0x21c078,'checkpoint':await resolveImportOutputPath(_0x21c078[_0x265bdb(0xd6)]),'report':await resolveImportOutputPath(_0x21c078['report'])};const {manifest:_0x10599f,contract:_0x87428e,api:_0x25d087}=_0x21c078;assertImportContract(_0x87428e,_0x21c078[_0x265bdb(0xcf)],_0x21c078['datasetCode']);if(_0x87428e[_0x265bdb(0xf8)]!==0x1)throw Error(_0x265bdb(0xe9));if(_0x10599f['errors'][_0x265bdb(0xc9)])throw Error(_0x265bdb(0x138));if(!_0x10599f[_0x265bdb(0x124)][_0x265bdb(0xc9)])throw Error(_0x265bdb(0x130));if(!Number[_0x265bdb(0xe7)](_0x21c078[_0x265bdb(0x10e)])||_0x21c078['batchSize']<0x1||_0x21c078[_0x265bdb(0x10e)]>_0x87428e[_0x265bdb(0xde)])throw Error(_0x265bdb(0xe6));for(const _0x4cf00d of _0x10599f[_0x265bdb(0x124)]){if(Buffer[_0x265bdb(0x106)](JSON[_0x265bdb(0x112)]({'schemaFingerprint':_0x87428e[_0x265bdb(0x10d)],'items':[{..._0x4cf00d[_0x265bdb(0x13c)],'id':-0x1fffffffffffff}]}),_0x265bdb(0x126))>_0x87428e[_0x265bdb(0x14a)])throw Error('Excel\x20row\x20'+_0x4cf00d['rowNumber']+_0x265bdb(0xe2));}assertImportPaths(_0x21c078[_0x265bdb(0xd6)],_0x21c078[_0x265bdb(0x11d)]);const _0x530e79={'appCode':_0x21c078['appCode'],'datasetCode':_0x21c078[_0x265bdb(0xf2)],'runtimeDomain':_0x21c078[_0x265bdb(0x12c)],'actorId':_0x87428e[_0x265bdb(0xee)],'fileHash':_0x10599f[_0x265bdb(0x107)],'mappingHash':_0x10599f[_0x265bdb(0x121)],'schemaHash':_0x10599f['schemaHash'],'remoteSchemaHash':_0x87428e[_0x265bdb(0x10d)],'batchSize':_0x21c078[_0x265bdb(0x10e)],'sheet':_0x10599f['sheet']},_0x3641b0=await acquireLock(_0x21c078['checkpoint']);let _0xaf6f0c;const _0x44d19a=Date[_0x265bdb(0x12e)]();let _0x595847=0x0;const _0x189308=[],_0x5bd20c=()=>({'importId':_0xaf6f0c?.[_0x265bdb(0x132)],'sourceRows':_0x10599f[_0x265bdb(0x124)]['length'],'emptyRows':_0x10599f['emptyRows'][_0x265bdb(0xc9)],'succeeded':_0xaf6f0c?.['rows']['filter'](_0x1b544a=>_0x1b544a[_0x265bdb(0x129)]===_0x265bdb(0xd4))[_0x265bdb(0xc9)]??0x0,'unknown':_0xaf6f0c?.[_0x265bdb(0x124)]['filter'](_0x29b509=>_0x29b509[_0x265bdb(0x129)]===_0x265bdb(0x146))[_0x265bdb(0xc9)]??0x0,'conflicts':_0xaf6f0c?.[_0x265bdb(0x124)][_0x265bdb(0x11e)](_0x122846=>_0x122846[_0x265bdb(0x129)]===_0x265bdb(0x139))[_0x265bdb(0xc9)]??0x0,'notAttempted':_0xaf6f0c?.[_0x265bdb(0x124)]['filter'](_0x51a396=>_0x51a396[_0x265bdb(0x129)]===_0x265bdb(0xda))[_0x265bdb(0xc9)]??_0x10599f[_0x265bdb(0x124)][_0x265bdb(0xc9)],'batches':_0x595847,'batchResults':_0x189308,'elapsedMs':Date['now']()-_0x44d19a,'checkpoint':resolve(_0x21c078[_0x265bdb(0xd6)]),'report':resolve(_0x21c078['report']),'warnings':_0x10599f['warnings']});try{await rejectSymlink(_0x21c078[_0x265bdb(0xd6)]);if(_0x21c078['resume']){try{_0xaf6f0c=JSON[_0x265bdb(0xe3)](await readFile(_0x21c078[_0x265bdb(0xd6)],_0x265bdb(0x126)));}catch{throw Error(_0x265bdb(0x115));}if(!_0xaf6f0c||_0xaf6f0c[_0x265bdb(0x101)]!==0x1||typeof _0xaf6f0c[_0x265bdb(0x132)]!=='string'||canonical(_0xaf6f0c[_0x265bdb(0x140)])!==canonical(_0x530e79)||!Array[_0x265bdb(0xf1)](_0xaf6f0c[_0x265bdb(0x124)])||_0xaf6f0c[_0x265bdb(0x124)]['length']!==_0x10599f[_0x265bdb(0x124)][_0x265bdb(0xc9)]||new Set(_0xaf6f0c[_0x265bdb(0x124)][_0x265bdb(0x12a)](_0x592579=>_0x592579['id']))['size']!==_0xaf6f0c[_0x265bdb(0x124)]['length']||_0xaf6f0c[_0x265bdb(0x124)][_0x265bdb(0x14d)]((_0x3c5f1d,_0x436cb9)=>!Number[_0x265bdb(0x147)](_0x3c5f1d['id'])||_0x3c5f1d['id']>=0x0||_0x3c5f1d[_0x265bdb(0x141)]!==_0x10599f['rows'][_0x436cb9][_0x265bdb(0x141)]||![_0x265bdb(0xda),_0x265bdb(0x146),'succeeded','conflict'][_0x265bdb(0x11c)](_0x3c5f1d['status'])))throw Error('Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.');}else{try{await lstat(_0x21c078[_0x265bdb(0xd6)]);throw Error(_0x265bdb(0xff));}catch(_0x292970){if(_0x292970['code']!=='ENOENT')throw _0x292970;}const _0x593ed2=new Set();_0xaf6f0c={'version':0x1,'importId':randomUUID(),'binding':_0x530e79,'rows':_0x10599f[_0x265bdb(0x124)]['map'](_0x524c8f=>{const _0x5ea54f=_0x265bdb;let _0x29e9e1;do{_0x29e9e1=-(Number(BigInt('0x'+randomBytes(0x7)[_0x5ea54f(0x13d)](_0x5ea54f(0x142)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x593ed2['has'](_0x29e9e1));return _0x593ed2[_0x5ea54f(0xfb)](_0x29e9e1),{'id':_0x29e9e1,'rowNumber':_0x524c8f[_0x5ea54f(0x141)],'status':_0x5ea54f(0xda)};})},await saveImportJson(_0x21c078[_0x265bdb(0xd6)],_0xaf6f0c);}await _0x21c078[_0x265bdb(0x125)]?.();const _0x4fb961=_0xaf6f0c;if(_0x4fb961[_0x265bdb(0x124)]['some'](_0x5045da=>_0x5045da[_0x265bdb(0x129)]==='conflict'))throw Error('Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.');const _0x55a0d4=async _0x413234=>{const _0x2a8067=_0x265bdb,_0x44271c=await _0x25d087[_0x2a8067(0xea)](_0x413234['map'](_0x43ccbf=>_0x4fb961[_0x2a8067(0x124)][_0x43ccbf]['id']));if(!Array[_0x2a8067(0xf1)](_0x44271c))throw Error(_0x2a8067(0xdf));const _0x149372=new Set(_0x413234[_0x2a8067(0x12a)](_0x36c5dc=>_0x4fb961[_0x2a8067(0x124)][_0x36c5dc]['id'])),_0x464dda=new Map();for(const _0x1f248f of _0x44271c){const _0x3a3ddf=Number(_0x1f248f?.['id']);if(!_0x149372[_0x2a8067(0xf6)](_0x3a3ddf)||_0x464dda[_0x2a8067(0xf6)](_0x3a3ddf))throw Error(_0x2a8067(0x118));_0x464dda[_0x2a8067(0x11f)](_0x3a3ddf,_0x1f248f);}for(const _0x1643fa of _0x413234){const _0x4af9ff=_0x464dda[_0x2a8067(0xe0)](_0x4fb961['rows'][_0x1643fa]['id']);if(!_0x4af9ff)continue;if(_0x4fb961['rows'][_0x1643fa][_0x2a8067(0x129)]===_0x2a8067(0xda)){_0x4fb961[_0x2a8067(0x124)][_0x1643fa][_0x2a8067(0x129)]=_0x2a8067(0x139),await saveImportJson(_0x21c078['checkpoint'],_0x4fb961);throw Error(_0x2a8067(0x143));}const _0x8988eb=_0x10599f['rows'][_0x1643fa]['values'];if(Object['keys'](_0x8988eb)['some'](_0x4ddfbb=>!sameImportValue(_0x8988eb[_0x4ddfbb],_0x4af9ff[_0x4ddfbb],_0x10599f[_0x2a8067(0xcc)]?.['includes'](_0x4ddfbb)&&!_0x10599f[_0x2a8067(0xcb)]?.[_0x2a8067(0x11c)](_0x4ddfbb)))){_0x4fb961[_0x2a8067(0x124)][_0x1643fa][_0x2a8067(0x129)]=_0x2a8067(0x139),await saveImportJson(_0x21c078['checkpoint'],_0x4fb961);throw Error(_0x2a8067(0xd5)+_0x4fb961[_0x2a8067(0x124)][_0x1643fa][_0x2a8067(0x141)]+'.');}_0x4fb961[_0x2a8067(0x124)][_0x1643fa][_0x2a8067(0x129)]=_0x2a8067(0xd4);}return await saveImportJson(_0x21c078[_0x2a8067(0xd6)],_0x4fb961),_0x464dda;};if(_0x21c078[_0x265bdb(0xd9)])for(let _0x280cbf=0x0;_0x280cbf<_0x4fb961[_0x265bdb(0x124)][_0x265bdb(0xc9)];_0x280cbf+=_0x21c078[_0x265bdb(0x10e)]){const _0x5721b0=_0x4fb961[_0x265bdb(0x124)]['slice'](_0x280cbf,_0x280cbf+_0x21c078[_0x265bdb(0x10e)])[_0x265bdb(0x12a)]((_0x31f384,_0x5d9e8e)=>_0x280cbf+_0x5d9e8e),_0x1068c6=_0x5721b0[_0x265bdb(0x11e)](_0x563861=>_0x4fb961['rows'][_0x563861]['status']==='succeeded'),_0x5700da=await _0x55a0d4(_0x5721b0),_0xba1167=_0x1068c6[_0x265bdb(0x11e)](_0x4eaa55=>!_0x5700da['has'](_0x4fb961[_0x265bdb(0x124)][_0x4eaa55]['id']));if(_0xba1167['length']){_0xba1167[_0x265bdb(0x117)](_0x17680f=>{const _0xf43687=_0x265bdb;_0x4fb961[_0xf43687(0x124)][_0x17680f]['status']='conflict';}),await saveImportJson(_0x21c078[_0x265bdb(0xd6)],_0x4fb961);throw Error('Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.');}}for(let _0x486de1=0x0;_0x486de1<_0x4fb961['rows'][_0x265bdb(0xc9)];){const _0x19612a=[],_0x2ad3db=[];while(_0x486de1<_0x4fb961[_0x265bdb(0x124)][_0x265bdb(0xc9)]&&_0x2ad3db[_0x265bdb(0xc9)]<_0x21c078['batchSize']){const _0x1bc74f=_0x486de1++;if(_0x4fb961[_0x265bdb(0x124)][_0x1bc74f][_0x265bdb(0x129)]===_0x265bdb(0xd4))continue;const _0x34a5c1={..._0x10599f[_0x265bdb(0x124)][_0x1bc74f][_0x265bdb(0x13c)],'id':_0x4fb961[_0x265bdb(0x124)][_0x1bc74f]['id']};if(Buffer['byteLength'](JSON[_0x265bdb(0x112)]({'schemaFingerprint':_0x87428e['schemaFingerprint'],'items':[..._0x2ad3db,_0x34a5c1]}),'utf8')>_0x87428e[_0x265bdb(0x14a)]){if(!_0x2ad3db[_0x265bdb(0xc9)])throw Error(_0x265bdb(0x14e)+_0x4fb961[_0x265bdb(0x124)][_0x1bc74f][_0x265bdb(0x141)]+_0x265bdb(0xe2));_0x486de1--;break;}_0x19612a[_0x265bdb(0x135)](_0x1bc74f),_0x2ad3db[_0x265bdb(0x135)](_0x34a5c1);}if(!_0x2ad3db['length'])continue;const _0x557651=_0x19612a[_0x265bdb(0x11e)](_0x25b06c=>_0x4fb961[_0x265bdb(0x124)][_0x25b06c]['status']===_0x265bdb(0xda));if(_0x557651[_0x265bdb(0xc9)]){const _0x10bd65=await _0x25d087[_0x265bdb(0xea)](_0x557651[_0x265bdb(0x12a)](_0x196b1c=>_0x4fb961['rows'][_0x196b1c]['id']));if(!Array[_0x265bdb(0xf1)](_0x10bd65))throw Error(_0x265bdb(0xdf));if(_0x10bd65[_0x265bdb(0xc9)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x19612a[_0x265bdb(0x117)](_0x5d1964=>{const _0x25275d=_0x265bdb;_0x4fb961[_0x25275d(0x124)][_0x5d1964][_0x25275d(0x129)]='pending';}),await saveImportJson(_0x21c078[_0x265bdb(0xd6)],_0x4fb961),_0x595847++;const _0x1fe9a1=Date['now'](),_0x73bdb2={'batch':_0x595847,'rowStart':_0x4fb961['rows'][_0x19612a[0x0]]['rowNumber'],'rowEnd':_0x4fb961['rows'][_0x19612a[_0x19612a['length']-0x1]][_0x265bdb(0x141)],'count':_0x2ad3db['length'],'bytes':Buffer[_0x265bdb(0x106)](JSON[_0x265bdb(0x112)]({'schemaFingerprint':_0x87428e[_0x265bdb(0x10d)],'items':_0x2ad3db}),_0x265bdb(0x126)),'elapsedMs':0x0,'status':'unknown'};_0x189308['push'](_0x73bdb2);try{const _0x8a6f42=await _0x25d087['write'](_0x2ad3db);if(!_0x8a6f42||_0x8a6f42[_0x265bdb(0x110)]!==_0x2ad3db[_0x265bdb(0xc9)]||!Array[_0x265bdb(0xf1)](_0x8a6f42[_0x265bdb(0x11b)])||_0x8a6f42['ids']['length']!==_0x2ad3db[_0x265bdb(0xc9)]||_0x8a6f42[_0x265bdb(0x11b)][_0x265bdb(0x14d)]((_0x17bbd2,_0x4ffdcc)=>Number(_0x17bbd2)!==_0x4fb961[_0x265bdb(0x124)][_0x19612a[_0x4ffdcc]]['id']))throw Error('Invalid\x20write\x20result.');await _0x55a0d4(_0x19612a);if(_0x19612a[_0x265bdb(0x14d)](_0x377db5=>_0x4fb961[_0x265bdb(0x124)][_0x377db5][_0x265bdb(0x129)]!==_0x265bdb(0xd4)))throw Error(_0x265bdb(0x11a));}catch(_0x26c9b1){if(_0x4fb961[_0x265bdb(0x124)][_0x265bdb(0x14d)](_0x1b077f=>_0x1b077f['status']===_0x265bdb(0x139)))throw _0x26c9b1;try{await _0x55a0d4(_0x19612a);}catch(_0x50c7e0){if(_0x4fb961['rows']['some'](_0x5e777c=>_0x5e777c[_0x265bdb(0x129)]==='conflict'))throw _0x50c7e0;}if(_0x19612a[_0x265bdb(0x14d)](_0x272017=>_0x4fb961[_0x265bdb(0x124)][_0x272017][_0x265bdb(0x129)]!=='succeeded'))throw Error(_0x265bdb(0xd0));}finally{_0x73bdb2[_0x265bdb(0x103)]=Date[_0x265bdb(0x12e)]()-_0x1fe9a1;if(_0x19612a['every'](_0x4ebf06=>_0x4fb961[_0x265bdb(0x124)][_0x4ebf06]['status']===_0x265bdb(0xd4)))_0x73bdb2[_0x265bdb(0x129)]=_0x265bdb(0xd4);else{if(_0x19612a[_0x265bdb(0x14d)](_0x38883f=>_0x4fb961[_0x265bdb(0x124)][_0x38883f][_0x265bdb(0x129)]==='conflict'))_0x73bdb2['status']='conflict';}}}const _0x4eff31={'status':_0x265bdb(0x13e),..._0x5bd20c()};return await saveImportJson(_0x21c078[_0x265bdb(0x11d)],_0x4eff31),_0x4eff31;}catch(_0x411f43){if(_0xaf6f0c)await saveImportJson(_0x21c078['report'],{'status':_0x265bdb(0x111),..._0x5bd20c(),'message':_0x411f43[_0x265bdb(0x137)]});throw _0x411f43;}finally{await _0x3641b0();}}
|
|
1
|
+
const a150_0x35049a=a150_0x6764;(function(_0x374a0d,_0x3aa12d){const _0x1be77a=a150_0x6764,_0x514f1a=_0x374a0d();while(!![]){try{const _0x9d1763=parseInt(_0x1be77a(0x1b1))/0x1*(parseInt(_0x1be77a(0x196))/0x2)+parseInt(_0x1be77a(0x1a0))/0x3*(-parseInt(_0x1be77a(0x1cf))/0x4)+-parseInt(_0x1be77a(0x1b8))/0x5*(parseInt(_0x1be77a(0x1c0))/0x6)+parseInt(_0x1be77a(0x173))/0x7*(-parseInt(_0x1be77a(0x158))/0x8)+parseInt(_0x1be77a(0x19e))/0x9+-parseInt(_0x1be77a(0x151))/0xa+parseInt(_0x1be77a(0x1db))/0xb;if(_0x9d1763===_0x3aa12d)break;else _0x514f1a['push'](_0x514f1a['shift']());}catch(_0x48fd1c){_0x514f1a['push'](_0x514f1a['shift']());}}}(a150_0x5e23,0x6cb6a));import{randomBytes,randomUUID}from'node:crypto';import{lstat,open,readFile,realpath,rename,unlink}from'node:fs/promises';function a150_0x6764(_0x5ee8e5,_0x29c672){_0x5ee8e5=_0x5ee8e5-0x151;const _0x5e233f=a150_0x5e23();let _0x676431=_0x5e233f[_0x5ee8e5];return _0x676431;}import{resolve,dirname,basename}from'node:path';export function canonical(_0x44787a){const _0xfa4dff=a150_0x6764;if(Array['isArray'](_0x44787a))return'['+_0x44787a[_0xfa4dff(0x159)](canonical)[_0xfa4dff(0x17a)](',')+']';if(_0x44787a&&typeof _0x44787a===_0xfa4dff(0x1d9))return'{'+Object['keys'](_0x44787a)[_0xfa4dff(0x1b4)]()[_0xfa4dff(0x159)](_0x7c67de=>JSON[_0xfa4dff(0x157)](_0x7c67de)+':'+canonical(_0x44787a[_0x7c67de]))[_0xfa4dff(0x17a)](',')+'}';return JSON['stringify'](_0x44787a)??'undefined';}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a150_0x35049a(0x1c6),a150_0x35049a(0x1b6),a150_0x35049a(0x1ca),'district',a150_0x35049a(0x1a2),'road',a150_0x35049a(0x16d),a150_0x35049a(0x1a6),a150_0x35049a(0x1a4),a150_0x35049a(0x183),a150_0x35049a(0x171),a150_0x35049a(0x1b5),a150_0x35049a(0x1b0),a150_0x35049a(0x155),a150_0x35049a(0x199),a150_0x35049a(0x1a8),a150_0x35049a(0x15e),a150_0x35049a(0x156),a150_0x35049a(0x1ab),a150_0x35049a(0x1a3)]);export function sameImportValue(_0x13cccc,_0x293e79,_0x4ba870=![]){const _0x3f008b=a150_0x35049a;if(_0x4ba870){const _0x120cf5=_0x127e52=>Array[_0x3f008b(0x15d)](_0x127e52)?_0x127e52[_0x3f008b(0x159)](_0x201d8f=>{const _0x2fc544=_0x3f008b;if(!_0x201d8f||typeof _0x201d8f!=='object'||Array[_0x2fc544(0x15d)](_0x201d8f))return _0x201d8f;const _0x1c500e={..._0x201d8f};delete _0x1c500e[_0x2fc544(0x1cc)],delete _0x1c500e['previewUrl'];if(_0x1c500e[_0x2fc544(0x194)]==='')delete _0x1c500e[_0x2fc544(0x194)];if(_0x1c500e['createUserId']==null)delete _0x1c500e[_0x2fc544(0x1d7)];if(_0x1c500e[_0x2fc544(0x193)]==null)delete _0x1c500e[_0x2fc544(0x193)];if(_0x1c500e[_0x2fc544(0x195)]==null||typeof _0x1c500e[_0x2fc544(0x195)]===_0x2fc544(0x1d9)&&!Array[_0x2fc544(0x15d)](_0x1c500e['geolocation'])&&Object[_0x2fc544(0x180)](_0x1c500e[_0x2fc544(0x195)])['every'](([_0x19e7f8,_0x1cea91])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x2fc544(0x164)](_0x19e7f8)&&_0x1cea91===null))delete _0x1c500e[_0x2fc544(0x195)];for(const _0x141f1c of[_0x2fc544(0x190),_0x2fc544(0x15c),'key'])if(!(_0x141f1c in _0x1c500e))_0x1c500e[_0x141f1c]='';if(_0x1c500e[_0x2fc544(0x1d2)]==null)_0x1c500e[_0x2fc544(0x1d2)]=0x0;return _0x1c500e;}):_0x127e52;return canonical(_0x120cf5(_0x13cccc))===canonical(_0x120cf5(_0x293e79));}return _0x13cccc===null?_0x293e79===null||_0x293e79===undefined:canonical(_0x293e79)===canonical(_0x13cccc);}async function rejectSymlink(_0x3e84fa){const _0x403e6e=a150_0x35049a;try{if((await lstat(_0x3e84fa))[_0x403e6e(0x198)]())throw Error(_0x403e6e(0x1ae));}catch(_0x359ffb){if(_0x359ffb[_0x403e6e(0x187)]!==_0x403e6e(0x1d5))throw _0x359ffb;}}export async function resolveImportOutputPath(_0x14ff05){return await rejectSymlink(_0x14ff05),resolve(await realpath(dirname(resolve(_0x14ff05))),basename(_0x14ff05));}export function assertImportPaths(_0x2d3a2c,_0xa5fd3f,_0x475e83=[]){const _0x17b95a=a150_0x35049a,_0x30bb72=[..._0x475e83,_0x2d3a2c,_0xa5fd3f,_0x2d3a2c+'.lock',_0x2d3a2c+'.lock.recovery'][_0x17b95a(0x159)](_0x1d3bf8=>resolve(_0x1d3bf8));if(new Set(_0x30bb72)[_0x17b95a(0x1d2)]!==_0x30bb72[_0x17b95a(0x1d3)])throw Error('Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.');}export async function saveImportJson(_0xdc9c33,_0x402918){const _0x145605=a150_0x35049a;await rejectSymlink(_0xdc9c33);const _0x35e3a9=_0xdc9c33+_0x145605(0x17e)+randomUUID(),_0x44a06f=await open(_0x35e3a9,'wx',0x180);try{await _0x44a06f[_0x145605(0x1d0)](JSON[_0x145605(0x157)](_0x402918,null,0x2)),await _0x44a06f[_0x145605(0x188)]();}finally{await _0x44a06f[_0x145605(0x1d1)]();}try{await rename(_0x35e3a9,_0xdc9c33);}catch(_0x3bccab){await unlink(_0x35e3a9)[_0x145605(0x1aa)](()=>{});throw _0x3bccab;}}export async function acquireLock(_0x114b41){const _0xb6f21b=a150_0x35049a,_0x291b2a=_0x114b41+_0xb6f21b(0x1ba),_0x556dd8=randomUUID();await rejectSymlink(_0x291b2a);const _0x1ed538=_0x291b2a+_0xb6f21b(0x18e);let _0x159c13,_0x1c62a6;try{try{_0x159c13=await open(_0x291b2a,'wx',0x180);}catch(_0xa65266){if(_0xa65266['code']!==_0xb6f21b(0x1dd))throw _0xa65266;try{_0x1c62a6=await open(_0x1ed538,'wx',0x180);}catch(_0xc85e06){if(_0xc85e06['code']===_0xb6f21b(0x1dd))throw Error(_0xb6f21b(0x19c));throw _0xc85e06;}await _0x1c62a6[_0xb6f21b(0x1d0)](JSON['stringify']({'pid':process[_0xb6f21b(0x160)],'token':_0x556dd8})),await _0x1c62a6['sync'](),await rejectSymlink(_0x291b2a);let _0x7b8d8c;try{_0x7b8d8c=await readFile(_0x291b2a,_0xb6f21b(0x177));}catch(_0x40a9a9){if(_0x40a9a9[_0xb6f21b(0x187)]!==_0xb6f21b(0x1d5))throw _0x40a9a9;}if(_0x7b8d8c!==undefined){let _0x5724bf;try{_0x5724bf=JSON[_0xb6f21b(0x170)](_0x7b8d8c);}catch{throw Error(_0xb6f21b(0x1c8));}if(!_0x5724bf||!Number[_0xb6f21b(0x1dc)](_0x5724bf['pid'])||_0x5724bf[_0xb6f21b(0x160)]<=0x0)throw Error(_0xb6f21b(0x1ce));try{process[_0xb6f21b(0x169)](_0x5724bf[_0xb6f21b(0x160)],0x0);throw Error(_0xb6f21b(0x1c2));}catch(_0x5ec6c5){if(_0x5ec6c5[_0xb6f21b(0x187)]!==_0xb6f21b(0x174))throw _0x5ec6c5;}if(await readFile(_0x291b2a,'utf8')!==_0x7b8d8c)throw Error('Import\x20lock\x20changed;\x20retry\x20recovery.');await unlink(_0x291b2a);}_0x159c13=await open(_0x291b2a,'wx',0x180);}await _0x159c13[_0xb6f21b(0x1d0)](JSON['stringify']({'pid':process[_0xb6f21b(0x160)],'token':_0x556dd8})),await _0x159c13[_0xb6f21b(0x188)]();}finally{try{await _0x159c13?.[_0xb6f21b(0x1d1)]();}finally{if(_0x1c62a6)try{await _0x1c62a6[_0xb6f21b(0x1d1)]();}finally{await unlink(_0x1ed538);}}}return async()=>{const _0x183f9e=_0xb6f21b;if(JSON[_0x183f9e(0x170)](await readFile(_0x291b2a,'utf8'))[_0x183f9e(0x1bc)]===_0x556dd8)await unlink(_0x291b2a);};}function a150_0x5e23(){const _0x1edbe1=['sheet','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','kill','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','batchSize','forEach','country','METADATA','appCode','parse','city','auto-id-task-marker','26404uMhaKb','ESRCH','Incomplete\x20readback.','version','utf8','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','ids','join','completed','Invalid\x20import\x20readback\x20response.','Invalid\x20write\x20result.','.tmp-','Excel\x20row\x20','entries','values','onCheckpointReady','latitude','unsent','report','push','code','sync','warnings','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','importId','unknown','string','.recovery','Cannot\x20read\x20the\x20import\x20checkpoint.','name','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','mappingHash','createUserName','dingTalkUrl','geolocation','2thJEyj','filter','isSymbolicLink','accuracy','status','byteLength','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','readback','4637133psycZs','resume','2662629IKNaaC','checkpoint','pois','lbswuaCacheId','province','slice','countryCode','get','longitude','pending','catch','address','elapsedMs','toString','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','now','resultCode','611142GsBepg','write','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','sort','netType','operatorType','uploadFields','49465YnnJgC','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','.lock','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','token','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','maxBatchSize','12PGFQFY','Excel\x20contains\x20no\x20valid\x20data\x20rows.','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','imageFields','isInteger','strategy','time','actorId','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','includes','districtAdcode','succeeded','url','conflict','Invalid\x20import\x20lock\x20owner.','4vASAiI','writeFile','close','size','length','maxBatchBytes','ENOENT','every','createUserId','schemaHash','object','binding','16423099mVMboZ','isSafeInteger','EEXIST','set','5953530zaqUXy','Invalid\x20import\x20batch\x20size.','schemaVersion','datasetCode','streetNumber','errorMessage','stringify','1424mULLso','map','source','incomplete','type','isArray','cityAdcode','rows','pid','add','message','schemaFingerprint','has','rowNumber','some'];a150_0x5e23=function(){return _0x1edbe1;};return a150_0x5e23();}export function assertImportContract(_0x2dbaac,_0x51f030,_0x5ee27b){const _0x334351=a150_0x35049a;if(!_0x2dbaac||!(_0x2dbaac[_0x334351(0x153)]===0x1&&_0x2dbaac[_0x334351(0x1c5)]==='fixed-negative-id'||_0x2dbaac[_0x334351(0x153)]===0x2&&_0x2dbaac[_0x334351(0x1c5)]===_0x334351(0x172))||_0x2dbaac[_0x334351(0x15a)]!==_0x334351(0x16e)||_0x2dbaac['appCode']!==_0x51f030||_0x2dbaac['datasetCode']!==_0x5ee27b||typeof _0x2dbaac[_0x334351(0x1c7)]!==_0x334351(0x18d)||!_0x2dbaac[_0x334351(0x1c7)]||typeof _0x2dbaac['schemaFingerprint']!==_0x334351(0x18d)||!_0x2dbaac['schemaFingerprint']||!Number['isSafeInteger'](_0x2dbaac[_0x334351(0x1bf)])||_0x2dbaac[_0x334351(0x1bf)]<0x1||_0x2dbaac['maxBatchSize']>0x3e8||!Number[_0x334351(0x1dc)](_0x2dbaac[_0x334351(0x1d4)])||_0x2dbaac[_0x334351(0x1d4)]<0x1||_0x2dbaac[_0x334351(0x1d4)]>0x14*0x400*0x400)throw Error(_0x334351(0x191));}export async function runExcelImport(_0x284a80){const _0xfd26bf=a150_0x35049a;_0x284a80={..._0x284a80,'checkpoint':await resolveImportOutputPath(_0x284a80[_0xfd26bf(0x1a1)]),'report':await resolveImportOutputPath(_0x284a80[_0xfd26bf(0x185)])};const {manifest:_0x30d064,contract:_0x2d499c,api:_0x18b2ba}=_0x284a80;assertImportContract(_0x2d499c,_0x284a80['appCode'],_0x284a80[_0xfd26bf(0x154)]);if(_0x2d499c[_0xfd26bf(0x153)]!==0x1)throw Error(_0xfd26bf(0x1bd));if(_0x30d064['errors'][_0xfd26bf(0x1d3)])throw Error(_0xfd26bf(0x1b3));if(!_0x30d064[_0xfd26bf(0x15f)][_0xfd26bf(0x1d3)])throw Error(_0xfd26bf(0x1c1));if(!Number[_0xfd26bf(0x1c4)](_0x284a80[_0xfd26bf(0x16b)])||_0x284a80[_0xfd26bf(0x16b)]<0x1||_0x284a80['batchSize']>_0x2d499c[_0xfd26bf(0x1bf)])throw Error(_0xfd26bf(0x152));for(const _0x4de67f of _0x30d064['rows']){if(Buffer['byteLength'](JSON[_0xfd26bf(0x157)]({'schemaFingerprint':_0x2d499c[_0xfd26bf(0x163)],'items':[{..._0x4de67f['values'],'id':-0x1fffffffffffff}]}),_0xfd26bf(0x177))>_0x2d499c[_0xfd26bf(0x1d4)])throw Error('Excel\x20row\x20'+_0x4de67f[_0xfd26bf(0x165)]+'\x20exceeds\x20the\x20import\x20request\x20size\x20limit.');}assertImportPaths(_0x284a80['checkpoint'],_0x284a80[_0xfd26bf(0x185)]);const _0x128f1e={'appCode':_0x284a80[_0xfd26bf(0x16f)],'datasetCode':_0x284a80['datasetCode'],'runtimeDomain':_0x284a80['runtimeDomain'],'actorId':_0x2d499c[_0xfd26bf(0x1c7)],'fileHash':_0x30d064['fileHash'],'mappingHash':_0x30d064[_0xfd26bf(0x192)],'schemaHash':_0x30d064[_0xfd26bf(0x1d8)],'remoteSchemaHash':_0x2d499c['schemaFingerprint'],'batchSize':_0x284a80[_0xfd26bf(0x16b)],'sheet':_0x30d064[_0xfd26bf(0x167)]},_0x54fd3c=await acquireLock(_0x284a80[_0xfd26bf(0x1a1)]);let _0x47f246;const _0x3e8928=Date[_0xfd26bf(0x1af)]();let _0x4e99e6=0x0;const _0x1322ee=[],_0xb5fa31=()=>({'importId':_0x47f246?.['importId'],'sourceRows':_0x30d064[_0xfd26bf(0x15f)]['length'],'emptyRows':_0x30d064['emptyRows'][_0xfd26bf(0x1d3)],'succeeded':_0x47f246?.[_0xfd26bf(0x15f)][_0xfd26bf(0x197)](_0x1fb149=>_0x1fb149[_0xfd26bf(0x19a)]===_0xfd26bf(0x1cb))['length']??0x0,'unknown':_0x47f246?.['rows'][_0xfd26bf(0x197)](_0x5eb088=>_0x5eb088[_0xfd26bf(0x19a)]===_0xfd26bf(0x1a9))[_0xfd26bf(0x1d3)]??0x0,'conflicts':_0x47f246?.[_0xfd26bf(0x15f)][_0xfd26bf(0x197)](_0xb80e7e=>_0xb80e7e[_0xfd26bf(0x19a)]==='conflict')[_0xfd26bf(0x1d3)]??0x0,'notAttempted':_0x47f246?.[_0xfd26bf(0x15f)][_0xfd26bf(0x197)](_0x3319df=>_0x3319df[_0xfd26bf(0x19a)]===_0xfd26bf(0x184))[_0xfd26bf(0x1d3)]??_0x30d064['rows'][_0xfd26bf(0x1d3)],'batches':_0x4e99e6,'batchResults':_0x1322ee,'elapsedMs':Date[_0xfd26bf(0x1af)]()-_0x3e8928,'checkpoint':resolve(_0x284a80[_0xfd26bf(0x1a1)]),'report':resolve(_0x284a80['report']),'warnings':_0x30d064[_0xfd26bf(0x189)]});try{await rejectSymlink(_0x284a80['checkpoint']);if(_0x284a80[_0xfd26bf(0x19f)]){try{_0x47f246=JSON['parse'](await readFile(_0x284a80[_0xfd26bf(0x1a1)],_0xfd26bf(0x177)));}catch{throw Error(_0xfd26bf(0x18f));}if(!_0x47f246||_0x47f246[_0xfd26bf(0x176)]!==0x1||typeof _0x47f246[_0xfd26bf(0x18b)]!==_0xfd26bf(0x18d)||canonical(_0x47f246[_0xfd26bf(0x1da)])!==canonical(_0x128f1e)||!Array[_0xfd26bf(0x15d)](_0x47f246[_0xfd26bf(0x15f)])||_0x47f246[_0xfd26bf(0x15f)]['length']!==_0x30d064[_0xfd26bf(0x15f)][_0xfd26bf(0x1d3)]||new Set(_0x47f246[_0xfd26bf(0x15f)]['map'](_0x2241cc=>_0x2241cc['id']))[_0xfd26bf(0x1d2)]!==_0x47f246[_0xfd26bf(0x15f)][_0xfd26bf(0x1d3)]||_0x47f246[_0xfd26bf(0x15f)][_0xfd26bf(0x166)]((_0x17bf2d,_0x391eaa)=>!Number[_0xfd26bf(0x1dc)](_0x17bf2d['id'])||_0x17bf2d['id']>=0x0||_0x17bf2d[_0xfd26bf(0x165)]!==_0x30d064[_0xfd26bf(0x15f)][_0x391eaa][_0xfd26bf(0x165)]||!['unsent',_0xfd26bf(0x1a9),_0xfd26bf(0x1cb),'conflict'][_0xfd26bf(0x1c9)](_0x17bf2d[_0xfd26bf(0x19a)])))throw Error('Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.');}else{try{await lstat(_0x284a80[_0xfd26bf(0x1a1)]);throw Error(_0xfd26bf(0x1bb));}catch(_0xf09600){if(_0xf09600[_0xfd26bf(0x187)]!==_0xfd26bf(0x1d5))throw _0xf09600;}const _0x4caa08=new Set();_0x47f246={'version':0x1,'importId':randomUUID(),'binding':_0x128f1e,'rows':_0x30d064[_0xfd26bf(0x15f)][_0xfd26bf(0x159)](_0x585b5e=>{const _0x6353ab=_0xfd26bf;let _0x4c73d9;do{_0x4c73d9=-(Number(BigInt('0x'+randomBytes(0x7)[_0x6353ab(0x1ad)]('hex'))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x4caa08[_0x6353ab(0x164)](_0x4c73d9));return _0x4caa08[_0x6353ab(0x161)](_0x4c73d9),{'id':_0x4c73d9,'rowNumber':_0x585b5e[_0x6353ab(0x165)],'status':_0x6353ab(0x184)};})},await saveImportJson(_0x284a80[_0xfd26bf(0x1a1)],_0x47f246);}await _0x284a80[_0xfd26bf(0x182)]?.();const _0x15c613=_0x47f246;if(_0x15c613['rows'][_0xfd26bf(0x166)](_0x3bf9ca=>_0x3bf9ca[_0xfd26bf(0x19a)]===_0xfd26bf(0x1cd)))throw Error(_0xfd26bf(0x1be));const _0x254e27=async _0x239b9c=>{const _0x37d0b2=_0xfd26bf,_0x2b5428=await _0x18b2ba[_0x37d0b2(0x19d)](_0x239b9c['map'](_0x1a3111=>_0x15c613[_0x37d0b2(0x15f)][_0x1a3111]['id']));if(!Array[_0x37d0b2(0x15d)](_0x2b5428))throw Error(_0x37d0b2(0x17c));const _0x237122=new Set(_0x239b9c['map'](_0x27f83b=>_0x15c613[_0x37d0b2(0x15f)][_0x27f83b]['id'])),_0x142e6f=new Map();for(const _0x35d765 of _0x2b5428){const _0x1a51d5=Number(_0x35d765?.['id']);if(!_0x237122[_0x37d0b2(0x164)](_0x1a51d5)||_0x142e6f[_0x37d0b2(0x164)](_0x1a51d5))throw Error(_0x37d0b2(0x178));_0x142e6f[_0x37d0b2(0x1de)](_0x1a51d5,_0x35d765);}for(const _0x1b964b of _0x239b9c){const _0x113fca=_0x142e6f[_0x37d0b2(0x1a7)](_0x15c613[_0x37d0b2(0x15f)][_0x1b964b]['id']);if(!_0x113fca)continue;if(_0x15c613['rows'][_0x1b964b][_0x37d0b2(0x19a)]===_0x37d0b2(0x184)){_0x15c613[_0x37d0b2(0x15f)][_0x1b964b][_0x37d0b2(0x19a)]=_0x37d0b2(0x1cd),await saveImportJson(_0x284a80[_0x37d0b2(0x1a1)],_0x15c613);throw Error(_0x37d0b2(0x1b9));}const _0x8e5226=_0x30d064[_0x37d0b2(0x15f)][_0x1b964b][_0x37d0b2(0x181)];if(Object['keys'](_0x8e5226)[_0x37d0b2(0x166)](_0x4f6cd3=>!sameImportValue(_0x8e5226[_0x4f6cd3],_0x113fca[_0x4f6cd3],_0x30d064[_0x37d0b2(0x1c3)]?.['includes'](_0x4f6cd3)&&!_0x30d064[_0x37d0b2(0x1b7)]?.['includes'](_0x4f6cd3)))){_0x15c613[_0x37d0b2(0x15f)][_0x1b964b][_0x37d0b2(0x19a)]=_0x37d0b2(0x1cd),await saveImportJson(_0x284a80[_0x37d0b2(0x1a1)],_0x15c613);throw Error(_0x37d0b2(0x16a)+_0x15c613[_0x37d0b2(0x15f)][_0x1b964b][_0x37d0b2(0x165)]+'.');}_0x15c613['rows'][_0x1b964b][_0x37d0b2(0x19a)]=_0x37d0b2(0x1cb);}return await saveImportJson(_0x284a80[_0x37d0b2(0x1a1)],_0x15c613),_0x142e6f;};if(_0x284a80[_0xfd26bf(0x19f)])for(let _0x332f7a=0x0;_0x332f7a<_0x15c613[_0xfd26bf(0x15f)]['length'];_0x332f7a+=_0x284a80[_0xfd26bf(0x16b)]){const _0x3345a1=_0x15c613[_0xfd26bf(0x15f)][_0xfd26bf(0x1a5)](_0x332f7a,_0x332f7a+_0x284a80['batchSize'])[_0xfd26bf(0x159)]((_0x579c24,_0x4e5a37)=>_0x332f7a+_0x4e5a37),_0x12c22b=_0x3345a1['filter'](_0xd0309a=>_0x15c613[_0xfd26bf(0x15f)][_0xd0309a][_0xfd26bf(0x19a)]===_0xfd26bf(0x1cb)),_0x1d4a9b=await _0x254e27(_0x3345a1),_0x37b214=_0x12c22b[_0xfd26bf(0x197)](_0x4a37a0=>!_0x1d4a9b[_0xfd26bf(0x164)](_0x15c613[_0xfd26bf(0x15f)][_0x4a37a0]['id']));if(_0x37b214[_0xfd26bf(0x1d3)]){_0x37b214[_0xfd26bf(0x16c)](_0x3bc2e8=>{const _0x137209=_0xfd26bf;_0x15c613[_0x137209(0x15f)][_0x3bc2e8]['status']=_0x137209(0x1cd);}),await saveImportJson(_0x284a80['checkpoint'],_0x15c613);throw Error('Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.');}}for(let _0x398db4=0x0;_0x398db4<_0x15c613['rows']['length'];){const _0x53c37d=[],_0x2966b4=[];while(_0x398db4<_0x15c613[_0xfd26bf(0x15f)][_0xfd26bf(0x1d3)]&&_0x2966b4[_0xfd26bf(0x1d3)]<_0x284a80[_0xfd26bf(0x16b)]){const _0x55907d=_0x398db4++;if(_0x15c613['rows'][_0x55907d][_0xfd26bf(0x19a)]===_0xfd26bf(0x1cb))continue;const _0x2a0520={..._0x30d064[_0xfd26bf(0x15f)][_0x55907d]['values'],'id':_0x15c613['rows'][_0x55907d]['id']};if(Buffer[_0xfd26bf(0x19b)](JSON[_0xfd26bf(0x157)]({'schemaFingerprint':_0x2d499c[_0xfd26bf(0x163)],'items':[..._0x2966b4,_0x2a0520]}),_0xfd26bf(0x177))>_0x2d499c[_0xfd26bf(0x1d4)]){if(!_0x2966b4[_0xfd26bf(0x1d3)])throw Error(_0xfd26bf(0x17f)+_0x15c613['rows'][_0x55907d][_0xfd26bf(0x165)]+_0xfd26bf(0x18a));_0x398db4--;break;}_0x53c37d[_0xfd26bf(0x186)](_0x55907d),_0x2966b4[_0xfd26bf(0x186)](_0x2a0520);}if(!_0x2966b4[_0xfd26bf(0x1d3)])continue;const _0x32047d=_0x53c37d[_0xfd26bf(0x197)](_0x163d36=>_0x15c613['rows'][_0x163d36]['status']==='unsent');if(_0x32047d['length']){const _0x4c9419=await _0x18b2ba[_0xfd26bf(0x19d)](_0x32047d['map'](_0x554df4=>_0x15c613['rows'][_0x554df4]['id']));if(!Array[_0xfd26bf(0x15d)](_0x4c9419))throw Error('Invalid\x20import\x20readback\x20response.');if(_0x4c9419[_0xfd26bf(0x1d3)])throw Error(_0xfd26bf(0x1b9));}_0x53c37d['forEach'](_0x2e6252=>{const _0x2fae0d=_0xfd26bf;_0x15c613['rows'][_0x2e6252][_0x2fae0d(0x19a)]=_0x2fae0d(0x1a9);}),await saveImportJson(_0x284a80[_0xfd26bf(0x1a1)],_0x15c613),_0x4e99e6++;const _0x548e36=Date[_0xfd26bf(0x1af)](),_0x50f403={'batch':_0x4e99e6,'rowStart':_0x15c613['rows'][_0x53c37d[0x0]][_0xfd26bf(0x165)],'rowEnd':_0x15c613[_0xfd26bf(0x15f)][_0x53c37d[_0x53c37d['length']-0x1]][_0xfd26bf(0x165)],'count':_0x2966b4[_0xfd26bf(0x1d3)],'bytes':Buffer['byteLength'](JSON['stringify']({'schemaFingerprint':_0x2d499c[_0xfd26bf(0x163)],'items':_0x2966b4}),'utf8'),'elapsedMs':0x0,'status':_0xfd26bf(0x18c)};_0x1322ee[_0xfd26bf(0x186)](_0x50f403);try{const _0x3e92b9=await _0x18b2ba[_0xfd26bf(0x1b2)](_0x2966b4);if(!_0x3e92b9||_0x3e92b9['count']!==_0x2966b4[_0xfd26bf(0x1d3)]||!Array[_0xfd26bf(0x15d)](_0x3e92b9[_0xfd26bf(0x179)])||_0x3e92b9[_0xfd26bf(0x179)][_0xfd26bf(0x1d3)]!==_0x2966b4['length']||_0x3e92b9['ids'][_0xfd26bf(0x166)]((_0xae224a,_0x1e6680)=>Number(_0xae224a)!==_0x15c613[_0xfd26bf(0x15f)][_0x53c37d[_0x1e6680]]['id']))throw Error(_0xfd26bf(0x17d));await _0x254e27(_0x53c37d);if(_0x53c37d[_0xfd26bf(0x166)](_0x508129=>_0x15c613[_0xfd26bf(0x15f)][_0x508129][_0xfd26bf(0x19a)]!==_0xfd26bf(0x1cb)))throw Error(_0xfd26bf(0x175));}catch(_0x59c23d){if(_0x15c613['rows'][_0xfd26bf(0x166)](_0x1a79a9=>_0x1a79a9['status']===_0xfd26bf(0x1cd)))throw _0x59c23d;try{await _0x254e27(_0x53c37d);}catch(_0x52a05d){if(_0x15c613[_0xfd26bf(0x15f)][_0xfd26bf(0x166)](_0x234c27=>_0x234c27[_0xfd26bf(0x19a)]===_0xfd26bf(0x1cd)))throw _0x52a05d;}if(_0x53c37d[_0xfd26bf(0x166)](_0x13e861=>_0x15c613['rows'][_0x13e861][_0xfd26bf(0x19a)]!=='succeeded'))throw Error(_0xfd26bf(0x168));}finally{_0x50f403[_0xfd26bf(0x1ac)]=Date[_0xfd26bf(0x1af)]()-_0x548e36;if(_0x53c37d[_0xfd26bf(0x1d6)](_0x399340=>_0x15c613[_0xfd26bf(0x15f)][_0x399340][_0xfd26bf(0x19a)]==='succeeded'))_0x50f403[_0xfd26bf(0x19a)]=_0xfd26bf(0x1cb);else{if(_0x53c37d[_0xfd26bf(0x166)](_0x4cd710=>_0x15c613[_0xfd26bf(0x15f)][_0x4cd710][_0xfd26bf(0x19a)]===_0xfd26bf(0x1cd)))_0x50f403[_0xfd26bf(0x19a)]=_0xfd26bf(0x1cd);}}}const _0x17967f={'status':_0xfd26bf(0x17b),..._0xb5fa31()};return await saveImportJson(_0x284a80[_0xfd26bf(0x185)],_0x17967f),_0x17967f;}catch(_0x401f9d){if(_0x47f246)await saveImportJson(_0x284a80[_0xfd26bf(0x185)],{'status':_0xfd26bf(0x15b),..._0xb5fa31(),'message':_0x401f9d[_0xfd26bf(0x162)]});throw _0x401f9d;}finally{await _0x54fd3c();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a152_0x85fa49=a152_0x2bda;(function(_0x24a73d,_0x340c1f){const _0x5393d0=a152_0x2bda,_0x37fd4c=_0x24a73d();while(!![]){try{const _0x21a003=-parseInt(_0x5393d0(0xdd))/0x1*(parseInt(_0x5393d0(0x102))/0x2)+parseInt(_0x5393d0(0xe7))/0x3*(parseInt(_0x5393d0(0xfa))/0x4)+parseInt(_0x5393d0(0xdf))/0x5*(-parseInt(_0x5393d0(0x112))/0x6)+-parseInt(_0x5393d0(0xe3))/0x7*(-parseInt(_0x5393d0(0xcd))/0x8)+parseInt(_0x5393d0(0x107))/0x9+parseInt(_0x5393d0(0xde))/0xa*(parseInt(_0x5393d0(0x115))/0xb)+parseInt(_0x5393d0(0xe5))/0xc;if(_0x21a003===_0x340c1f)break;else _0x37fd4c['push'](_0x37fd4c['shift']());}catch(_0x5b8ff1){_0x37fd4c['push'](_0x37fd4c['shift']());}}}(a152_0x5e7f,0x69fad));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_0x5e7f(){const _0x931701=['371ZCODeG','digest','468384huxlaF','error','3BXaipz','SOURCE_INVALID','skipped','path','every','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','home','current','package.json','lovrabet-skills','packageVersion','skills','utf8','\x20verified;\x20','isSymbolicLink','split','pipe','update','831620NaFVeO','count','unverifiable','state','includes','packageRoot','unknown','isDirectory','54cjcgVE','Symbolic\x20link\x20is\x20not\x20allowed:\x20','skillVersion','sha256',':\x5cs*(.+)$','3285450hTAFnP','files','manifest','Unsupported\x20Skill\x20entry:\x20','reason','lovrabet','schemaVersion','match','Installed\x20Skill\x20state\x20is\x20','SKILL.md','sort','318ZaOlgP','skills@latest\x20exited\x20','Unsafe\x20manifest\x20path:\x20','292061NCyOzs','log','join','missing','lovrabet\x20cli-skill\x20install','105352muwSAe','parse','present','CLI\x20Built-in\x20Skill\x20','status','length','output','trim','flatMap','message','startsWith','partialFailure','name','content_mismatch','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','version','6184WPJGZc','40eIKKsv','76895mAhUSX','VERIFY_FAILED','absent','installedPath'];a152_0x5e7f=function(){return _0x931701;};return a152_0x5e7f();}const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a152_0x85fa49(0xcc),SKILL_NAME=a152_0x85fa49(0x10c),debug=debuglog(a152_0x85fa49(0xf1));function a152_0x2bda(_0x223d16,_0x511ce1){_0x223d16=_0x223d16-0xca;const _0x5e7f12=a152_0x5e7f();let _0x2bda46=_0x5e7f12[_0x223d16];return _0x2bda46;}function frontmatterValue(_0x9a56c5,_0x2990a5){const _0x19c93e=a152_0x85fa49;return _0x9a56c5[_0x19c93e(0x10e)](new RegExp('^'+_0x2990a5+_0x19c93e(0x106),'m'))?.[0x1]?.[_0x19c93e(0xd4)]()??'';}function listFiles(_0x499e2c,_0x52f28d=_0x499e2c){const _0x547232=a152_0x85fa49;return readdirSync(_0x52f28d,{'withFileTypes':!![]})[_0x547232(0xd5)](_0x54e615=>{const _0x24921c=_0x547232,_0x31aef0=join(_0x52f28d,_0x54e615['name']),_0x29127e=lstatSync(_0x31aef0);if(_0x29127e[_0x24921c(0xf6)]())throw new Error(_0x24921c(0x103)+_0x31aef0);if(_0x29127e[_0x24921c(0x101)]())return listFiles(_0x499e2c,_0x31aef0);if(!_0x29127e['isFile']())throw new Error(_0x24921c(0x10a)+_0x31aef0);return[relative(_0x499e2c,_0x31aef0)['split'](sep)[_0x24921c(0xca)]('/')];})[_0x547232(0x111)]((_0x1acf16,_0x323434)=>_0x1acf16<_0x323434?-0x1:_0x1acf16>_0x323434?0x1:0x0);}function digestFiles(_0x1e85e2,_0x40f018){const _0x353d36=a152_0x85fa49,_0x44ea03=createHash(_0x353d36(0x105));for(const _0x3fa2ab of _0x40f018){if(_0x3fa2ab[_0x353d36(0xd7)]('/')||_0x3fa2ab[_0x353d36(0xf7)]('/')[_0x353d36(0xfe)]('..')||_0x3fa2ab[_0x353d36(0xfe)]('\x5c'))throw new Error(_0x353d36(0x114)+_0x3fa2ab);_0x44ea03[_0x353d36(0xf9)](_0x3fa2ab),_0x44ea03['update']('\x00'),_0x44ea03[_0x353d36(0xf9)](readFileSync(join(_0x1e85e2,..._0x3fa2ab[_0x353d36(0xf7)]('/')))),_0x44ea03[_0x353d36(0xf9)]('\x00');}return _0x44ea03[_0x353d36(0xe4)]('hex');}function sameFiles(_0x57b79f,_0x10426c){const _0x1f23b9=a152_0x85fa49;return _0x57b79f[_0x1f23b9(0xd2)]===_0x10426c[_0x1f23b9(0xd2)]&&_0x57b79f[_0x1f23b9(0xeb)]((_0x36e938,_0x1cbede)=>_0x36e938===_0x10426c[_0x1cbede]);}function readSource(_0x23f085){const _0x10c120=a152_0x85fa49,_0x10e4dc=JSON[_0x10c120(0xce)](readFileSync(join(_0x23f085,_0x10c120(0xf0)),_0x10c120(0xf4))),_0x262bfc=JSON[_0x10c120(0xce)](readFileSync(join(_0x23f085,_0x10c120(0xf3),'lovrabet.manifest.json'),'utf8')),_0x2f4723=join(_0x23f085,_0x10c120(0xf3),SKILL_NAME),_0x24173d=frontmatterValue(readFileSync(join(_0x2f4723,_0x10c120(0x110)),_0x10c120(0xf4)),_0x10c120(0xdc)),_0x54b0b2=listFiles(_0x2f4723);if(_0x262bfc[_0x10c120(0x10d)]!==0x1||_0x262bfc[_0x10c120(0xd9)]!==SKILL_NAME||!_0x10e4dc['version']||_0x262bfc[_0x10c120(0xf2)]!==_0x10e4dc[_0x10c120(0xdc)]||_0x262bfc[_0x10c120(0x104)]!==_0x10e4dc[_0x10c120(0xdc)]||_0x24173d!==_0x10e4dc[_0x10c120(0xdc)]||!sameFiles(_0x54b0b2,_0x262bfc['files'])||digestFiles(_0x2f4723,_0x54b0b2)!==_0x262bfc[_0x10c120(0xe4)])throw new Error(_0x10c120(0xed));return{'packageVersion':_0x10e4dc[_0x10c120(0xdc)],'skillVersion':_0x24173d,'root':_0x2f4723,'manifest':_0x262bfc};}function installedSkillPath(_0x515df1){const _0x336c22=a152_0x85fa49,_0x53f039=resolveInstalledSkill(SKILL_NAME,{'home':_0x515df1});if(_0x53f039[_0x336c22(0xfd)]==='present')return{'state':_0x336c22(0xcf),'path':dirname(_0x53f039[_0x336c22(0xea)])};if(_0x53f039['state']===_0x336c22(0xe1))return{'state':_0x336c22(0xcb)};return{'state':_0x336c22(0xfc),'reason':_0x53f039['reason']};}export function inspectInstalledBuiltinSkillVersion(_0x58481b,_0x111d05={}){const _0x5007c8=a152_0x85fa49,_0x5c2748=installedSkillPath(_0x111d05[_0x5007c8(0xee)]??homedir());if(_0x5c2748['state']===_0x5007c8(0xcb))return{'state':'missing','expectedVersion':_0x58481b,'repairCommand':REPAIR_COMMAND};if(_0x5c2748['state']===_0x5007c8(0xfc))return{'state':_0x5007c8(0xfc),'expectedVersion':_0x58481b,'reason':_0x5c2748[_0x5007c8(0x10b)],'repairCommand':REPAIR_COMMAND};try{const _0x3382f0=frontmatterValue(readFileSync(join(_0x5c2748[_0x5007c8(0xea)],_0x5007c8(0x110)),'utf8'),_0x5007c8(0xdc));return{'state':_0x3382f0===_0x58481b?_0x5007c8(0xef):'version_mismatch','expectedVersion':_0x58481b,'skillVersion':_0x3382f0,'installedPath':_0x5c2748[_0x5007c8(0xea)],'repairCommand':REPAIR_COMMAND};}catch(_0x3b9e99){return{'state':_0x5007c8(0xfc),'expectedVersion':_0x58481b,'installedPath':_0x5c2748[_0x5007c8(0xea)],'reason':_0x3b9e99 instanceof Error?_0x3b9e99[_0x5007c8(0xd6)]:String(_0x3b9e99),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x333c74={}){const _0x15bcc9=a152_0x85fa49,_0x4318f7=_0x333c74['packageRoot']??DEFAULT_PACKAGE_ROOT;let _0x1659a3;try{_0x1659a3=readSource(_0x4318f7);}catch(_0x21f875){return{'state':'unverifiable','packageVersion':'unknown','reason':_0x21f875 instanceof Error?_0x21f875[_0x15bcc9(0xd6)]:String(_0x21f875),'repairCommand':REPAIR_COMMAND};}const _0x1105d6=installedSkillPath(_0x333c74[_0x15bcc9(0xee)]??homedir());if(_0x1105d6[_0x15bcc9(0xfd)]===_0x15bcc9(0xcb))return{'state':_0x15bcc9(0xcb),'packageVersion':_0x1659a3[_0x15bcc9(0xf2)],'repairCommand':REPAIR_COMMAND};if(_0x1105d6[_0x15bcc9(0xfd)]==='unverifiable')return{'state':_0x15bcc9(0xfc),'packageVersion':_0x1659a3[_0x15bcc9(0xf2)],'reason':_0x1105d6[_0x15bcc9(0x10b)],'repairCommand':REPAIR_COMMAND};try{const _0x163eba=frontmatterValue(readFileSync(join(_0x1105d6[_0x15bcc9(0xea)],'SKILL.md'),_0x15bcc9(0xf4)),_0x15bcc9(0xdc));if(_0x163eba!==_0x1659a3[_0x15bcc9(0x104)])return{'state':'version_mismatch','packageVersion':_0x1659a3['packageVersion'],'skillVersion':_0x163eba,'installedPath':_0x1105d6[_0x15bcc9(0xea)],'repairCommand':REPAIR_COMMAND};const _0x4179ef=listFiles(_0x1105d6[_0x15bcc9(0xea)]),_0x136f99=digestFiles(_0x1105d6[_0x15bcc9(0xea)],_0x4179ef);return{'state':sameFiles(_0x4179ef,_0x1659a3[_0x15bcc9(0x109)][_0x15bcc9(0x108)])&&_0x136f99===_0x1659a3[_0x15bcc9(0x109)][_0x15bcc9(0xe4)]?'current':_0x15bcc9(0xda),'packageVersion':_0x1659a3[_0x15bcc9(0xf2)],'skillVersion':_0x163eba,'installedPath':_0x1105d6[_0x15bcc9(0xea)],'digest':_0x136f99,'repairCommand':REPAIR_COMMAND};}catch(_0x88bae6){return{'state':'unverifiable','packageVersion':_0x1659a3['packageVersion'],'installedPath':_0x1105d6['path'],'reason':_0x88bae6 instanceof Error?_0x88bae6[_0x15bcc9(0xd6)]:String(_0x88bae6),'repairCommand':REPAIR_COMMAND};}}function failure(_0x3bf6f9,_0x2b0583,_0x2ef44d,_0x282c1d){const _0x202e0e=a152_0x85fa49;return{'ok':![],'code':_0x3bf6f9,'packageVersion':_0x2b0583[_0x202e0e(0xf2)],'skillVersion':_0x2b0583[_0x202e0e(0x104)],'installedPath':_0x282c1d,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x2ef44d instanceof Error?_0x2ef44d['message']:String(_0x2ef44d)};}export function installBuiltinSkill(_0x564fdb={}){const _0x2eb474=a152_0x85fa49,_0xc98ea3=_0x564fdb[_0x2eb474(0xff)]??DEFAULT_PACKAGE_ROOT,_0x328058=_0x564fdb[_0x2eb474(0xee)]??homedir();let _0x1b7846;try{_0x1b7846=readSource(_0xc98ea3);}catch(_0x2d0f49){return failure(_0x2eb474(0xe8),{'packageVersion':_0x2eb474(0x100),'skillVersion':'unknown'},_0x2d0f49);}const _0x4a95d3=inspectBuiltinSkill({'packageRoot':_0xc98ea3,'home':_0x328058}),_0x467c45=runNpxSkillsAddGlobal(_0xc98ea3,_0x1b7846['root'],{'stdio':_0x564fdb['stdio']??_0x2eb474(0xf8),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x328058}});if(_0x467c45[_0x2eb474(0xe9)])return{'ok':!![],'packageVersion':_0x1b7846[_0x2eb474(0xf2)],'skillVersion':_0x1b7846[_0x2eb474(0x104)],'installedPath':_0x4a95d3[_0x2eb474(0xe2)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x467c45['ok'])return failure('INSTALL_FAILED',_0x1b7846,_0x467c45[_0x2eb474(0xe6)]??_0x2eb474(0x113)+_0x467c45[_0x2eb474(0xd1)]);const _0x29f291=inspectBuiltinSkill({'packageRoot':_0xc98ea3,'home':_0x328058});if(_0x29f291['state']!==_0x2eb474(0xef)){const _0x33fdfc=_0x29f291[_0x2eb474(0x10b)]??_0x2eb474(0x10f)+_0x29f291['state'];return failure(_0x2eb474(0xe0),_0x1b7846,_0x467c45[_0x2eb474(0xd8)]?_0x33fdfc+'\x0a'+_0x467c45[_0x2eb474(0xd8)][_0x2eb474(0xd3)]:_0x33fdfc,_0x29f291[_0x2eb474(0xe2)]);}return _0x467c45[_0x2eb474(0xd8)]&&(debug(_0x2eb474(0xec),_0x467c45[_0x2eb474(0xd8)][_0x2eb474(0xd3)]),console[_0x2eb474(0x116)](_0x2eb474(0xd0)+_0x1b7846[_0x2eb474(0x104)]+_0x2eb474(0xf5)+_0x467c45['partialFailure'][_0x2eb474(0xfb)]+_0x2eb474(0xdb))),{'ok':!![],'packageVersion':_0x1b7846[_0x2eb474(0xf2)],'skillVersion':_0x1b7846[_0x2eb474(0x104)],'installedPath':_0x29f291['installedPath'],'changed':_0x4a95d3[_0x2eb474(0xfd)]!==_0x2eb474(0xef),'repairCommand':REPAIR_COMMAND};}
|
|
1
|
+
const a152_0x211dbd=a152_0x974d;(function(_0xd94a95,_0x5bf0f1){const _0x22da9f=a152_0x974d,_0x52fe1e=_0xd94a95();while(!![]){try{const _0x386878=-parseInt(_0x22da9f(0x1c0))/0x1*(-parseInt(_0x22da9f(0x199))/0x2)+-parseInt(_0x22da9f(0x197))/0x3+-parseInt(_0x22da9f(0x1b1))/0x4+-parseInt(_0x22da9f(0x1bc))/0x5*(parseInt(_0x22da9f(0x1ab))/0x6)+parseInt(_0x22da9f(0x1b9))/0x7*(-parseInt(_0x22da9f(0x1bd))/0x8)+-parseInt(_0x22da9f(0x1a2))/0x9*(-parseInt(_0x22da9f(0x18b))/0xa)+-parseInt(_0x22da9f(0x18d))/0xb*(-parseInt(_0x22da9f(0x191))/0xc);if(_0x386878===_0x5bf0f1)break;else _0x52fe1e['push'](_0x52fe1e['shift']());}catch(_0x5488f4){_0x52fe1e['push'](_0x52fe1e['shift']());}}}(a152_0x2f72,0x31236));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_0x974d(_0x125eef,_0x4bbe86){_0x125eef=_0x125eef-0x186;const _0x2f72b7=a152_0x2f72();let _0x974da7=_0x2f72b7[_0x125eef];return _0x974da7;}const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME=a152_0x211dbd(0x19f),debug=debuglog(a152_0x211dbd(0x1c5));function frontmatterValue(_0x1e4e17,_0x2dbc43){return _0x1e4e17['match'](new RegExp('^'+_0x2dbc43+':\x5cs*(.+)$','m'))?.[0x1]?.['trim']()??'';}function listFiles(_0x35a835,_0x1eb581=_0x35a835){const _0x550f96=a152_0x211dbd;return readdirSync(_0x1eb581,{'withFileTypes':!![]})[_0x550f96(0x1a5)](_0x20ff44=>{const _0x17b2d7=_0x550f96,_0x150f18=join(_0x1eb581,_0x20ff44[_0x17b2d7(0x1ac)]),_0x1f7636=lstatSync(_0x150f18);if(_0x1f7636[_0x17b2d7(0x1cb)]())throw new Error(_0x17b2d7(0x19e)+_0x150f18);if(_0x1f7636[_0x17b2d7(0x1af)]())return listFiles(_0x35a835,_0x150f18);if(!_0x1f7636[_0x17b2d7(0x19a)]())throw new Error(_0x17b2d7(0x18f)+_0x150f18);return[relative(_0x35a835,_0x150f18)[_0x17b2d7(0x196)](sep)[_0x17b2d7(0x19d)]('/')];})[_0x550f96(0x1ca)]((_0x33cb6b,_0x597382)=>_0x33cb6b<_0x597382?-0x1:_0x33cb6b>_0x597382?0x1:0x0);}function digestFiles(_0x84a2a4,_0x5eaf38){const _0x255592=a152_0x211dbd,_0x41da5a=createHash('sha256');for(const _0x485105 of _0x5eaf38){if(_0x485105[_0x255592(0x1ba)]('/')||_0x485105[_0x255592(0x196)]('/')[_0x255592(0x186)]('..')||_0x485105[_0x255592(0x186)]('\x5c'))throw new Error(_0x255592(0x1c4)+_0x485105);_0x41da5a['update'](_0x485105),_0x41da5a['update']('\x00'),_0x41da5a[_0x255592(0x1a8)](readFileSync(join(_0x84a2a4,..._0x485105['split']('/')))),_0x41da5a[_0x255592(0x1a8)]('\x00');}return _0x41da5a[_0x255592(0x1ce)](_0x255592(0x1c7));}function sameFiles(_0x43ee38,_0x13f999){const _0x512891=a152_0x211dbd;return _0x43ee38[_0x512891(0x1a0)]===_0x13f999['length']&&_0x43ee38[_0x512891(0x1bf)]((_0x1cc4d8,_0x2e8fac)=>_0x1cc4d8===_0x13f999[_0x2e8fac]);}function readSource(_0x242ac1){const _0xe1ca13=a152_0x211dbd,_0xfc90f1=JSON[_0xe1ca13(0x192)](readFileSync(join(_0x242ac1,'package.json'),_0xe1ca13(0x1b8))),_0x23030f=JSON['parse'](readFileSync(join(_0x242ac1,'skills',_0xe1ca13(0x1c3)),_0xe1ca13(0x1b8))),_0xdf48f6=join(_0x242ac1,_0xe1ca13(0x1ad),SKILL_NAME),_0x4aa148=frontmatterValue(readFileSync(join(_0xdf48f6,_0xe1ca13(0x18a)),_0xe1ca13(0x1b8)),_0xe1ca13(0x1a6)),_0x50c7a5=listFiles(_0xdf48f6);if(_0x23030f['schemaVersion']!==0x1||_0x23030f[_0xe1ca13(0x1ac)]!==SKILL_NAME||!_0xfc90f1['version']||_0x23030f['packageVersion']!==_0xfc90f1[_0xe1ca13(0x1a6)]||_0x23030f[_0xe1ca13(0x19b)]!==_0xfc90f1[_0xe1ca13(0x1a6)]||_0x4aa148!==_0xfc90f1[_0xe1ca13(0x1a6)]||!sameFiles(_0x50c7a5,_0x23030f[_0xe1ca13(0x1b3)])||digestFiles(_0xdf48f6,_0x50c7a5)!==_0x23030f['digest'])throw new Error(_0xe1ca13(0x189));return{'packageVersion':_0xfc90f1[_0xe1ca13(0x1a6)],'skillVersion':_0x4aa148,'root':_0xdf48f6,'manifest':_0x23030f};}function installedSkillPath(_0x2b9143){const _0x248c66=a152_0x211dbd,_0x108810=resolveInstalledSkill(SKILL_NAME,{'home':_0x2b9143});if(_0x108810[_0x248c66(0x1cd)]===_0x248c66(0x194))return{'state':_0x248c66(0x194),'path':dirname(_0x108810[_0x248c66(0x1c2)])};if(_0x108810[_0x248c66(0x1cd)]===_0x248c66(0x1c6))return{'state':_0x248c66(0x1a4)};return{'state':_0x248c66(0x195),'reason':_0x108810[_0x248c66(0x1c9)]};}function a152_0x2f72(){const _0x2ea889=['INSTALL_FAILED','Unsupported\x20Skill\x20entry:\x20','packageRoot','1644pQdkSj','parse','SOURCE_INVALID','present','unverifiable','split','756573TzPZBi','count','1694cGfXGy','isFile','skillVersion','Installed\x20Skill\x20state\x20is\x20','join','Symbolic\x20link\x20is\x20not\x20allowed:\x20','lovrabet','length','log','36niwQUx','message','missing','flatMap','version','installedPath','update','root','output','12yxajGq','name','skills','packageVersion','isDirectory','content_mismatch','935324sDQIMU','unknown','files','manifest','stdio','\x20verified;\x20','CLI\x20Built-in\x20Skill\x20','utf8','7fdBLhM','startsWith','version_mismatch','561740DFjcfH','2919016EhieUn','partialFailure','every','171uyjttI','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','path','lovrabet.manifest.json','Unsafe\x20manifest\x20path:\x20','lovrabet-skills','absent','hex','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','reason','sort','isSymbolicLink','VERIFY_FAILED','state','digest','includes','current','home','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','SKILL.md','984680FykKjR','skipped','59268ffdevP'];a152_0x2f72=function(){return _0x2ea889;};return a152_0x2f72();}export function inspectInstalledBuiltinSkillVersion(_0xd9535a,_0x4579a6={}){const _0x9a606c=a152_0x211dbd,_0x13e7c1=installedSkillPath(_0x4579a6[_0x9a606c(0x188)]??homedir());if(_0x13e7c1[_0x9a606c(0x1cd)]===_0x9a606c(0x1a4))return{'state':_0x9a606c(0x1a4),'expectedVersion':_0xd9535a,'repairCommand':REPAIR_COMMAND};if(_0x13e7c1[_0x9a606c(0x1cd)]==='unverifiable')return{'state':_0x9a606c(0x195),'expectedVersion':_0xd9535a,'reason':_0x13e7c1[_0x9a606c(0x1c9)],'repairCommand':REPAIR_COMMAND};try{const _0x37d8c2=frontmatterValue(readFileSync(join(_0x13e7c1[_0x9a606c(0x1c2)],_0x9a606c(0x18a)),_0x9a606c(0x1b8)),_0x9a606c(0x1a6));return{'state':_0x37d8c2===_0xd9535a?_0x9a606c(0x187):_0x9a606c(0x1bb),'expectedVersion':_0xd9535a,'skillVersion':_0x37d8c2,'installedPath':_0x13e7c1['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x3c71b4){return{'state':'unverifiable','expectedVersion':_0xd9535a,'installedPath':_0x13e7c1[_0x9a606c(0x1c2)],'reason':_0x3c71b4 instanceof Error?_0x3c71b4[_0x9a606c(0x1a3)]:String(_0x3c71b4),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x310fa7={}){const _0x196fe5=a152_0x211dbd,_0x5e7a1c=_0x310fa7['packageRoot']??DEFAULT_PACKAGE_ROOT;let _0x32c0aa;try{_0x32c0aa=readSource(_0x5e7a1c);}catch(_0x5734fb){return{'state':_0x196fe5(0x195),'packageVersion':_0x196fe5(0x1b2),'reason':_0x5734fb instanceof Error?_0x5734fb['message']:String(_0x5734fb),'repairCommand':REPAIR_COMMAND};}const _0x36ecf3=installedSkillPath(_0x310fa7[_0x196fe5(0x188)]??homedir());if(_0x36ecf3[_0x196fe5(0x1cd)]===_0x196fe5(0x1a4))return{'state':'missing','packageVersion':_0x32c0aa[_0x196fe5(0x1ae)],'repairCommand':REPAIR_COMMAND};if(_0x36ecf3[_0x196fe5(0x1cd)]===_0x196fe5(0x195))return{'state':_0x196fe5(0x195),'packageVersion':_0x32c0aa['packageVersion'],'reason':_0x36ecf3[_0x196fe5(0x1c9)],'repairCommand':REPAIR_COMMAND};try{const _0x2a585c=frontmatterValue(readFileSync(join(_0x36ecf3[_0x196fe5(0x1c2)],_0x196fe5(0x18a)),_0x196fe5(0x1b8)),'version');if(_0x2a585c!==_0x32c0aa[_0x196fe5(0x19b)])return{'state':_0x196fe5(0x1bb),'packageVersion':_0x32c0aa[_0x196fe5(0x1ae)],'skillVersion':_0x2a585c,'installedPath':_0x36ecf3[_0x196fe5(0x1c2)],'repairCommand':REPAIR_COMMAND};const _0x2f16c7=listFiles(_0x36ecf3[_0x196fe5(0x1c2)]),_0xc24efb=digestFiles(_0x36ecf3[_0x196fe5(0x1c2)],_0x2f16c7);return{'state':sameFiles(_0x2f16c7,_0x32c0aa[_0x196fe5(0x1b4)][_0x196fe5(0x1b3)])&&_0xc24efb===_0x32c0aa[_0x196fe5(0x1b4)][_0x196fe5(0x1ce)]?_0x196fe5(0x187):_0x196fe5(0x1b0),'packageVersion':_0x32c0aa[_0x196fe5(0x1ae)],'skillVersion':_0x2a585c,'installedPath':_0x36ecf3[_0x196fe5(0x1c2)],'digest':_0xc24efb,'repairCommand':REPAIR_COMMAND};}catch(_0x4e063c){return{'state':_0x196fe5(0x195),'packageVersion':_0x32c0aa[_0x196fe5(0x1ae)],'installedPath':_0x36ecf3['path'],'reason':_0x4e063c instanceof Error?_0x4e063c['message']:String(_0x4e063c),'repairCommand':REPAIR_COMMAND};}}function failure(_0x205146,_0x314123,_0x4e8b85,_0x186c57){return{'ok':![],'code':_0x205146,'packageVersion':_0x314123['packageVersion'],'skillVersion':_0x314123['skillVersion'],'installedPath':_0x186c57,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x4e8b85 instanceof Error?_0x4e8b85['message']:String(_0x4e8b85)};}export function installBuiltinSkill(_0xb50599={}){const _0x4fe777=a152_0x211dbd,_0xcd9ae7=_0xb50599[_0x4fe777(0x190)]??DEFAULT_PACKAGE_ROOT,_0x25c4cf=_0xb50599[_0x4fe777(0x188)]??homedir();let _0x239eb4;try{_0x239eb4=readSource(_0xcd9ae7);}catch(_0x35deb7){return failure(_0x4fe777(0x193),{'packageVersion':'unknown','skillVersion':_0x4fe777(0x1b2)},_0x35deb7);}const _0x446f55=inspectBuiltinSkill({'packageRoot':_0xcd9ae7,'home':_0x25c4cf}),_0x1ec157=runNpxSkillsAddGlobal(_0xcd9ae7,_0x239eb4[_0x4fe777(0x1a9)],{'stdio':_0xb50599[_0x4fe777(0x1b5)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x25c4cf}});if(_0x1ec157[_0x4fe777(0x18c)])return{'ok':!![],'packageVersion':_0x239eb4[_0x4fe777(0x1ae)],'skillVersion':_0x239eb4['skillVersion'],'installedPath':_0x446f55[_0x4fe777(0x1a7)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x1ec157['ok'])return failure(_0x4fe777(0x18e),_0x239eb4,_0x1ec157['error']??'skills@latest\x20exited\x20'+_0x1ec157['status']);const _0x3362d0=inspectBuiltinSkill({'packageRoot':_0xcd9ae7,'home':_0x25c4cf});if(_0x3362d0[_0x4fe777(0x1cd)]!==_0x4fe777(0x187)){const _0x52ac4e=_0x3362d0[_0x4fe777(0x1c9)]??_0x4fe777(0x19c)+_0x3362d0[_0x4fe777(0x1cd)];return failure(_0x4fe777(0x1cc),_0x239eb4,_0x1ec157['partialFailure']?_0x52ac4e+'\x0a'+_0x1ec157[_0x4fe777(0x1be)][_0x4fe777(0x1aa)]:_0x52ac4e,_0x3362d0[_0x4fe777(0x1a7)]);}return _0x1ec157[_0x4fe777(0x1be)]&&(debug(_0x4fe777(0x1c1),_0x1ec157['partialFailure'][_0x4fe777(0x1aa)]),console[_0x4fe777(0x1a1)](_0x4fe777(0x1b7)+_0x239eb4['skillVersion']+_0x4fe777(0x1b6)+_0x1ec157[_0x4fe777(0x1be)][_0x4fe777(0x198)]+_0x4fe777(0x1c8))),{'ok':!![],'packageVersion':_0x239eb4['packageVersion'],'skillVersion':_0x239eb4[_0x4fe777(0x19b)],'installedPath':_0x3362d0[_0x4fe777(0x1a7)],'changed':_0x446f55[_0x4fe777(0x1cd)]!==_0x4fe777(0x187),'repairCommand':REPAIR_COMMAND};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x78fc9c=a153_0x3679;(function(_0xbd632e,_0x1a5235){const _0xdd9625=a153_0x3679,_0xc5d90=_0xbd632e();while(!![]){try{const _0xb7a02f=parseInt(_0xdd9625(0x90))/0x1*(-parseInt(_0xdd9625(0x9a))/0x2)+-parseInt(_0xdd9625(0x86))/0x3+parseInt(_0xdd9625(0xad))/0x4*(-parseInt(_0xdd9625(0xa1))/0x5)+-parseInt(_0xdd9625(0x8a))/0x6+parseInt(_0xdd9625(0x9b))/0x7+-parseInt(_0xdd9625(0xab))/0x8+parseInt(_0xdd9625(0xb1))/0x9*(parseInt(_0xdd9625(0xa7))/0xa);if(_0xb7a02f===_0x1a5235)break;else _0xc5d90['push'](_0xc5d90['shift']());}catch(_0x3effb6){_0xc5d90['push'](_0xc5d90['shift']());}}}(a153_0x16fd,0xbfa7a));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a153_0x40e272}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';function a153_0x16fd(){const _0x5e552c=['npx','npm_config_global','ENOENT','present','pipe','\x22\x20install\x20state:\x20','shortMessage','absent','skipNpxSkillsEnvSuffix','374133TeSKKm','\x20failed\x20target(s)','state','reason','6445020EPKUgr','CHILD_TERMINATED','stdio','exitCode','unverifiable','Skill\x20\x22','1387lYhrLH','EACCES','Installer\x20reported\x20','stderr','filter','expectedSkillName','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','SKILL_NOT_INSTALLED','failed','stdout','502hWUNqX','7886312pQYuVk','warn','signal','presence','internalSkillSource','CHILD_EXIT_NONZERO','5gXjcdw','message','partialFailure','checked','globalSkillName','SPAWN_FAILED','4420ogrXtb','add','trim','!\x20Could\x20not\x20verify\x20\x22','8845776ryLIRg','skills@latest','2738936hJuWQD','INSTALL_PARTIAL','npx\x20terminated\x20by\x20signal\x20','code','61002fYQrsp'];a153_0x16fd=function(){return _0x5e552c;};return a153_0x16fd();}import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a153_0x40e272;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a153_0x78fc9c(0x9f)];function a153_0x3679(_0x27d04f,_0x4a4cf8){_0x27d04f=_0x27d04f-0x80;const _0x16fdcf=a153_0x16fd();let _0x3679fb=_0x16fdcf[_0x27d04f];return _0x3679fb;}export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a153_0x78fc9c(0xa5)];export function resolveGlobalSkillName(_0x191259){const _0x55a643=a153_0x78fc9c;switch(_0x191259[_0x55a643(0xa9)]()){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[a153_0x78fc9c(0x85)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x26a695,_0x2aee7a,_0x309558){return{'ok':![],'status':_0x2aee7a,'code':_0x26a695,'error':'['+_0x26a695+']\x20'+_0x309558};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x1f2782,_0x5b2980=LOVRABET_SKILL_SOURCE,_0x22121f){const _0x3d6373=a153_0x78fc9c;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x4b43c5=['-y',_0x3d6373(0xac),_0x3d6373(0xa8),_0x5b2980,'-g','-y'],_0x4c76c8=['npx',..._0x4b43c5]['join']('\x20');console['log']('*\x20'+_0x4c76c8);const _0x213707={...process.env};delete _0x213707[_0x3d6373(0xb3)],delete _0x213707['NPM_CONFIG_GLOBAL'];const _0x26c3d7=execaSync(_0x3d6373(0xb2),_0x4b43c5,{'cwd':_0x1f2782,'stdio':_0x3d6373(0x81),'env':_0x213707,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x959b1f=[_0x26c3d7[_0x3d6373(0x99)]?String(_0x26c3d7[_0x3d6373(0x99)]):'',_0x26c3d7[_0x3d6373(0x93)]?String(_0x26c3d7['stderr']):''][_0x3d6373(0x94)](Boolean)['join']('\x0a')[_0x3d6373(0xa9)](),_0x4a1313=_0x26c3d7[_0x3d6373(0x8d)]??null,_0x494f10=_0x5a8390=>{const _0x3d5c5a=_0x3d6373;return _0x22121f?.[_0x3d5c5a(0x8c)]!=='pipe'&&!_0x5a8390[_0x3d5c5a(0xa3)]&&_0x959b1f&&console['log'](_0x959b1f),_0x5a8390;};if(_0x26c3d7[_0x3d6373(0xb0)]){const _0x55ec75=_0x26c3d7[_0x3d6373(0xb0)]===_0x3d6373(0xb4)?'NPX_NOT_FOUND':_0x26c3d7[_0x3d6373(0xb0)]==='EPERM'||_0x26c3d7[_0x3d6373(0xb0)]===_0x3d6373(0x91)?'PERMISSION_DENIED':'SPAWN_FAILED';return _0x494f10(failure(_0x55ec75,_0x4a1313,_0x26c3d7[_0x3d6373(0x83)]??_0x26c3d7['message']??_0x26c3d7['code']));}if(_0x26c3d7[_0x3d6373(0x9d)])return _0x494f10(failure(_0x3d6373(0x8b),_0x4a1313,_0x3d6373(0xaf)+_0x26c3d7[_0x3d6373(0x9d)]));if(_0x26c3d7[_0x3d6373(0x98)]&&_0x4a1313===null)return _0x494f10(failure(_0x3d6373(0xa6),_0x4a1313,_0x26c3d7[_0x3d6373(0x83)]??_0x26c3d7[_0x3d6373(0xa2)]??'npx\x20failed\x20to\x20start'));if(_0x4a1313!==0x0)return _0x494f10(failure(_0x3d6373(0xa0),_0x4a1313,_0x959b1f||_0x26c3d7['shortMessage']||'exit\x20'+(_0x4a1313??'unknown')));const _0x46accd=_0x22121f?.[_0x3d6373(0x95)]??resolveGlobalSkillName(_0x5b2980),_0x48eea6=_0x46accd?resolveInstalledSkill(_0x46accd,_0x22121f?.[_0x3d6373(0x9e)]):undefined,_0x4bed6e=_0x959b1f['match'](/Failed to install\s+(\d+)/i);if(_0x4bed6e&&Number(_0x4bed6e[0x1])>0x0){const _0x5051b9=_0x3d6373(0x92)+_0x4bed6e[0x1]+_0x3d6373(0x87)+(_0x959b1f?':\x0a'+_0x959b1f:'');if(_0x48eea6?.['state']===_0x3d6373(0x80))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x4bed6e[0x1]),'output':_0x959b1f}};return _0x494f10(failure(_0x3d6373(0xae),0x0,_0x5051b9));}if(_0x46accd&&_0x48eea6){if(_0x48eea6['state']===_0x3d6373(0x84))return _0x494f10(failure(_0x3d6373(0x97),0x0,_0x3d6373(0x8f)+_0x46accd+_0x3d6373(0x96)+_0x48eea6[_0x3d6373(0xa4)]['join'](',\x20')+')'));_0x48eea6[_0x3d6373(0x88)]===_0x3d6373(0x8e)&&console[_0x3d6373(0x9c)](_0x3d6373(0xaa)+_0x46accd+_0x3d6373(0x82)+_0x48eea6[_0x3d6373(0x89)]);}return _0x494f10({'ok':!![],'status':0x0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a154_0xf4cfad=a154_0x368c;function a154_0x368c(_0x226d10,_0x692bfa){_0x226d10=_0x226d10-0x18f;const _0x568a05=a154_0x568a();let _0x368c99=_0x568a05[_0x226d10];return _0x368c99;}function a154_0x568a(){const _0x3d3502=['build','2534auWYsH','1784emropp','55668EhkJUU','3827560bofcDQ','.hg','126547RNOAtc','3312bBsStq','6gsEYcH','.git','471951bnphdc','.turbo','2045mNIFOt','lovrabet.skill.json','.svn','2030215JtHkAz','8DWaqYW','.cache','SKILL.md','coverage','12COfIqQ'];a154_0x568a=function(){return _0x3d3502;};return a154_0x568a();}(function(_0x1fb6fc,_0x2c707a){const _0x4cce6e=a154_0x368c,_0xc6bedf=_0x1fb6fc();while(!![]){try{const _0x576cf8=parseInt(_0x4cce6e(0x19c))/0x1*(parseInt(_0x4cce6e(0x19e))/0x2)+-parseInt(_0x4cce6e(0x199))/0x3+parseInt(_0x4cce6e(0x198))/0x4*(-parseInt(_0x4cce6e(0x1a2))/0x5)+-parseInt(_0x4cce6e(0x19d))/0x6*(parseInt(_0x4cce6e(0x197))/0x7)+parseInt(_0x4cce6e(0x191))/0x8*(parseInt(_0x4cce6e(0x1a0))/0x9)+parseInt(_0x4cce6e(0x19a))/0xa+-parseInt(_0x4cce6e(0x190))/0xb*(parseInt(_0x4cce6e(0x195))/0xc);if(_0x576cf8===_0x2c707a)break;else _0xc6bedf['push'](_0xc6bedf['shift']());}catch(_0x203584){_0xc6bedf['push'](_0xc6bedf['shift']());}}}(a154_0x568a,0x38065));export const METADATA_FILE=a154_0xf4cfad(0x1a3);export const SKILL_FILE=a154_0xf4cfad(0x193);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);export const IGNORED_DIR_NAMES=new Set([a154_0xf4cfad(0x19f),a154_0xf4cfad(0x19b),a154_0xf4cfad(0x18f),'node_modules','.next','dist',a154_0xf4cfad(0x196),a154_0xf4cfad(0x194),a154_0xf4cfad(0x1a1),a154_0xf4cfad(0x192)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d6b09,_0x4186bc){const _0x380db0=a155_0x5d7c,_0x32a4e7=_0x3d6b09();while(!![]){try{const _0x122fe2=-parseInt(_0x380db0(0x7d))/0x1*(parseInt(_0x380db0(0x7c))/0x2)+parseInt(_0x380db0(0x78))/0x3*(-parseInt(_0x380db0(0x6d))/0x4)+-parseInt(_0x380db0(0x77))/0x5*(-parseInt(_0x380db0(0x71))/0x6)+parseInt(_0x380db0(0x79))/0x7+-parseInt(_0x380db0(0x7a))/0x8+parseInt(_0x380db0(0x72))/0x9*(parseInt(_0x380db0(0x76))/0xa)+-parseInt(_0x380db0(0x7b))/0xb*(-parseInt(_0x380db0(0x73))/0xc);if(_0x122fe2===_0x4186bc)break;else _0x32a4e7['push'](_0x32a4e7['shift']());}catch(_0x2e1c82){_0x32a4e7['push'](_0x32a4e7['shift']());}}}(a155_0x58e3,0xa0a40));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';function a155_0x5d7c(_0x4c533a,_0x25a5a3){_0x4c533a=_0x4c533a-0x6d;const _0x58e337=a155_0x58e3();let _0x5d7c1c=_0x58e337[_0x4c533a];return _0x5d7c1c;}import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x21e413,_0x2fa14c){const _0x3bc316=a155_0x5d7c,_0x38c2a7=normalizeSkillRelativePath(_0x2fa14c),_0x122293=realOrResolved(_0x21e413),_0x263edd=resolve(_0x122293,..._0x38c2a7[_0x3bc316(0x80)]('/'));if(!isPathInside(_0x263edd,_0x122293))throw CliErrors[_0x3bc316(0x6e)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x2fa14c);return ensureNoSymlinkInManagedPath(_0x122293,_0x38c2a7),_0x263edd;}export function ensureNoSymlinkInManagedPath(_0x17d661,_0x115e5c){const _0x15986c=a155_0x5d7c;let _0x4ebae6=_0x17d661;for(const _0x4d256c of _0x115e5c[_0x15986c(0x80)]('/')){_0x4ebae6=resolve(_0x4ebae6,_0x4d256c);const _0x8399f2=lstatIfPresent(_0x4ebae6);if(_0x8399f2?.['isSymbolicLink']())throw CliErrors[_0x15986c(0x6e)](_0x15986c(0x75)+_0x115e5c);}}export function isDanglingSymlink(_0x2c0bd7){const _0x132814=a155_0x5d7c;try{return lstatSync(_0x2c0bd7)[_0x132814(0x70)]();}catch{return![];}}export function resolveSymlinkTarget(_0x487b4c){const _0x2a7933=readlinkSync(_0x487b4c);return isAbsolute(_0x2a7933)?_0x2a7933:resolve(dirname(_0x487b4c),_0x2a7933);}export function isPathInside(_0x545561,_0x472187){const _0x58db5b=a155_0x5d7c,_0x2be1ee=_0x545561[_0x58db5b(0x7f)](sep)?_0x545561:''+_0x545561+sep,_0x1bc16c=_0x472187['endsWith'](sep)?_0x472187:''+_0x472187+sep;return _0x545561===_0x472187||_0x2be1ee[_0x58db5b(0x74)](_0x1bc16c);}export function realOrResolved(_0x4631dd){try{return realpathSync(_0x4631dd);}catch{return resolve(_0x4631dd);}}export function lstatIfPresent(_0x2813cb){try{return lstatSync(_0x2813cb);}catch{return undefined;}}export function writeTextAtomic(_0x306d89,_0x45f772,_0x3c8260){const _0x2450fe=a155_0x5d7c;writeBytesAtomic(_0x306d89,Buffer['from'](_0x45f772,_0x2450fe(0x6f)),_0x3c8260);}function a155_0x58e3(){const _0x4f2a16=['269988OvWhjb','startsWith','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','260ELIWEa','5suJKxD','18822Tpweek','71120cIzFye','5278696HXDTui','1034UTsMIV','30rKQBCs','34452WmWuyE','.tmp','endsWith','split','564uXpWye','validation','utf8','isSymbolicLink','215850wYUuxE','193221vzEBXM'];a155_0x58e3=function(){return _0x4f2a16;};return a155_0x58e3();}export function writeBytesAtomic(_0x1bf446,_0x220235,_0x5e5279){const _0x5b2227=a155_0x5d7c,_0x2cfb29=_0x1bf446+_0x5b2227(0x7e);try{writeFileSync(_0x2cfb29,_0x220235,{'mode':_0x5e5279}),renameSync(_0x2cfb29,_0x1bf446);}catch(_0x1f1ea2){try{rmSync(_0x2cfb29,{'force':!![]});}catch{}throw _0x1f1ea2;}}export function writeJsonAtomic(_0x165ccf,_0xb7bb45){writeTextAtomic(_0x165ccf,JSON['stringify'](_0xb7bb45,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x350ecf,_0x82e2ea){const _0x40ad12=a156_0x26e4,_0x1db443=_0x350ecf();while(!![]){try{const _0x2e38a7=parseInt(_0x40ad12(0x123))/0x1*(-parseInt(_0x40ad12(0x127))/0x2)+parseInt(_0x40ad12(0x125))/0x3*(parseInt(_0x40ad12(0x121))/0x4)+-parseInt(_0x40ad12(0x11a))/0x5+parseInt(_0x40ad12(0x11d))/0x6*(parseInt(_0x40ad12(0x126))/0x7)+-parseInt(_0x40ad12(0x129))/0x8*(-parseInt(_0x40ad12(0x122))/0x9)+parseInt(_0x40ad12(0x11e))/0xa+-parseInt(_0x40ad12(0x11c))/0xb;if(_0x2e38a7===_0x82e2ea)break;else _0x1db443['push'](_0x1db443['shift']());}catch(_0x31f27e){_0x1db443['push'](_0x1db443['shift']());}}}(a156_0x4afa,0x4cd8a));import{createHash}from'node:crypto';function a156_0x4afa(){const _0x1ece8c=['sha256','127395qWJgJA','245KkxXMF','13078GTfmhf','digest','1224240DPJISw','hex','105680uPFPnJ','update','13963543utAcFn','93348uELSuI','5092570eaExbq','path','size','40wlQGMV','9naUAJM','4XXJHaM'];a156_0x4afa=function(){return _0x1ece8c;};return a156_0x4afa();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x4d6328){const _0x429372=a156_0x26e4;return createHash(_0x429372(0x124))[_0x429372(0x11b)](_0x4d6328)[_0x429372(0x128)](_0x429372(0x12a));}export function fileHash(_0x1a6b35){return bufferSha256(fileContent(_0x1a6b35));}function a156_0x26e4(_0x367d18,_0x42f474){_0x367d18=_0x367d18-0x11a;const _0x4afaa0=a156_0x4afa();let _0x26e493=_0x4afaa0[_0x367d18];return _0x26e493;}export function bufferSha256(_0x3b3937){const _0x334cac=a156_0x26e4;return createHash(_0x334cac(0x124))['update'](_0x3b3937)[_0x334cac(0x128)](_0x334cac(0x12a));}export function fileTreeHash(_0x295d2b){const _0x23b060=a156_0x26e4,_0x505a7a=createHash(_0x23b060(0x124));for(const _0x12915e of normalizeManifestFiles(_0x295d2b)){_0x505a7a[_0x23b060(0x11b)](_0x12915e[_0x23b060(0x11f)]),_0x505a7a[_0x23b060(0x11b)]('\x00'),_0x505a7a[_0x23b060(0x11b)](_0x12915e['sha256']),_0x505a7a[_0x23b060(0x11b)]('\x00'),_0x505a7a[_0x23b060(0x11b)](String(_0x12915e[_0x23b060(0x120)])),_0x505a7a[_0x23b060(0x11b)]('\x00');}return _0x505a7a['digest'](_0x23b060(0x12a));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a157_0x3c7b55=a157_0x52f5;(function(_0x48b8c3,_0x4f1618){const _0x49b660=a157_0x52f5,_0x585cb7=_0x48b8c3();while(!![]){try{const _0x8293fc=parseInt(_0x49b660(0x141))/0x1*(parseInt(_0x49b660(0x155))/0x2)+parseInt(_0x49b660(0x151))/0x3*(parseInt(_0x49b660(0x146))/0x4)+-parseInt(_0x49b660(0x152))/0x5*(-parseInt(_0x49b660(0x14b))/0x6)+parseInt(_0x49b660(0x144))/0x7*(parseInt(_0x49b660(0x14a))/0x8)+parseInt(_0x49b660(0x148))/0x9*(parseInt(_0x49b660(0x147))/0xa)+-parseInt(_0x49b660(0x145))/0xb*(-parseInt(_0x49b660(0x143))/0xc)+parseInt(_0x49b660(0x140))/0xd*(-parseInt(_0x49b660(0x154))/0xe);if(_0x8293fc===_0x4f1618)break;else _0x585cb7['push'](_0x585cb7['shift']());}catch(_0x4b61bb){_0x585cb7['push'](_0x585cb7['shift']());}}}(a157_0x4c40,0x9f3df));function a157_0x52f5(_0xa19f15,_0x1d9bf5){_0xa19f15=_0xa19f15-0x140;const _0x4c4042=a157_0x4c40();let _0x52f588=_0x4c4042[_0xa19f15];return _0x52f588;}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x1cd4a9,_0x19ef0e=a157_0x3c7b55(0x14c),_0x4cbad6={}){const _0x81a277=a157_0x3c7b55,_0x1f0717=resolveSkillSyncPaths(_0x4cbad6),_0x48813e=safePathSegment(_0x1cd4a9,_0x81a277(0x14f)),_0x46070a=_0x19ef0e===_0x81a277(0x14d)?[resolve(_0x4cbad6[_0x81a277(0x14e)]??process[_0x81a277(0x14e)](),_0x81a277(0x150),_0x81a277(0x153))]:runtimeAgentSkillRoots(_0x1f0717);return Object[_0x81a277(0x149)]({'scope':_0x19ef0e,'appCode':_0x48813e,'skillRoots':Object[_0x81a277(0x149)](_0x46070a),'managedRoot':_0x1f0717[_0x81a277(0x142)]});}function a157_0x4c40(){const _0x2c0931=['project','cwd','appCode','.agents','325509xkruKF','5560YQZOJy','skills','1506540YScLDk','1120GwaOAM','416FylHkR','22pghCOX','managedRoot','9312vkqPpQ','61411VkWRdO','15092VVTDqd','4gwwHiI','30VFbkLN','3477213fDJESP','freeze','808iMyBTP','4668TTfheQ','global'];a157_0x4c40=function(){return _0x2c0931;};return a157_0x4c40();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a158_0xc4e5(){const _0x524da3=['removed','env','validation','contentHash','scopes','metadata-mismatch','runtime-observe','length','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','external-symlink','706535ynDUtB','10032010DJKvLI','2419298EAfBlL','protectedLinkRoots','name','map','skill','dir','isSymbolicLink','skipped','builtin','398752ISSeUJ','skillCode','trim','157736iovSbM','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','updated','accessKey','managedRoot','personal','activeSkillCodes','has','project','filter','set','11NYJZeh','6VlBdQZ','unchanged','secret-retriever','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','startsWith','isDirectory','get','30GuFqKi','scope','metadataPath','company','587790xYTMmK','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','created','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','push','8wttDYK','values','4644243KcUUYv','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','linked-from-protected-root','appCode','not-managed-symlink','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','slice','pruneSkillCodes','lovrabet'];a158_0xc4e5=function(){return _0x524da3;};return a158_0xc4e5();}const a158_0x3b2664=a158_0x4729;(function(_0xeb3e68,_0x4c237c){const _0x54d5cd=a158_0x4729,_0x2a5709=_0xeb3e68();while(!![]){try{const _0x36da2c=parseInt(_0x54d5cd(0x1fe))/0x1+parseInt(_0x54d5cd(0x1e4))/0x2+parseInt(_0x54d5cd(0x1fa))/0x3*(-parseInt(_0x54d5cd(0x1e7))/0x4)+parseInt(_0x54d5cd(0x1d9))/0x5*(parseInt(_0x54d5cd(0x1f3))/0x6)+parseInt(_0x54d5cd(0x1db))/0x7*(parseInt(_0x54d5cd(0x203))/0x8)+parseInt(_0x54d5cd(0x205))/0x9+parseInt(_0x54d5cd(0x1da))/0xa*(-parseInt(_0x54d5cd(0x1f2))/0xb);if(_0x36da2c===_0x4c237c)break;else _0x2a5709['push'](_0x2a5709['shift']());}catch(_0x4f7610){_0x2a5709['push'](_0x2a5709['shift']());}}}(a158_0xc4e5,0x5fd7d));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0x3faee5 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a158_0x3faee5,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0x3b2664(0x20e),a158_0x3b2664(0x1d5),a158_0x3b2664(0x1f5)]);export function linkEffectiveRuntimeSkills(_0x5ca31a,_0x92ef1c){const _0x386032=a158_0x3b2664,_0x4964b8=new Map();for(const _0x13aacb of _0x5ca31a){const _0x23c912=_0x13aacb[_0x386032(0x1df)][_0x386032(0x1e5)];if(!_0x23c912)continue;const _0x11d819=_0x4964b8[_0x386032(0x1f9)](_0x23c912);(!_0x11d819||_0x13aacb['scope']===_0x386032(0x1ec))&&_0x4964b8[_0x386032(0x1f1)](_0x23c912,_0x13aacb);}const _0x5e3b23=[];for(const _0x353f93 of _0x4964b8[_0x386032(0x204)]()){const _0x3be998=requireSkillCode(_0x353f93[_0x386032(0x1df)]),_0x3e335b=readMetadataIfPresent(_0x353f93[_0x386032(0x1fc)]);if(_0x3e335b?.['appCode']!==_0x92ef1c[_0x386032(0x209)]||_0x3e335b[_0x386032(0x1e5)]!==_0x3be998)throw CliErrors[_0x386032(0x211)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x92ef1c['appCode']+':\x20'+_0x353f93[_0x386032(0x1fc)]);const _0xdf182=runtimeSkillLinkName(_0x92ef1c,_0x3be998);for(const _0x11ae45 of _0x92ef1c['skillRoots']){_0x5e3b23[_0x386032(0x202)](ensureManagedSymlink(resolve(_0x11ae45,_0xdf182),_0x353f93[_0x386032(0x1e0)],_0x92ef1c,_0x3be998));}}return _0x5e3b23;}export function pruneStaleRuntimeSkillLinks(_0x6976d3,_0x1edf17,_0x39d2fc){const _0x235e83=a158_0x3b2664,_0x1c0ce0=new Set([..._0x1edf17][_0x235e83(0x1de)](_0x117e00=>_0x117e00[_0x235e83(0x1e6)]())[_0x235e83(0x1f0)](Boolean)),_0x191663=_0x39d2fc?new Set([..._0x39d2fc][_0x235e83(0x1de)](_0x2b0949=>_0x2b0949['trim']())['filter'](Boolean)):undefined,_0x226466=[];for(const _0x46bf90 of _0x6976d3['skillRoots']){for(const _0x215a19 of managedTargetSkillLinkPaths(_0x46bf90,_0x6976d3)){const _0x53c491=runtimeSkillCodeFromLink(_0x6976d3,_0x215a19);if(_0x191663&&!_0x191663['has'](_0x53c491))continue;if(_0x1c0ce0[_0x235e83(0x1ee)](_0x53c491))continue;_0x226466[_0x235e83(0x202)](removeManagedSkillLink(_0x215a19,_0x6976d3,_0x53c491));}}return _0x226466;}export function pruneStaleRuntimeSkillCache(_0x4d6ac3,_0x1c72a7={}){const _0x279d42=a158_0x3b2664,_0x111e33=new Set([..._0x4d6ac3[_0x279d42(0x1ed)]][_0x279d42(0x1de)](_0x4e8ede=>_0x4e8ede[_0x279d42(0x1e6)]())[_0x279d42(0x1f0)](Boolean)),_0x43e11b=_0x4d6ac3[_0x279d42(0x20d)]?new Set([..._0x4d6ac3[_0x279d42(0x20d)]][_0x279d42(0x1de)](_0x4bce98=>_0x4bce98['trim']())[_0x279d42(0x1f0)](Boolean)):undefined,_0x2fe2ee=_0x4d6ac3[_0x279d42(0x1d3)]??[_0x279d42(0x1ec),_0x279d42(0x1fd)],_0x45b105=resolve(getRuntimeSkillCacheRoot(_0x4d6ac3[_0x279d42(0x210)],_0x4d6ac3[_0x279d42(0x1ea)],_0x1c72a7),safePathSegment(_0x4d6ac3[_0x279d42(0x209)],_0x279d42(0x209))),_0x1d49c1=[];for(const _0x4d05a9 of _0x2fe2ee){const _0x517f9e=resolve(_0x45b105,_0x4d05a9);if(!existsSync(_0x517f9e))continue;for(const _0x452480 of readdirSync(_0x517f9e,{'withFileTypes':!![]})){if(!_0x452480[_0x279d42(0x1f8)]())continue;const _0xcadc1e=_0x452480['name'];if(_0x43e11b&&!_0x43e11b[_0x279d42(0x1ee)](_0xcadc1e))continue;if(_0x111e33['has'](_0xcadc1e))continue;const _0x43572f=resolve(_0x517f9e,_0xcadc1e),_0x173321=readMetadataIfPresent(resolve(_0x43572f,METADATA_FILE));if(_0x173321?.['appCode']!==_0x4d6ac3[_0x279d42(0x209)]||_0x173321[_0x279d42(0x1fb)]!==_0x4d05a9||_0x173321[_0x279d42(0x1e5)]!==_0xcadc1e){_0x1d49c1['push']({'path':_0x43572f,'action':_0x279d42(0x1e2),'reason':_0x279d42(0x1d4)});continue;}if(isLinkedFromAnyRoot(_0x43572f,_0x4d6ac3[_0x279d42(0x1dc)]??[])){_0x1d49c1[_0x279d42(0x202)]({'path':_0x43572f,'action':_0x279d42(0x1e2),'reason':_0x279d42(0x208)});continue;}removeSync(_0x43572f),_0x1d49c1[_0x279d42(0x202)]({'path':_0x43572f,'action':_0x279d42(0x20f)});}}return _0x1d49c1;}function a158_0x4729(_0x14f71c,_0x3e3241){_0x14f71c=_0x14f71c-0x1d3;const _0xc4e573=a158_0xc4e5();let _0x4729b5=_0xc4e573[_0x14f71c];return _0x4729b5;}export function linkGlobalRuntimeSkills(_0x1c9ecd,_0x3a8e11={}){const _0x56a6bc=a158_0x3b2664,_0x29dd39=resolveSkillSyncPaths(_0x3a8e11),_0x5ff89e=[];for(const _0x4bd444 of _0x1c9ecd){if(_0x4bd444['scope']!==_0x56a6bc(0x1e3))throw CliErrors[_0x56a6bc(0x211)](_0x56a6bc(0x207)+_0x4bd444[_0x56a6bc(0x1fb)]);const _0x4c426a=requireSkillCode(_0x4bd444[_0x56a6bc(0x1df)]),_0x9d42cc=copyManagedSkillDirectory(_0x4bd444[_0x56a6bc(0x1e0)],resolve(_0x29dd39['agentsSkillsDir'],_0x4c426a));_0x5ff89e[_0x56a6bc(0x202)]({..._0x9d42cc,'contentHash':_0x4bd444[_0x56a6bc(0x212)]});}return _0x5ff89e;}function ensureManagedSymlink(_0x4900ff,_0x22d578,_0x42b977,_0x5e5afb){const _0x1a3d08=a158_0x3b2664;mkdirSync(dirname(_0x4900ff),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4900ff)||isDanglingSymlink(_0x4900ff)){const _0x6765c=lstatSync(_0x4900ff);if(!_0x6765c['isSymbolicLink']())throw CliErrors[_0x1a3d08(0x211)](_0x1a3d08(0x206)+_0x4900ff);const _0x597ee0=resolveSymlinkTarget(_0x4900ff);if(!isPathInside(realOrResolved(_0x597ee0),realOrResolved(_0x42b977[_0x1a3d08(0x1eb)])))throw CliErrors['validation'](_0x1a3d08(0x1f6)+_0x4900ff);if(realOrResolved(_0x597ee0)===realOrResolved(_0x22d578))return{'path':_0x4900ff,'target':_0x22d578,'action':_0x1a3d08(0x1f4)};const _0x4d8a8d=readMetadataIfPresent(resolve(_0x597ee0,METADATA_FILE));if(_0x42b977['scope']===_0x1a3d08(0x1ef)&&(_0x4d8a8d?.[_0x1a3d08(0x209)]!==_0x42b977[_0x1a3d08(0x209)]||_0x4d8a8d[_0x1a3d08(0x1e5)]!==_0x5e5afb))throw CliErrors['validation'](_0x1a3d08(0x1d7)+_0x4900ff);return unlinkSync(_0x4900ff),symlinkSync(_0x22d578,_0x4900ff,_0x1a3d08(0x1e0)),{'path':_0x4900ff,'target':_0x22d578,'action':_0x1a3d08(0x1e9)};}return symlinkSync(_0x22d578,_0x4900ff,_0x1a3d08(0x1e0)),{'path':_0x4900ff,'target':_0x22d578,'action':_0x1a3d08(0x200)};}function managedTargetSkillLinkPaths(_0x6570f2,_0x28e593){const _0xdafe16=a158_0x3b2664;if(!existsSync(_0x6570f2))return[];const _0x443e2f=_0x28e593[_0xdafe16(0x209)]+'--';return readdirSync(_0x6570f2,{'withFileTypes':!![]})[_0xdafe16(0x1f0)](_0x27dd6d=>_0x28e593[_0xdafe16(0x1fb)]==='project'||_0x27dd6d['name'][_0xdafe16(0x1f7)](_0x443e2f))[_0xdafe16(0x1de)](_0x58f86b=>resolve(_0x6570f2,_0x58f86b[_0xdafe16(0x1dd)]));}function removeManagedSkillLink(_0x59b3a9,_0x27ba1d,_0x8ce7e9){const _0x261ad8=a158_0x3b2664,_0x5dcdb4=lstatIfPresent(_0x59b3a9);if(!_0x5dcdb4?.[_0x261ad8(0x1e1)]())return{'path':_0x59b3a9,'action':_0x261ad8(0x1e2),'reason':_0x261ad8(0x20a)};const _0x186622=resolveSymlinkTarget(_0x59b3a9);if(!isPathInside(realOrResolved(_0x186622),realOrResolved(_0x27ba1d[_0x261ad8(0x1eb)])))return{'path':_0x59b3a9,'action':_0x261ad8(0x1e2),'reason':_0x261ad8(0x1d8)};const _0x49e342=readMetadataIfPresent(resolve(_0x186622,METADATA_FILE));if(_0x27ba1d['scope']===_0x261ad8(0x1ef)&&(_0x49e342?.[_0x261ad8(0x209)]!==_0x27ba1d[_0x261ad8(0x209)]||_0x49e342[_0x261ad8(0x1e5)]!==_0x8ce7e9))return{'path':_0x59b3a9,'action':_0x261ad8(0x1e2),'reason':'metadata-mismatch'};return unlinkSync(_0x59b3a9),{'path':_0x59b3a9,'action':'removed'};}function isLinkedFromAnyRoot(_0x1636a1,_0x1e114f){const _0x1e82aa=a158_0x3b2664,_0x37d0a8=realOrResolved(_0x1636a1);for(const _0x1f9b06 of _0x1e114f){if(!existsSync(_0x1f9b06))continue;for(const _0xfae34f of readdirSync(_0x1f9b06,{'withFileTypes':!![]})){if(!_0xfae34f[_0x1e82aa(0x1e1)]())continue;const _0x5cf459=resolve(_0x1f9b06,_0xfae34f[_0x1e82aa(0x1dd)]);if(realOrResolved(resolveSymlinkTarget(_0x5cf459))===_0x37d0a8)return!![];}}return![];}function runtimeSkillLinkName(_0x197339,_0xb8f528){const _0x331d22=a158_0x3b2664,_0x57e6e1=safePathSegment(_0xb8f528,'skillCode');if(_0x197339['scope']===_0x331d22(0x1ef)&&RESERVED_PROJECT_SKILL_CODES[_0x331d22(0x1ee)](_0x57e6e1))throw CliErrors[_0x331d22(0x211)](_0x331d22(0x1e8)+_0x57e6e1);return _0x197339[_0x331d22(0x1fb)]===_0x331d22(0x1ef)?_0x57e6e1:_0x197339[_0x331d22(0x209)]+'--'+_0x57e6e1;}function runtimeSkillCodeFromLink(_0x248da8,_0x448d78){const _0x31839f=a158_0x3b2664,_0x1848d3=basename(_0x448d78);return _0x248da8['scope']===_0x31839f(0x1ef)?_0x1848d3:_0x1848d3[_0x31839f(0x20c)]((_0x248da8[_0x31839f(0x209)]+'--')[_0x31839f(0x1d6)]);}export function copyManagedSkillDirectory(_0x1f6f5f,_0x59d717){const _0xb09e93=a158_0x3b2664,_0xb5b8af=resolve(_0x59d717,METADATA_FILE),_0x53e362=existsSync(_0x59d717);if(_0x53e362){const _0x19ceba=lstatSync(_0x59d717);if(_0x19ceba[_0xb09e93(0x1e1)]())throw CliErrors['validation'](_0xb09e93(0x201)+_0x59d717);if(!_0x19ceba[_0xb09e93(0x1f8)]())throw CliErrors[_0xb09e93(0x211)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x59d717);const _0x1da3e4=readMetadataIfPresent(_0xb5b8af);if(_0x1da3e4?.['scope']!==_0xb09e93(0x1e3))throw CliErrors[_0xb09e93(0x211)](_0xb09e93(0x1ff)+_0x59d717);}ensureDirSync(dirname(_0x59d717));const _0x2ccda6=_0x53e362?readMetadataIfPresent(_0xb5b8af)?.[_0xb09e93(0x212)]:undefined,_0x5e1caa=readMetadataIfPresent(resolve(_0x1f6f5f,METADATA_FILE))?.[_0xb09e93(0x212)];return _0x53e362&&removeSync(_0x59d717),copySkillDirectory(_0x1f6f5f,_0x59d717),{'path':_0x59d717,'target':_0x1f6f5f,'action':!_0x53e362?_0xb09e93(0x200):_0x2ccda6===_0x5e1caa?_0xb09e93(0x1f4):_0xb09e93(0x1e9)};}function copySkillDirectory(_0x41ff80,_0x161cf7){copySync(_0x41ff80,_0x161cf7,{'dereference':![],'overwrite':!![],'filter'(_0x49d17d){const _0x1533ab=a158_0x4729;if(lstatSync(_0x49d17d)[_0x1533ab(0x1e1)]())throw CliErrors[_0x1533ab(0x211)](_0x1533ab(0x20b)+_0x49d17d);return!![];}});}
|
|
1
|
+
const a158_0x165bc1=a158_0x5f47;(function(_0xe987fb,_0x179421){const _0x266935=a158_0x5f47,_0x5f4221=_0xe987fb();while(!![]){try{const _0x105bb0=parseInt(_0x266935(0x18d))/0x1*(-parseInt(_0x266935(0x19c))/0x2)+parseInt(_0x266935(0x19a))/0x3*(parseInt(_0x266935(0x1a5))/0x4)+parseInt(_0x266935(0x17d))/0x5*(-parseInt(_0x266935(0x178))/0x6)+parseInt(_0x266935(0x198))/0x7*(-parseInt(_0x266935(0x1a2))/0x8)+parseInt(_0x266935(0x193))/0x9+parseInt(_0x266935(0x18e))/0xa*(-parseInt(_0x266935(0x184))/0xb)+parseInt(_0x266935(0x195))/0xc;if(_0x105bb0===_0x179421)break;else _0x5f4221['push'](_0x5f4221['shift']());}catch(_0xab6562){_0x5f4221['push'](_0x5f4221['shift']());}}}(a158_0x14fa,0x6e6a5));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0x46e25e from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a158_0x46e25e,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0x165bc1(0x196),'runtime-observe',a158_0x165bc1(0x176)]);export function linkEffectiveRuntimeSkills(_0x3eb87c,_0x41ce90){const _0x4f82ff=a158_0x165bc1,_0x46cfb2=new Map();for(const _0x844976 of _0x3eb87c){const _0x41e6ec=_0x844976[_0x4f82ff(0x17c)]['skillCode'];if(!_0x41e6ec)continue;const _0x396a9a=_0x46cfb2[_0x4f82ff(0x197)](_0x41e6ec);(!_0x396a9a||_0x844976['scope']===_0x4f82ff(0x171))&&_0x46cfb2[_0x4f82ff(0x17e)](_0x41e6ec,_0x844976);}const _0x20d342=[];for(const _0x1e968c of _0x46cfb2[_0x4f82ff(0x16c)]()){const _0x75ee5d=requireSkillCode(_0x1e968c[_0x4f82ff(0x17c)]),_0x51783b=readMetadataIfPresent(_0x1e968c[_0x4f82ff(0x18f)]);if(_0x51783b?.[_0x4f82ff(0x16e)]!==_0x41ce90[_0x4f82ff(0x16e)]||_0x51783b[_0x4f82ff(0x1a3)]!==_0x75ee5d)throw CliErrors[_0x4f82ff(0x19f)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x41ce90['appCode']+':\x20'+_0x1e968c[_0x4f82ff(0x18f)]);const _0x56d5c5=runtimeSkillLinkName(_0x41ce90,_0x75ee5d);for(const _0x27293e of _0x41ce90[_0x4f82ff(0x1a1)]){_0x20d342[_0x4f82ff(0x16a)](ensureManagedSymlink(resolve(_0x27293e,_0x56d5c5),_0x1e968c[_0x4f82ff(0x182)],_0x41ce90,_0x75ee5d));}}return _0x20d342;}export function pruneStaleRuntimeSkillLinks(_0x2d38e4,_0xcd7b47,_0x29bbe6){const _0x34db47=a158_0x165bc1,_0x51ea77=new Set([..._0xcd7b47][_0x34db47(0x18c)](_0x987165=>_0x987165[_0x34db47(0x172)]())['filter'](Boolean)),_0x221fa9=_0x29bbe6?new Set([..._0x29bbe6][_0x34db47(0x18c)](_0x1c6786=>_0x1c6786[_0x34db47(0x172)]())[_0x34db47(0x1a0)](Boolean)):undefined,_0x4e0dae=[];for(const _0x306fc5 of _0x2d38e4['skillRoots']){for(const _0x51e7e3 of managedTargetSkillLinkPaths(_0x306fc5,_0x2d38e4)){const _0x4fb5d6=runtimeSkillCodeFromLink(_0x2d38e4,_0x51e7e3);if(_0x221fa9&&!_0x221fa9[_0x34db47(0x180)](_0x4fb5d6))continue;if(_0x51ea77[_0x34db47(0x180)](_0x4fb5d6))continue;_0x4e0dae[_0x34db47(0x16a)](removeManagedSkillLink(_0x51e7e3,_0x2d38e4,_0x4fb5d6));}}return _0x4e0dae;}export function pruneStaleRuntimeSkillCache(_0x3f6510,_0x1f3f33={}){const _0x23fc70=a158_0x165bc1,_0x40df8d=new Set([..._0x3f6510[_0x23fc70(0x16d)]][_0x23fc70(0x18c)](_0xc9b878=>_0xc9b878[_0x23fc70(0x172)]())[_0x23fc70(0x1a0)](Boolean)),_0x38fb9e=_0x3f6510[_0x23fc70(0x170)]?new Set([..._0x3f6510['pruneSkillCodes']][_0x23fc70(0x18c)](_0x555854=>_0x555854[_0x23fc70(0x172)]())[_0x23fc70(0x1a0)](Boolean)):undefined,_0x41777d=_0x3f6510[_0x23fc70(0x181)]??[_0x23fc70(0x171),_0x23fc70(0x183)],_0xdd5e2=resolve(getRuntimeSkillCacheRoot(_0x3f6510[_0x23fc70(0x179)],_0x3f6510[_0x23fc70(0x18a)],_0x1f3f33),safePathSegment(_0x3f6510[_0x23fc70(0x16e)],_0x23fc70(0x16e))),_0x319171=[];for(const _0x22c067 of _0x41777d){const _0x178efb=resolve(_0xdd5e2,_0x22c067);if(!existsSync(_0x178efb))continue;for(const _0x379f33 of readdirSync(_0x178efb,{'withFileTypes':!![]})){if(!_0x379f33['isDirectory']())continue;const _0x480e73=_0x379f33[_0x23fc70(0x175)];if(_0x38fb9e&&!_0x38fb9e[_0x23fc70(0x180)](_0x480e73))continue;if(_0x40df8d[_0x23fc70(0x180)](_0x480e73))continue;const _0x5a630b=resolve(_0x178efb,_0x480e73),_0x2f352c=readMetadataIfPresent(resolve(_0x5a630b,METADATA_FILE));if(_0x2f352c?.[_0x23fc70(0x16e)]!==_0x3f6510[_0x23fc70(0x16e)]||_0x2f352c[_0x23fc70(0x19d)]!==_0x22c067||_0x2f352c['skillCode']!==_0x480e73){_0x319171[_0x23fc70(0x16a)]({'path':_0x5a630b,'action':_0x23fc70(0x17a),'reason':_0x23fc70(0x189)});continue;}if(isLinkedFromAnyRoot(_0x5a630b,_0x3f6510[_0x23fc70(0x169)]??[])){_0x319171[_0x23fc70(0x16a)]({'path':_0x5a630b,'action':_0x23fc70(0x17a),'reason':_0x23fc70(0x173)});continue;}removeSync(_0x5a630b),_0x319171[_0x23fc70(0x16a)]({'path':_0x5a630b,'action':'removed'});}}return _0x319171;}export function linkGlobalRuntimeSkills(_0x3d3f50,_0x51b174={}){const _0x491cf3=a158_0x165bc1,_0x57eb11=resolveSkillSyncPaths(_0x51b174),_0x49e907=[];for(const _0x272bb4 of _0x3d3f50){if(_0x272bb4[_0x491cf3(0x19d)]!==_0x491cf3(0x16f))throw CliErrors['validation'](_0x491cf3(0x18b)+_0x272bb4[_0x491cf3(0x19d)]);const _0x480837=requireSkillCode(_0x272bb4[_0x491cf3(0x17c)]),_0x272a02=copyManagedSkillDirectory(_0x272bb4[_0x491cf3(0x182)],resolve(_0x57eb11['agentsSkillsDir'],_0x480837));_0x49e907[_0x491cf3(0x16a)]({..._0x272a02,'contentHash':_0x272bb4[_0x491cf3(0x199)]});}return _0x49e907;}function ensureManagedSymlink(_0x4a1a7a,_0x36b97a,_0x34dcbb,_0x4cb185){const _0x4d2e2a=a158_0x165bc1;mkdirSync(dirname(_0x4a1a7a),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4a1a7a)||isDanglingSymlink(_0x4a1a7a)){const _0x5c8f7c=lstatSync(_0x4a1a7a);if(!_0x5c8f7c[_0x4d2e2a(0x177)]())throw CliErrors[_0x4d2e2a(0x19f)](_0x4d2e2a(0x194)+_0x4a1a7a);const _0x50cb4e=resolveSymlinkTarget(_0x4a1a7a);if(!isPathInside(realOrResolved(_0x50cb4e),realOrResolved(_0x34dcbb[_0x4d2e2a(0x19e)])))throw CliErrors[_0x4d2e2a(0x19f)](_0x4d2e2a(0x186)+_0x4a1a7a);if(realOrResolved(_0x50cb4e)===realOrResolved(_0x36b97a))return{'path':_0x4a1a7a,'target':_0x36b97a,'action':'unchanged'};const _0x4a32f9=readMetadataIfPresent(resolve(_0x50cb4e,METADATA_FILE));if(_0x34dcbb['scope']===_0x4d2e2a(0x190)&&(_0x4a32f9?.[_0x4d2e2a(0x16e)]!==_0x34dcbb['appCode']||_0x4a32f9[_0x4d2e2a(0x1a3)]!==_0x4cb185))throw CliErrors[_0x4d2e2a(0x19f)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x4a1a7a);return unlinkSync(_0x4a1a7a),symlinkSync(_0x36b97a,_0x4a1a7a,'dir'),{'path':_0x4a1a7a,'target':_0x36b97a,'action':'updated'};}return symlinkSync(_0x36b97a,_0x4a1a7a,'dir'),{'path':_0x4a1a7a,'target':_0x36b97a,'action':_0x4d2e2a(0x16b)};}function managedTargetSkillLinkPaths(_0x2eaa3c,_0x17fc4a){const _0x46b552=a158_0x165bc1;if(!existsSync(_0x2eaa3c))return[];const _0xdf6e6b=_0x17fc4a[_0x46b552(0x16e)]+'--';return readdirSync(_0x2eaa3c,{'withFileTypes':!![]})[_0x46b552(0x1a0)](_0x9f6dc5=>_0x17fc4a[_0x46b552(0x19d)]===_0x46b552(0x190)||_0x9f6dc5[_0x46b552(0x175)][_0x46b552(0x174)](_0xdf6e6b))['map'](_0x394253=>resolve(_0x2eaa3c,_0x394253[_0x46b552(0x175)]));}function removeManagedSkillLink(_0x6e754d,_0x4ee00b,_0x2e7046){const _0x3b317c=a158_0x165bc1,_0x119d19=lstatIfPresent(_0x6e754d);if(!_0x119d19?.[_0x3b317c(0x177)]())return{'path':_0x6e754d,'action':_0x3b317c(0x17a),'reason':_0x3b317c(0x1a4)};const _0x3d4489=resolveSymlinkTarget(_0x6e754d);if(!isPathInside(realOrResolved(_0x3d4489),realOrResolved(_0x4ee00b[_0x3b317c(0x19e)])))return{'path':_0x6e754d,'action':_0x3b317c(0x17a),'reason':'external-symlink'};const _0x4e05b4=readMetadataIfPresent(resolve(_0x3d4489,METADATA_FILE));if(_0x4ee00b[_0x3b317c(0x19d)]===_0x3b317c(0x190)&&(_0x4e05b4?.[_0x3b317c(0x16e)]!==_0x4ee00b[_0x3b317c(0x16e)]||_0x4e05b4[_0x3b317c(0x1a3)]!==_0x2e7046))return{'path':_0x6e754d,'action':_0x3b317c(0x17a),'reason':_0x3b317c(0x189)};return unlinkSync(_0x6e754d),{'path':_0x6e754d,'action':_0x3b317c(0x168)};}function a158_0x14fa(){const _0x1cccc3=['15015600zZhYBT','lovrabet','get','25739rAxSer','contentHash','9LBNiRt','updated','2JsAhmr','scope','managedRoot','validation','filter','skillRoots','688oKpvlO','skillCode','not-managed-symlink','841660VwCrja','removed','protectedLinkRoots','push','created','values','activeSkillCodes','appCode','builtin','pruneSkillCodes','personal','trim','linked-from-protected-root','startsWith','name','secret-retriever','isSymbolicLink','30UBGsLi','env','skipped','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','skill','198130jflblQ','set','length','has','scopes','dir','company','311883xLmbky','slice','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','metadata-mismatch','accessKey','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','map','775274zRWWiH','140BtKZRU','metadataPath','project','unchanged','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','2306556eqCweB','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'];a158_0x14fa=function(){return _0x1cccc3;};return a158_0x14fa();}function isLinkedFromAnyRoot(_0xeee44a,_0x516f93){const _0x29d832=a158_0x165bc1,_0x590560=realOrResolved(_0xeee44a);for(const _0x4febaf of _0x516f93){if(!existsSync(_0x4febaf))continue;for(const _0x4b3caf of readdirSync(_0x4febaf,{'withFileTypes':!![]})){if(!_0x4b3caf['isSymbolicLink']())continue;const _0x19187b=resolve(_0x4febaf,_0x4b3caf[_0x29d832(0x175)]);if(realOrResolved(resolveSymlinkTarget(_0x19187b))===_0x590560)return!![];}}return![];}function runtimeSkillLinkName(_0x2fd6d3,_0xd57143){const _0x20cfa7=a158_0x165bc1,_0x27d267=safePathSegment(_0xd57143,_0x20cfa7(0x1a3));if(_0x2fd6d3[_0x20cfa7(0x19d)]===_0x20cfa7(0x190)&&RESERVED_PROJECT_SKILL_CODES[_0x20cfa7(0x180)](_0x27d267))throw CliErrors[_0x20cfa7(0x19f)](_0x20cfa7(0x192)+_0x27d267);return _0x2fd6d3[_0x20cfa7(0x19d)]===_0x20cfa7(0x190)?_0x27d267:_0x2fd6d3[_0x20cfa7(0x16e)]+'--'+_0x27d267;}function runtimeSkillCodeFromLink(_0x475150,_0x49c649){const _0x4a233b=a158_0x165bc1,_0x31e6bb=basename(_0x49c649);return _0x475150['scope']===_0x4a233b(0x190)?_0x31e6bb:_0x31e6bb[_0x4a233b(0x185)]((_0x475150[_0x4a233b(0x16e)]+'--')[_0x4a233b(0x17f)]);}function a158_0x5f47(_0x185999,_0x27e337){_0x185999=_0x185999-0x168;const _0x14fa4d=a158_0x14fa();let _0x5f4718=_0x14fa4d[_0x185999];return _0x5f4718;}export function copyManagedSkillDirectory(_0x3d39a9,_0x24144b){const _0x3e1333=a158_0x165bc1,_0x3be3c8=resolve(_0x24144b,METADATA_FILE),_0x32cc78=existsSync(_0x24144b);if(_0x32cc78){const _0x43d421=lstatSync(_0x24144b);if(_0x43d421[_0x3e1333(0x177)]())throw CliErrors[_0x3e1333(0x19f)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x24144b);if(!_0x43d421['isDirectory']())throw CliErrors[_0x3e1333(0x19f)](_0x3e1333(0x187)+_0x24144b);const _0x3d4c42=readMetadataIfPresent(_0x3be3c8);if(_0x3d4c42?.[_0x3e1333(0x19d)]!==_0x3e1333(0x16f))throw CliErrors[_0x3e1333(0x19f)](_0x3e1333(0x188)+_0x24144b);}ensureDirSync(dirname(_0x24144b));const _0x5b1939=_0x32cc78?readMetadataIfPresent(_0x3be3c8)?.[_0x3e1333(0x199)]:undefined,_0x5519ee=readMetadataIfPresent(resolve(_0x3d39a9,METADATA_FILE))?.[_0x3e1333(0x199)];return _0x32cc78&&removeSync(_0x24144b),copySkillDirectory(_0x3d39a9,_0x24144b),{'path':_0x24144b,'target':_0x3d39a9,'action':!_0x32cc78?'created':_0x5b1939===_0x5519ee?_0x3e1333(0x191):_0x3e1333(0x19b)};}function copySkillDirectory(_0x10c989,_0x2fd74d){copySync(_0x10c989,_0x2fd74d,{'dereference':![],'overwrite':!![],'filter'(_0x3ca233){const _0x1c7a05=a158_0x5f47;if(lstatSync(_0x3ca233)[_0x1c7a05(0x177)]())throw CliErrors[_0x1c7a05(0x19f)](_0x1c7a05(0x17b)+_0x3ca233);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa687e8,_0x21ea73){const _0x24c8d7=a159_0xfced,_0x50a593=_0xa687e8();while(!![]){try{const _0x14ba08=parseInt(_0x24c8d7(0x1a7))/0x1*(parseInt(_0x24c8d7(0x189))/0x2)+-parseInt(_0x24c8d7(0x1a5))/0x3+-parseInt(_0x24c8d7(0x181))/0x4*(parseInt(_0x24c8d7(0x19c))/0x5)+parseInt(_0x24c8d7(0x187))/0x6+-parseInt(_0x24c8d7(0x191))/0x7*(parseInt(_0x24c8d7(0x193))/0x8)+-parseInt(_0x24c8d7(0x185))/0x9+parseInt(_0x24c8d7(0x194))/0xa;if(_0x14ba08===_0x21ea73)break;else _0x50a593['push'](_0x50a593['shift']());}catch(_0x4294d5){_0x50a593['push'](_0x50a593['shift']());}}}(a159_0x29a3,0x59fc5));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';function a159_0xfced(_0x4e9e1e,_0x2175fd){_0x4e9e1e=_0x4e9e1e-0x181;const _0x29a3df=a159_0x29a3();let _0xfced1c=_0x29a3df[_0x4e9e1e];return _0xfced1c;}function a159_0x29a3(){const _0x53600b=['get','1731990WgoRzh','skillRoots','13590mRlSXP','localeCompare','accessKey','dir','filter','tags','appCode','builtin','1402583MGITCm','name','8nMoukw','18525400okdALb','skillCode','isSymbolicLink','code','cache','push','validation','isDirectory','937295AaNXzK','sort','set','source','\x20!=\x20','env','linkedPaths','map','cacheDir','2063427gIpWfu','local','26GlHrCR','trim','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','linkedPath','scope','isArray','skillMdPath','12ttVqBn','link','values','has','4488651ZZQJsW'];a159_0x29a3=function(){return _0x53600b;};return a159_0x29a3();}export function listLocalRuntimeSkills(_0x1a93c8,_0xf921d1,_0x2b2137={}){const _0x2731aa=a159_0xfced,_0xa84b5b=safePathSegment(_0x1a93c8['appCode'],'appCode');if(_0xf921d1[_0x2731aa(0x18f)]!==_0xa84b5b)throw CliErrors[_0x2731aa(0x19a)](_0x2731aa(0x1a9)+_0xf921d1[_0x2731aa(0x18f)]+_0x2731aa(0x1a0)+_0xa84b5b);const _0x66e532=normalizeRuntimeSkillScopes(_0x1a93c8['scopes']),_0x3c9cc7=new Set(_0x66e532),_0x50ed22=_0x1a93c8['code']?.[_0x2731aa(0x1a8)](),_0x194bdd=new Map(),_0x214b9e=resolve(getRuntimeSkillCacheRoot(_0x1a93c8[_0x2731aa(0x1a1)],_0x1a93c8[_0x2731aa(0x18b)],_0x2b2137),_0xa84b5b);for(const _0x59134a of _0x66e532){for(const _0xc362d1 of localSkillEntryDirs(resolve(_0x214b9e,_0x59134a))){collectLocalRuntimeSkill(_0x194bdd,_0xc362d1,{'appCode':_0xa84b5b,'scopes':_0x3c9cc7,'code':_0x50ed22,'source':_0x2731aa(0x198)});}}for(const _0x4fad90 of _0xf921d1[_0x2731aa(0x188)]){for(const _0x3c27d8 of localSkillLinkCandidates(_0x4fad90,_0xf921d1,_0x3c9cc7)){collectLocalRuntimeSkill(_0x194bdd,_0x3c27d8,{'appCode':_0xa84b5b,'scopes':_0x3c9cc7,'code':_0x50ed22,'source':_0x2731aa(0x182),'linkedPath':_0x3c27d8});}}return Array['from'](_0x194bdd[_0x2731aa(0x183)]())[_0x2731aa(0x19d)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x35521c){const _0x5514fb=a159_0xfced;if(!existsSync(_0x35521c))return[];return readdirSync(_0x35521c,{'withFileTypes':!![]})[_0x5514fb(0x18d)](_0x5e7d38=>_0x5e7d38['isDirectory']()||_0x5e7d38[_0x5514fb(0x196)]())[_0x5514fb(0x1a3)](_0x1f1d27=>resolve(_0x35521c,_0x1f1d27[_0x5514fb(0x192)]));}function localSkillLinkCandidates(_0x574965,_0x43b07f,_0xafa960){const _0x54178e=a159_0xfced;if(!existsSync(_0x574965))return[];const _0x52d56b=_0x43b07f[_0x54178e(0x18f)]+'--';return readdirSync(_0x574965,{'withFileTypes':!![]})[_0x54178e(0x18d)](_0x2b92e9=>_0x2b92e9[_0x54178e(0x19b)]()||_0x2b92e9[_0x54178e(0x196)]())[_0x54178e(0x18d)](_0xf238a1=>_0x43b07f[_0x54178e(0x1ab)]==='project'||_0xf238a1[_0x54178e(0x192)]['startsWith'](_0x52d56b)||_0xafa960[_0x54178e(0x184)](_0x54178e(0x190)))['map'](_0x2572ce=>resolve(_0x574965,_0x2572ce[_0x54178e(0x192)]));}function collectLocalRuntimeSkill(_0x5a9e9c,_0x4baf39,_0x414105){const _0x224a12=a159_0xfced,_0x3a8a35=resolve(_0x4baf39,METADATA_FILE),_0x1f12fd=readMetadataIfPresent(_0x3a8a35);if(!_0x1f12fd)return;if(_0x1f12fd[_0x224a12(0x18f)]!==_0x414105[_0x224a12(0x18f)])return;if(!isRuntimeSkillScope(_0x1f12fd[_0x224a12(0x1ab)])||!_0x414105['scopes'][_0x224a12(0x184)](_0x1f12fd[_0x224a12(0x1ab)]))return;const _0x4f6642=_0x1f12fd[_0x224a12(0x195)]?.[_0x224a12(0x1a8)]();if(!_0x4f6642)return;if(_0x414105[_0x224a12(0x197)]&&_0x4f6642!==_0x414105[_0x224a12(0x197)])return;const _0x67ea14=_0x1f12fd[_0x224a12(0x1ab)]+':'+_0x4f6642,_0x3535f2=_0x414105['linkedPath']?[_0x414105[_0x224a12(0x1aa)]]:[],_0x4b8d12=_0x5a9e9c[_0x224a12(0x186)](_0x67ea14);if(_0x4b8d12){_0x414105['source']===_0x224a12(0x198)&&(_0x4b8d12['dir']=_0x4baf39,_0x4b8d12[_0x224a12(0x1a4)]=_0x4baf39,_0x4b8d12[_0x224a12(0x1ad)]=resolve(_0x4baf39,SKILL_FILE),_0x4b8d12['metadataPath']=_0x3a8a35);for(const _0xc20eaa of _0x3535f2){!_0x4b8d12[_0x224a12(0x1a2)]['includes'](_0xc20eaa)&&_0x4b8d12[_0x224a12(0x1a2)][_0x224a12(0x199)](_0xc20eaa);}_0x4b8d12[_0x224a12(0x1a2)][_0x224a12(0x19d)]();return;}_0x5a9e9c[_0x224a12(0x19e)](_0x67ea14,{..._0x1f12fd,'tags':Array[_0x224a12(0x1ac)](_0x1f12fd[_0x224a12(0x18e)])?_0x1f12fd[_0x224a12(0x18e)]:[],'scope':_0x1f12fd[_0x224a12(0x1ab)],'source':_0x224a12(0x1a6),'dir':_0x4baf39,'cacheDir':_0x414105[_0x224a12(0x19f)]===_0x224a12(0x198)?_0x4baf39:undefined,'skillMdPath':resolve(_0x4baf39,SKILL_FILE),'metadataPath':_0x3a8a35,'linkedPaths':_0x3535f2});}function compareLocalRuntimeSkills(_0x25dc44,_0x501e85){const _0x4d1259=a159_0xfced,_0x53e9cb={'personal':0x0,'company':0x1,'builtin':0x2};return _0x53e9cb[_0x25dc44[_0x4d1259(0x1ab)]]-_0x53e9cb[_0x501e85[_0x4d1259(0x1ab)]]||_0x25dc44['skillCode'][_0x4d1259(0x18a)](_0x501e85[_0x4d1259(0x195)])||_0x25dc44['dir'][_0x4d1259(0x18a)](_0x501e85[_0x4d1259(0x18c)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5ed91e,_0x1e51ea){const _0x155fa4=a160_0x4d19,_0x3632ec=_0x5ed91e();while(!![]){try{const _0x2aeac1=parseInt(_0x155fa4(0xf1))/0x1*(-parseInt(_0x155fa4(0xf7))/0x2)+parseInt(_0x155fa4(0x104))/0x3*(parseInt(_0x155fa4(0x101))/0x4)+-parseInt(_0x155fa4(0x11a))/0x5+parseInt(_0x155fa4(0x119))/0x6*(-parseInt(_0x155fa4(0x115))/0x7)+-parseInt(_0x155fa4(0x11b))/0x8+-parseInt(_0x155fa4(0xf9))/0x9*(parseInt(_0x155fa4(0xf4))/0xa)+parseInt(_0x155fa4(0x10b))/0xb*(parseInt(_0x155fa4(0xee))/0xc);if(_0x2aeac1===_0x1e51ea)break;else _0x3632ec['push'](_0x3632ec['shift']());}catch(_0x4f0d08){_0x3632ec['push'](_0x3632ec['shift']());}}}(a160_0x6ca6,0xf2df2));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x229319){const _0x502c1f=a160_0x4d19;return _0x229319[_0x502c1f(0x109)]??Buffer['from'](_0x229319['content']??'',_0x502c1f(0x110));}export function fileText(_0x25384b){const _0x49eec4=a160_0x4d19;return fileContent(_0x25384b)[_0x49eec4(0x11d)](_0x49eec4(0x110));}function a160_0x6ca6(){const _0x31563b=['trim','compare','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','string','isDirectory','8BrnxdL','replace','values','120216avbfwU','object','set','split','name','bytes','Skill\x20file\x20path\x20must\x20be\x20text.','2355254GfHOjb','size','validation','content','has','utf8','isArray','localeCompare','includes','sha256','10043733wrCzZZ','Unsafe\x20Skill\x20file\x20path:\x20','from','isSymbolicLink','6sKbIcv','3952440yCFyBV','6520256Pixjsf','push','toString','startsWith','372ZcqOqM','add','path','302NaOjQp','sort','test','15473190JCAkSB','length','Duplicate\x20Skill\x20file\x20path:\x20','7518lIJxkT','isFile','9WNtEJr','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isBuffer'];a160_0x6ca6=function(){return _0x31563b;};return a160_0x6ca6();}function a160_0x4d19(_0x3c2f82,_0x1a15f6){_0x3c2f82=_0x3c2f82-0xee;const _0x6ca6ce=a160_0x6ca6();let _0x4d19e9=_0x6ca6ce[_0x3c2f82];return _0x4d19e9;}export function normalizeLocalFiles(_0x348d50){const _0x2532d0=a160_0x4d19;if(!Array[_0x2532d0(0x111)](_0x348d50)||_0x348d50[_0x2532d0(0xf5)]===0x0)return[];const _0x430c5c=new Map();for(const _0x1787f4 of _0x348d50){if(!_0x1787f4||typeof _0x1787f4!==_0x2532d0(0x105)||typeof _0x1787f4[_0x2532d0(0xf0)]!==_0x2532d0(0xff))throw CliErrors[_0x2532d0(0x10d)](_0x2532d0(0x10a));const _0x56bd55=normalizeSkillRelativePath(_0x1787f4[_0x2532d0(0xf0)]);if(_0x430c5c[_0x2532d0(0x10f)](_0x56bd55))throw CliErrors[_0x2532d0(0x10d)](_0x2532d0(0xf6)+_0x56bd55);if(_0x1787f4[_0x2532d0(0x109)]!==undefined&&!Buffer[_0x2532d0(0xfb)](_0x1787f4[_0x2532d0(0x109)]))throw CliErrors[_0x2532d0(0x10d)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x56bd55);if(_0x1787f4['bytes']===undefined&&typeof _0x1787f4[_0x2532d0(0x10e)]!==_0x2532d0(0xff))throw CliErrors[_0x2532d0(0x10d)](_0x2532d0(0xfe)+_0x56bd55);const _0x3bffe2=fileContent(_0x1787f4);_0x430c5c[_0x2532d0(0x106)](_0x56bd55,{'path':_0x56bd55,'bytes':_0x3bffe2});}return Array[_0x2532d0(0x117)](_0x430c5c[_0x2532d0(0x103)]())[_0x2532d0(0xf2)](compareSkillFiles);}export function normalizeManifestFiles(_0x15a157){const _0x1b707a=a160_0x4d19;if(!Array[_0x1b707a(0x111)](_0x15a157)||_0x15a157[_0x1b707a(0xf5)]===0x0)return[];const _0x4799ef=new Map();for(const _0x40b543 of _0x15a157){if(!_0x40b543||typeof _0x40b543!==_0x1b707a(0x105)||typeof _0x40b543[_0x1b707a(0xf0)]!==_0x1b707a(0xff))throw CliErrors['validation'](_0x1b707a(0x10a));const _0x43a8c2=normalizeSkillRelativePath(_0x40b543[_0x1b707a(0xf0)]);if(_0x4799ef[_0x1b707a(0x10f)](_0x43a8c2))throw CliErrors[_0x1b707a(0x10d)](_0x1b707a(0xf6)+_0x43a8c2);if(!isSha256Hex(_0x40b543[_0x1b707a(0x114)]))throw CliErrors[_0x1b707a(0x10d)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x43a8c2);if(!Number['isSafeInteger'](_0x40b543[_0x1b707a(0x10c)])||_0x40b543[_0x1b707a(0x10c)]<0x0)throw CliErrors[_0x1b707a(0x10d)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x43a8c2);_0x4799ef['set'](_0x43a8c2,{'path':_0x43a8c2,'sha256':_0x40b543[_0x1b707a(0x114)]['toLowerCase'](),'size':_0x40b543[_0x1b707a(0x10c)]});}return Array[_0x1b707a(0x117)](_0x4799ef['values']())[_0x1b707a(0xf2)](compareSkillFiles);}export function scanSkillDirectory(_0x8622ca,_0x463e94={}){const _0x2de93f=realpathSync(_0x8622ca),_0x3f8b65=canonicalExcludedFilePaths(_0x463e94['excludedFilePaths']),_0x5c81de=[];function _0x322f32(_0x5de9b3){const _0x46e74b=a160_0x4d19,_0x338d98=readdirSync(_0x5de9b3,{'withFileTypes':!![]})[_0x46e74b(0xf2)]((_0x4efd9e,_0x3288c5)=>_0x4efd9e[_0x46e74b(0x108)][_0x46e74b(0x112)](_0x3288c5['name']));for(const _0x34d2c1 of _0x338d98){if(_0x34d2c1[_0x46e74b(0x100)]()&&IGNORED_DIR_NAMES[_0x46e74b(0x10f)](_0x34d2c1[_0x46e74b(0x108)]))continue;if(IGNORED_FILE_NAMES[_0x46e74b(0x10f)](_0x34d2c1[_0x46e74b(0x108)]))continue;const _0xb5415e=resolve(_0x5de9b3,_0x34d2c1[_0x46e74b(0x108)]);if(isExcludedFilePath(_0xb5415e,_0x3f8b65))continue;if(_0x34d2c1[_0x46e74b(0x118)]())throw CliErrors[_0x46e74b(0x10d)](_0x46e74b(0xfa)+_0xb5415e);const _0x15d3f8=toPosixPath(relative(_0x2de93f,_0xb5415e));if(_0x34d2c1[_0x46e74b(0x100)]()){_0x322f32(_0xb5415e);continue;}if(!_0x34d2c1[_0x46e74b(0xf8)]())continue;validateSkillRelativePath(_0x15d3f8);const _0x1ae36d=readFileSync(_0xb5415e);_0x5c81de[_0x46e74b(0x11c)]({'path':_0x15d3f8,'bytes':_0x1ae36d});}}return _0x322f32(_0x2de93f),normalizeLocalFiles(_0x5c81de);}function canonicalExcludedFilePaths(_0x11d31a){const _0xf33313=a160_0x4d19,_0x509400=new Set();for(const _0x1891b8 of _0x11d31a??[]){const _0x2b8c0e=resolve(_0x1891b8);_0x509400['add'](_0x2b8c0e);try{_0x509400[_0xf33313(0xef)](realpathSync(_0x2b8c0e));}catch{}}return _0x509400;}function isExcludedFilePath(_0x21a4fb,_0x3fa696){const _0x5ee869=a160_0x4d19;if(_0x3fa696['has'](_0x21a4fb))return!![];if(_0x3fa696['size']===0x0)return![];try{return _0x3fa696[_0x5ee869(0x10f)](realpathSync(_0x21a4fb));}catch{return![];}}export function compareSkillFiles(_0x1ac918,_0x140891){const _0x56e15c=a160_0x4d19;if(_0x1ac918['path']===SKILL_FILE)return _0x140891[_0x56e15c(0xf0)]===SKILL_FILE?0x0:-0x1;if(_0x140891[_0x56e15c(0xf0)]===SKILL_FILE)return 0x1;return Buffer[_0x56e15c(0xfd)](Buffer[_0x56e15c(0x117)](_0x1ac918[_0x56e15c(0xf0)],_0x56e15c(0x110)),Buffer['from'](_0x140891['path'],_0x56e15c(0x110)));}export function normalizeSkillRelativePath(_0x19bf08){const _0x44b3f6=a160_0x4d19,_0x3999be=toPosixPath(_0x19bf08[_0x44b3f6(0xfc)]());return validateSkillRelativePath(_0x3999be),_0x3999be;}export function validateSkillRelativePath(_0x3bfafa){const _0x41a78a=a160_0x4d19;if(!_0x3bfafa||_0x3bfafa[_0x41a78a(0x11e)]('/')||_0x3bfafa[_0x41a78a(0x113)]('//'))throw CliErrors[_0x41a78a(0x10d)](_0x41a78a(0x116)+_0x3bfafa);for(const _0x2d0e3b of _0x3bfafa[_0x41a78a(0x107)]('/')){if(!_0x2d0e3b||_0x2d0e3b==='.'||_0x2d0e3b==='..')throw CliErrors[_0x41a78a(0x10d)](_0x41a78a(0x116)+_0x3bfafa);}}export function toPosixPath(_0x3a58b2){const _0x206a46=a160_0x4d19;return _0x3a58b2[_0x206a46(0x102)](/\\/g,'/');}export function isSha256Hex(_0x35fb83){const _0x5e450a=a160_0x4d19;return typeof _0x35fb83===_0x5e450a(0xff)&&/^[a-fA-F0-9]{64}$/[_0x5e450a(0xf3)](_0x35fb83);}
|