@lovrabet/lovrabet-cli 2.3.5 → 2.3.6-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.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +10 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.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.d.ts +3 -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.d.ts +3 -0
- package/lib/services/dataset-import/image-bytes.js +1 -0
- package/lib/services/dataset-import/image-ooxml.d.ts +10 -0
- package/lib/services/dataset-import/image-ooxml.js +1 -0
- package/lib/services/dataset-import/image-runner.d.ts +48 -0
- package/lib/services/dataset-import/image-runner.js +1 -0
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.d.ts +10 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/services/dataset-import/types.d.ts +28 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +4 -1
- package/skills/lovrabet/SKILL.md +3 -1
- package/skills/lovrabet/references/lovrabet-excel-import.md +19 -0
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a141_0x5ba384=a141_0x49bc;(function(_0x376a79,_0x37dddd){const _0x1cabbe=a141_0x49bc,_0x869e8b=_0x376a79();while(!![]){try{const _0x50acf8=parseInt(_0x1cabbe(0x213))/0x1+-parseInt(_0x1cabbe(0x21a))/0x2+parseInt(_0x1cabbe(0x1ca))/0x3+parseInt(_0x1cabbe(0x20d))/0x4*(parseInt(_0x1cabbe(0x255))/0x5)+-parseInt(_0x1cabbe(0x1e8))/0x6+-parseInt(_0x1cabbe(0x268))/0x7+-parseInt(_0x1cabbe(0x1e6))/0x8*(-parseInt(_0x1cabbe(0x233))/0x9);if(_0x50acf8===_0x37dddd)break;else _0x869e8b['push'](_0x869e8b['shift']());}catch(_0x137825){_0x869e8b['push'](_0x869e8b['shift']());}}}(a141_0x554c,0xa2748));import a141_0x2ac87b from'node:path';import{SaxesParser}from'saxes';const SHEET=[a141_0x5ba384(0x229),a141_0x5ba384(0x274)],DRAWING=[a141_0x5ba384(0x1ff),'http://purl.oclc.org/ooxml/drawingml/spreadsheetDrawing'],DRAWING_MAIN=[a141_0x5ba384(0x234),'http://purl.oclc.org/ooxml/drawingml/main'],OFFICE_RELS=['http://schemas.openxmlformats.org/officeDocument/2006/relationships',a141_0x5ba384(0x22b)],PACKAGE=[a141_0x5ba384(0x1e0)],RICH=[a141_0x5ba384(0x1ee)],RICH_RELS=[a141_0x5ba384(0x1da)],WPS=[a141_0x5ba384(0x1d2)],DEFAULT_NS=Object[a141_0x5ba384(0x246)]([...[a141_0x5ba384(0x208),a141_0x5ba384(0x24d),a141_0x5ba384(0x1ef),a141_0x5ba384(0x25c),a141_0x5ba384(0x1f6),a141_0x5ba384(0x1f4),'c','f','v',a141_0x5ba384(0x270),'drawing',a141_0x5ba384(0x247),a141_0x5ba384(0x1d9),a141_0x5ba384(0x1cb),a141_0x5ba384(0x22d),'valueMetadata','bk','rc',a141_0x5ba384(0x1d5)][a141_0x5ba384(0x263)](_0x346647=>[_0x346647,SHEET]),...[a141_0x5ba384(0x264),'oneCellAnchor',a141_0x5ba384(0x262),a141_0x5ba384(0x230),a141_0x5ba384(0x1f1),'to',a141_0x5ba384(0x26d),a141_0x5ba384(0x253),'rowOff',a141_0x5ba384(0x212),a141_0x5ba384(0x24e),a141_0x5ba384(0x21c),'cNvPr',a141_0x5ba384(0x25d)]['map'](_0x6c2453=>[_0x6c2453,DRAWING]),...[a141_0x5ba384(0x1dc),a141_0x5ba384(0x222),'rv','rvStructures','s','k'][a141_0x5ba384(0x263)](_0xd88224=>[_0xd88224,RICH]),[a141_0x5ba384(0x20c),DRAWING_MAIN],['richValueRels',RICH_RELS],['rel',RICH_RELS],['Relationships',PACKAGE],[a141_0x5ba384(0x214),PACKAGE],['cellImages',WPS],['cellImage',WPS]]),matches=(_0x1a76e8,_0x11591a,_0x4be8e3=DEFAULT_NS[_0x11591a]??[])=>_0x1a76e8[a141_0x5ba384(0x232)]===_0x11591a&&_0x4be8e3[a141_0x5ba384(0x260)](_0x1a76e8['uri']),children=(_0x223721,_0x5238df,_0x5e5d19=DEFAULT_NS[_0x5238df])=>_0x223721['children'][a141_0x5ba384(0x278)](_0x1d6b73=>matches(_0x1d6b73,_0x5238df,_0x5e5d19)),chain=(_0x105f18,..._0x44d737)=>_0x44d737['reduce']((_0x38578e,_0x55dd35)=>_0x38578e[a141_0x5ba384(0x202)](_0x472d19=>children(_0x472d19,_0x55dd35)),[_0x105f18]),relationshipTypes=_0x2a1ef0=>{const _0x269724=a141_0x5ba384;if(['rdRichValue',_0x269724(0x24c)][_0x269724(0x260)](_0x2a1ef0))return[_0x269724(0x21b)+_0x2a1ef0];if(_0x2a1ef0===_0x269724(0x237))return['http://schemas.microsoft.com/office/2022/10/relationships/richValueRel'];if(_0x2a1ef0===_0x269724(0x201)||_0x2a1ef0==='cellImages')return[_0x269724(0x1f0)+_0x2a1ef0];return OFFICE_RELS[_0x269724(0x263)](_0x2c0076=>_0x2c0076+'/'+_0x2a1ef0);};function one(_0x198a65,_0x588354){const _0x756ea=a141_0x5ba384;if(_0x198a65[_0x756ea(0x1fa)]!==0x1)throw Error(_0x756ea(0x1c8)+_0x588354+'.');return _0x198a65[0x0];}function a141_0x49bc(_0x35dedd,_0x100798){_0x35dedd=_0x35dedd-0x1c7;const _0x554ca2=a141_0x554c();let _0x49bc8f=_0x554ca2[_0x35dedd];return _0x49bc8f;}function a141_0x554c(){const _0x2d845c=['776bMLuUa','XLRICHVALUE','round','uri','Unsupported\x20drawing\x20image.','ext','1044544ZvbDRG','Relationship','doctype','image\x20row\x20height\x20coordinate','type','Missing\x20future\x20metadata\x20block.','r:link','1407624WVUOIO','http://schemas.microsoft.com/office/2017/06/relationships/','nvPicPr','Missing\x20value\x20metadata\x20block.','Unsupported\x20mapped\x20rich\x20value\x20structure.','exec','rvStructures','.rels','rvData','Rich\x20IMAGE\x20cell\x20contains\x20unexpected\x20scalar\x20or\x20mixed\x20content.','_rvRel:LocalImageIdentifier','image','Unsupported\x20image\x20formula;\x20expected\x20a\x20standalone\x20DISPIMG\x20literal.','anchor\x20column','rich\x20future\x20metadata','http://schemas.openxmlformats.org/spreadsheetml/2006/main','Unsupported\x20worksheet\x20namespace.','http://purl.oclc.org/ooxml/officeDocument/relationships','test','futureMetadata','Relationship\x20target\x20escapes\x20workbook:\x20','image\x20cell\x20row','absoluteAnchor','future\x20metadata\x20index','name','630522AkpjBa','http://schemas.openxmlformats.org/drawingml/2006/main','Image\x20XML\x20event\x20budget\x20exceeded.','Image\x20coordinate\x20exceeds\x20worksheet\x20bounds.','richValueRel','Invalid\x20relationship\x20target:\x20','Invalid\x20or\x20duplicate\x20relationship\x20in\x20','MAX_SAFE_INTEGER','_rels','Duplicate\x20mapped\x20image\x20cell.','anchor\x20end\x20offset','opentag','rdRichValue','XML\x20DTD/entities\x20are\x20not\x20supported.','dirname','anchor\x20row','set','Absolute\x20image\x20anchor\x20cannot\x20be\x20mapped\x20in\x20worksheet\x20','Invalid\x20image\x20start\x20offset\x20at\x20row\x20','fromEntries','metadata','Mixed\x20formula\x20and\x20rich\x20image\x20metadata\x20is\x20unsupported.','Missing\x20or\x20ambiguous\x20WPS\x20cell\x20image\x20part.','join','defaultRowHeight','rdRichValueStructure','sheets','pic','has','children','hidden\x20image\x20row','get','colOff','posix','8735ovQwEk','Unsupported\x20rich\x20image\x20relation\x20namespace.','Image\x20XML\x20text\x20exceeds\x2064\x20KB.','cNvPr','values','charCodeAt','rowOff','worksheet','blipFill','Shared\x20image\x20formulas\x20are\x20not\x20supported.','rich\x20image\x20relationship\x20index','includes','rich\x20metadata\x20record','twoCellAnchor','map','wsDr','startsWith','cellImages','rich\x20value\x20index','8574671ZziUUH','text','true','sheetMetadata','anchor\x20start\x20offset','col','Invalid\x20','value','sheetFormatPr','local','Unsupported\x20rich\x20value\x20namespace.','Relationships','http://purl.oclc.org/ooxml/spreadsheetml/main','Invalid\x20worksheet\x20row\x20height\x20for\x20image\x20anchor.','Missing\x20WPS\x20image\x20ID:\x20','isSafeInteger','filter','message','push','some','Missing\x20or\x20ambiguous\x20','isFinite','3933573MZRWVm','metadataType','Missing\x20XLSX\x20part:\x20','closetag','xl/','WPS\x20image\x20name','pop','image\x20formula','http://www.wps.cn/officeDocument/2017/etCustomData','toLowerCase','Missing\x20rich\x20value.','extLst','slice','Value\x20metadata\x20index\x20must\x20be\x20one-based.','r:id','metadataTypes','http://schemas.microsoft.com/office/spreadsheetml/2022/richvaluerel','oneCellAnchor','rvb','External\x20WPS\x20image\x20links\x20are\x20not\x20supported.','_localImage','Unsupported\x20metadata\x20namespace.','http://schemas.openxmlformats.org/package/2006/relationships','Image\x20anchor\x20spans\x20multiple\x20business\x20rows.','image\x20extent','Unsupported\x20relationship\x20namespace\x20in\x20','r:embed','rich\x20value\x20binding','112ZfDtiu','Unsupported\x20drawing\x20namespace.','6487704MQBQpm','attrs','utf8','value\x20metadata\x20index','Missing\x20rich\x20image\x20relationship.','rich\x20structure\x20index','http://schemas.microsoft.com/office/spreadsheetml/2017/richdata','sheet','http://www.wps.cn/officeDocument/2017/relationships/','from','toString','shared','row','Missing\x20or\x20ambiguous\x20local\x20image\x20identifier.','sheetData','drawing','error','Image\x20XML\x20node\x20budget\x20exceeded.','length','hidden','Internal','valueMetadata','Image\x20anchor\x20has\x20invalid\x20or\x20reversed\x20row\x20offsets.','http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing','attributes','cellImage','flatMap','Unsupported\x20rich\x20structure\x20namespace.','xl/workbook.xml','\x20relationship\x20in\x20','Ambiguous\x20XML\x20attribute.','Unsupported\x20WPS\x20cell\x20image\x20namespace.','workbook','add','replace','anchor\x20start','blip'];a141_0x554c=function(){return _0x2d845c;};return a141_0x554c();}function integer(_0x54904a,_0x2cfcaf,_0x4def35=0x186a0){const _0xe6ff34=a141_0x5ba384;if(!_0x54904a||!/^\d+$/[_0xe6ff34(0x22c)](_0x54904a)||!Number[_0xe6ff34(0x277)](Number(_0x54904a))||Number(_0x54904a)>_0x4def35)throw Error(_0xe6ff34(0x26e)+_0x2cfcaf+'.');return Number(_0x54904a);}export function resolveWorksheetImages(_0x510f5f,_0x25807e,_0x57d160){const _0x702d9b=a141_0x5ba384;let _0x3de44c=0x0,_0x410d0e=0x0,_0x131862=0x0;const _0x213a22=new Map(),_0x5c3f68=_0x30c295=>{const _0x8468c9=a141_0x49bc;if(_0x213a22['has'](_0x30c295))return _0x213a22[_0x8468c9(0x252)](_0x30c295);const _0x57518a=_0x510f5f[_0x8468c9(0x252)](_0x30c295);if(!_0x57518a)throw Error(_0x8468c9(0x1cc)+_0x30c295+'.');const _0x412ee8={'name':'','uri':'','attrs':{},'children':[],'text':''},_0x417269=[_0x412ee8],_0x35575b=new SaxesParser({'xmlns':!![]}),_0x3808c1=()=>{const _0x20a06a=_0x8468c9;if(++_0x410d0e>0x1e8480)throw Error(_0x20a06a(0x235));};_0x35575b['on'](_0x8468c9(0x215),()=>{const _0x5ece2a=_0x8468c9;throw Error(_0x5ece2a(0x240));}),_0x35575b['on'](_0x8468c9(0x23e),_0x333325=>{const _0x54d86e=_0x8468c9;_0x3808c1();if(++_0x3de44c>0x7a120||_0x417269[_0x54d86e(0x1fa)]>0x40)throw Error(_0x54d86e(0x1f9));const _0x8ae4cb={};for(const _0x2696aa of Object[_0x54d86e(0x259)](_0x333325[_0x54d86e(0x200)])){const _0x12bd0b=OFFICE_RELS[_0x54d86e(0x260)](_0x2696aa[_0x54d86e(0x210)])?'r:'+_0x2696aa['local']:_0x2696aa[_0x54d86e(0x210)]?'{'+_0x2696aa[_0x54d86e(0x210)]+'}'+_0x2696aa[_0x54d86e(0x271)]:_0x2696aa[_0x54d86e(0x271)];if(_0x12bd0b in _0x8ae4cb)throw Error(_0x54d86e(0x206));_0x8ae4cb[_0x12bd0b]=_0x2696aa[_0x54d86e(0x26f)];}const _0x58e2f7={'name':_0x333325[_0x54d86e(0x271)],'uri':_0x333325[_0x54d86e(0x210)],'attrs':_0x8ae4cb,'children':[],'text':''};_0x417269['at'](-0x1)[_0x54d86e(0x250)]['push'](_0x58e2f7),_0x417269[_0x54d86e(0x27a)](_0x58e2f7);}),_0x35575b['on']('text',_0x573d01=>{const _0x57fe1a=_0x8468c9;_0x3808c1();const _0x3dc9ff=_0x417269['at'](-0x1);_0x3dc9ff['text']+=_0x573d01;if(_0x3dc9ff['text'][_0x57fe1a(0x1fa)]>0x10000)throw Error(_0x57fe1a(0x257));}),_0x35575b['on'](_0x8468c9(0x1cd),()=>{const _0x153459=_0x8468c9;_0x3808c1(),_0x417269[_0x153459(0x1d0)]();}),_0x35575b['on'](_0x8468c9(0x1f8),_0x421568=>{throw _0x421568;}),_0x35575b['write'](_0x57518a[_0x8468c9(0x1f2)](_0x8468c9(0x1ea)))['close']();const _0x485ecc=one(_0x412ee8[_0x8468c9(0x250)],_0x30c295);return _0x213a22[_0x8468c9(0x243)](_0x30c295,_0x485ecc),_0x485ecc;},_0x5aa92d=new Map(),_0x212427=_0x59fc67=>{const _0x4a672e=a141_0x49bc;if(_0x5aa92d['has'](_0x59fc67))return _0x5aa92d['get'](_0x59fc67);const _0x58e957=a141_0x2ac87b[_0x4a672e(0x254)]['join'](a141_0x2ac87b['posix'][_0x4a672e(0x241)](_0x59fc67),_0x4a672e(0x23b),a141_0x2ac87b[_0x4a672e(0x254)]['basename'](_0x59fc67)+_0x4a672e(0x221));if(!_0x510f5f[_0x4a672e(0x24f)](_0x58e957))return[];const _0x2d0064=new Set(),_0x26e8ca=_0x5c3f68(_0x58e957);if(!matches(_0x26e8ca,_0x4a672e(0x273)))throw Error(_0x4a672e(0x1e3)+_0x58e957+'.');const _0x45640b=children(_0x26e8ca,_0x4a672e(0x214))[_0x4a672e(0x263)](_0x36946b=>{const _0x1f84ce=_0x4a672e,{Id:_0x30dde4,Type:_0x4014ff,Target:_0x228d5,TargetMode:_0x3010e1}=_0x36946b[_0x1f84ce(0x1e9)];if(!_0x30dde4||_0x2d0064['has'](_0x30dde4)||!_0x4014ff)throw Error(_0x1f84ce(0x239)+_0x58e957+'.');return _0x2d0064[_0x1f84ce(0x209)](_0x30dde4),{'id':_0x30dde4,'type':_0x4014ff,'target':_0x228d5??'','mode':_0x3010e1};});return _0x5aa92d['set'](_0x59fc67,_0x45640b),_0x45640b;},_0x4809b4=(_0x2acd79,_0xbb5961)=>{const _0x4debb2=a141_0x49bc,{target:_0x1b0974,mode:_0x21fe92}=_0xbb5961;if(_0x21fe92&&_0x21fe92!==_0x4debb2(0x1fc))throw Error('External\x20image\x20relationship\x20is\x20not\x20supported:\x20'+_0x2acd79+'.');if(!_0x1b0974||_0x1b0974[_0x4debb2(0x260)]('\x5c')||/[?#%\x00-\x20]/[_0x4debb2(0x22c)](_0x1b0974)||/^[a-z][a-z0-9+.-]*:/i[_0x4debb2(0x22c)](_0x1b0974)||_0x1b0974[_0x4debb2(0x265)]('//'))throw Error(_0x4debb2(0x238)+_0x2acd79+'.');const _0x2248a8=_0x1b0974[_0x4debb2(0x265)]('/')?_0x1b0974[_0x4debb2(0x1d6)](0x1):a141_0x2ac87b[_0x4debb2(0x254)]['normalize'](a141_0x2ac87b[_0x4debb2(0x254)][_0x4debb2(0x24a)](a141_0x2ac87b[_0x4debb2(0x254)]['dirname'](_0x2acd79),_0x1b0974));if(_0x2248a8[_0x4debb2(0x265)]('../')||_0x2248a8==='..'||!_0x2248a8['startsWith'](_0x4debb2(0x1ce)))throw Error(_0x4debb2(0x22e)+_0x2acd79+'.');return _0x2248a8;},_0x446039=(_0x3801cb,_0x44c5a8,_0x522c72)=>{const _0x2cab33=a141_0x49bc,_0x538fe7=_0x212427(_0x3801cb)['filter'](_0x25c4dd=>_0x25c4dd['id']===_0x44c5a8&&relationshipTypes(_0x522c72)[_0x2cab33(0x260)](_0x25c4dd[_0x2cab33(0x217)]));if(_0x538fe7[_0x2cab33(0x1fa)]!==0x1)throw Error(_0x2cab33(0x1c8)+_0x522c72+'\x20relationship\x20in\x20'+_0x3801cb+'.');return _0x4809b4(_0x3801cb,_0x538fe7[0x0]);},_0x4d1911=(_0x31b02f,_0x51c22f)=>{const _0xd4b948=a141_0x49bc,_0x3d78ef=_0x212427(_0x31b02f)[_0xd4b948(0x278)](_0x348f4b=>relationshipTypes(_0x51c22f)['includes'](_0x348f4b[_0xd4b948(0x217)]));if(_0x3d78ef[_0xd4b948(0x1fa)]!==0x1)throw Error(_0xd4b948(0x1c8)+_0x51c22f+_0xd4b948(0x205)+_0x31b02f+'.');return _0x4809b4(_0x31b02f,_0x3d78ef[0x0]);},_0x549c70=_0x702d9b(0x204),_0x372860=_0x5c3f68(_0x549c70);if(!matches(_0x372860,_0x702d9b(0x208)))throw Error('Unsupported\x20workbook\x20namespace.');const _0x2868ec=one(chain(_0x372860,_0x702d9b(0x24d),_0x702d9b(0x1ef))[_0x702d9b(0x278)](_0x101438=>_0x101438[_0x702d9b(0x1e9)][_0x702d9b(0x232)]===_0x25807e),_0x702d9b(0x25c)),_0x7df2ce=_0x446039(_0x549c70,_0x2868ec['attrs'][_0x702d9b(0x1d8)],_0x702d9b(0x25c)),_0x4dff27=_0x5c3f68(_0x7df2ce);if(!matches(_0x4dff27,_0x702d9b(0x25c)))throw Error(_0x702d9b(0x22a));const _0x530e82=chain(_0x4dff27,'sheetData',_0x702d9b(0x1f4)),_0x514612=new Map(),_0x546884=new Set(_0x530e82[_0x702d9b(0x278)](_0x49b333=>_0x49b333['attrs'][_0x702d9b(0x1fb)]==='1'||_0x49b333[_0x702d9b(0x1e9)][_0x702d9b(0x1fb)]===_0x702d9b(0x26a))[_0x702d9b(0x263)](_0x23616c=>integer(_0x23616c['attrs']['r'],_0x702d9b(0x251)))),_0x3d3ff7=_0x353299=>{const _0x2928ba=_0x702d9b,_0x5a0668=_0x353299===undefined?0xf:Number(_0x353299);if(!Number[_0x2928ba(0x1c9)](_0x5a0668)||_0x5a0668<=0x0||_0x5a0668>409.5)throw Error(_0x2928ba(0x275));return Math[_0x2928ba(0x20f)](_0x5a0668*0x319c);},_0x45409f=_0x3d3ff7(children(_0x4dff27,'sheetFormatPr')[0x0]?.['attrs'][_0x702d9b(0x24b)]);for(const _0x33de74 of _0x530e82)if(_0x33de74[_0x702d9b(0x1e9)]['ht']!==undefined)_0x514612['set'](integer(_0x33de74['attrs']['r'],_0x702d9b(0x216)),_0x3d3ff7(_0x33de74[_0x702d9b(0x1e9)]['ht']));const _0x18024e=[],_0x76ae50=_0x3992c6=>{const _0x559a3c=_0x702d9b;if(!_0x57d160[_0x559a3c(0x24f)](_0x3992c6['col']))return;if(++_0x131862>0x2710)throw Error('Workbook\x20exceeds\x2010000\x20image\x20occurrences.');_0x18024e[_0x559a3c(0x27a)](_0x546884[_0x559a3c(0x24f)](_0x3992c6[_0x559a3c(0x1f4)])?{..._0x3992c6,'hiddenRow':!![]}:_0x3992c6);},_0x2fb879=_0x3c656c=>({'row':integer(one(children(_0x3c656c,_0x702d9b(0x1f4),DRAWING),_0x702d9b(0x242))[_0x702d9b(0x269)],_0x702d9b(0x242),0x1869f)+0x1,'col':integer(one(children(_0x3c656c,_0x702d9b(0x26d)),'anchor\x20column')['text'],_0x702d9b(0x227),0xff)+0x1});for(const _0x256ae8 of children(_0x4dff27,_0x702d9b(0x1f7))){const _0x1a11d6=_0x446039(_0x7df2ce,_0x256ae8[_0x702d9b(0x1e9)][_0x702d9b(0x1d8)],'drawing'),_0xe1174c=_0x5c3f68(_0x1a11d6);if(!matches(_0xe1174c,'wsDr'))throw Error(_0x702d9b(0x1e7));for(const _0x219e1f of _0xe1174c[_0x702d9b(0x250)]){if(!['oneCellAnchor','twoCellAnchor','absoluteAnchor'][_0x702d9b(0x1c7)](_0x155ab9=>matches(_0x219e1f,_0x155ab9)))continue;if(_0x219e1f[_0x702d9b(0x232)]===_0x702d9b(0x230))throw Error(_0x702d9b(0x244)+_0x25807e+'.');const _0x1b8db0=_0x2fb879(one(children(_0x219e1f,'from'),'anchor\x20start'));if(!_0x57d160[_0x702d9b(0x24f)](_0x1b8db0[_0x702d9b(0x26d)]))continue;let _0x54b84c;const _0x1a65a3=one(children(_0x219e1f,_0x702d9b(0x1f1)),_0x702d9b(0x20b)),_0x54569b=integer(one(children(_0x1a65a3,_0x702d9b(0x25b)),_0x702d9b(0x26c))[_0x702d9b(0x269)],'anchor\x20start\x20offset',Number[_0x702d9b(0x23a)]),_0x7153c0=_0x514612['get'](_0x1b8db0['row'])??_0x45409f;if(_0x54569b>=_0x7153c0)throw Error(_0x702d9b(0x245)+_0x1b8db0[_0x702d9b(0x1f4)]+'.');if(_0x219e1f[_0x702d9b(0x232)]===_0x702d9b(0x1db)){const _0x573118=one(children(_0x219e1f,_0x702d9b(0x212)),_0x702d9b(0x1e2)),_0x434200=integer(_0x573118[_0x702d9b(0x1e9)]['cy'],'image\x20height',Number[_0x702d9b(0x23a)]);if(!_0x434200||_0x54569b+_0x434200>_0x7153c0)_0x54b84c=_0x702d9b(0x1e1);}if(_0x219e1f[_0x702d9b(0x232)]===_0x702d9b(0x262)){const _0x1f773f=one(children(_0x219e1f,'to'),'anchor\x20end'),_0x48f55f=_0x2fb879(_0x1f773f),_0x4dbab0=integer(one(children(_0x1f773f,_0x702d9b(0x25b)),_0x702d9b(0x23d))[_0x702d9b(0x269)],_0x702d9b(0x23d),Number[_0x702d9b(0x23a)]),_0x3d4360=_0x514612['get'](_0x48f55f[_0x702d9b(0x1f4)])??_0x45409f;if(_0x4dbab0>_0x3d4360||_0x48f55f['row']===_0x1b8db0[_0x702d9b(0x1f4)]&&_0x4dbab0<=_0x54569b)_0x54b84c=_0x702d9b(0x1fe);if(_0x48f55f['row']<_0x1b8db0[_0x702d9b(0x1f4)]||_0x48f55f[_0x702d9b(0x1f4)]>_0x1b8db0[_0x702d9b(0x1f4)]+0x1||_0x48f55f['row']===_0x1b8db0[_0x702d9b(0x1f4)]+0x1&&_0x4dbab0!==0x0)_0x54b84c=_0x702d9b(0x1e1);}const _0x2dc0b0=chain(_0x219e1f,_0x702d9b(0x24e),_0x702d9b(0x25d),_0x702d9b(0x20c));for(const _0x282553 of _0x2dc0b0){if(_0x282553[_0x702d9b(0x1e9)][_0x702d9b(0x219)])throw Error('External\x20image\x20links\x20are\x20not\x20supported.');_0x76ae50({..._0x1b8db0,'media':[_0x446039(_0x1a11d6,_0x282553[_0x702d9b(0x1e9)][_0x702d9b(0x1e4)],_0x702d9b(0x225))],..._0x54b84c?{'error':_0x54b84c}:{}});}if(!_0x2dc0b0[_0x702d9b(0x1fa)])_0x76ae50({..._0x1b8db0,'media':[],'error':_0x702d9b(0x211)});}}const _0x193259=_0x35b1ba=>{const _0x56b9e2=_0x702d9b,_0x557876=_0x5c3f68(_0x4d1911(_0x549c70,_0x56b9e2(0x26b)));if(!matches(_0x557876,_0x56b9e2(0x247)))throw Error(_0x56b9e2(0x1df));const _0xd3a95a=integer(_0x35b1ba[_0x56b9e2(0x1e9)]['vm'],_0x56b9e2(0x1eb));if(!_0xd3a95a)throw Error(_0x56b9e2(0x1d7));const _0x4560a1=children(one(children(_0x557876,_0x56b9e2(0x1fd)),_0x56b9e2(0x1fd)),'bk')[_0xd3a95a-0x1];if(!_0x4560a1)throw Error(_0x56b9e2(0x21d));const _0xaa4eb2=one(children(_0x4560a1,'rc'),_0x56b9e2(0x261)),_0x33a5af=integer(_0xaa4eb2[_0x56b9e2(0x1e9)]['t'],'metadata\x20type\x20index'),_0x2902c9=children(one(children(_0x557876,_0x56b9e2(0x1d9)),'metadata\x20types'),_0x56b9e2(0x1cb))[_0x33a5af-0x1];if(!_0x33a5af||_0x2902c9?.[_0x56b9e2(0x1e9)][_0x56b9e2(0x232)]!==_0x56b9e2(0x20e))throw Error('Unsupported\x20mapped\x20cell\x20metadata\x20type.');const _0x2b6012=one(children(_0x557876,_0x56b9e2(0x22d))[_0x56b9e2(0x278)](_0x23a096=>_0x23a096[_0x56b9e2(0x1e9)][_0x56b9e2(0x232)]===_0x56b9e2(0x20e)),_0x56b9e2(0x228)),_0x10e7ed=children(_0x2b6012,'bk')[integer(_0xaa4eb2[_0x56b9e2(0x1e9)]['v'],_0x56b9e2(0x231))];if(!_0x10e7ed)throw Error(_0x56b9e2(0x218));const _0x5da75e=chain(_0x10e7ed,_0x56b9e2(0x1d5))[_0x56b9e2(0x202)](_0x18ee5e=>children(_0x18ee5e,_0x56b9e2(0x212),SHEET))[_0x56b9e2(0x278)](_0x54c70e=>_0x54c70e[_0x56b9e2(0x1e9)][_0x56b9e2(0x210)]?.[_0x56b9e2(0x1d3)]()==='{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}'),_0x140fed=integer(one(_0x5da75e[_0x56b9e2(0x202)](_0x31def3=>children(_0x31def3,_0x56b9e2(0x1dc))),_0x56b9e2(0x1e5))[_0x56b9e2(0x1e9)]['i'],_0x56b9e2(0x267)),_0x235ec1=_0x5c3f68(_0x4d1911(_0x549c70,_0x56b9e2(0x23f)));if(!matches(_0x235ec1,_0x56b9e2(0x222)))throw Error(_0x56b9e2(0x272));const _0x380acb=children(_0x235ec1,'rv')[_0x140fed];if(!_0x380acb)throw Error(_0x56b9e2(0x1d4));const _0x3183b9=_0x5c3f68(_0x4d1911(_0x549c70,_0x56b9e2(0x24c)));if(!matches(_0x3183b9,_0x56b9e2(0x220)))throw Error(_0x56b9e2(0x203));const _0x20bc45=children(_0x3183b9,'s')[integer(_0x380acb[_0x56b9e2(0x1e9)]['s'],_0x56b9e2(0x1ed))];if(!_0x20bc45||_0x20bc45[_0x56b9e2(0x1e9)]['t']!==_0x56b9e2(0x1de))throw Error(_0x56b9e2(0x21e));const _0x54ce52=children(_0x20bc45,'k'),_0x32600d=_0x54ce52[_0x56b9e2(0x263)]((_0x2797cc,_0x2ab826)=>_0x2797cc[_0x56b9e2(0x1e9)]['n']===_0x56b9e2(0x224)?_0x2ab826:-0x1)[_0x56b9e2(0x278)](_0xdccb9c=>_0xdccb9c>=0x0);if(_0x32600d[_0x56b9e2(0x1fa)]!==0x1)throw Error(_0x56b9e2(0x1f5));const _0x3af129=children(_0x380acb,'v',RICH)[_0x32600d[0x0]];if(!_0x3af129)throw Error('Missing\x20local\x20image\x20identifier\x20value.');const _0x1063be=_0x4d1911(_0x549c70,_0x56b9e2(0x237)),_0x3edaf1=_0x5c3f68(_0x1063be);if(!matches(_0x3edaf1,'richValueRels'))throw Error(_0x56b9e2(0x256));const _0x45f80e=children(_0x3edaf1,'rel')[integer(_0x3af129[_0x56b9e2(0x269)],_0x56b9e2(0x25f))];if(!_0x45f80e)throw Error(_0x56b9e2(0x1ec));return _0x446039(_0x1063be,_0x45f80e[_0x56b9e2(0x1e9)]['r:id'],_0x56b9e2(0x225));};let _0xbfe41b;const _0x4845a1=_0x516abd=>{const _0x3fa721=_0x702d9b;if(!_0xbfe41b){_0xbfe41b=new Map();const _0x434bbf=_0x212427(_0x549c70)[_0x3fa721(0x278)](_0x27f888=>[...relationshipTypes(_0x3fa721(0x201)),...relationshipTypes(_0x3fa721(0x266))][_0x3fa721(0x260)](_0x27f888[_0x3fa721(0x217)]));if(!_0x434bbf['length']&&_0x510f5f[_0x3fa721(0x24f)]('xl/cellimages.xml'))_0x434bbf[_0x3fa721(0x27a)]({'id':'','type':'','target':'/xl/cellimages.xml'});if(_0x434bbf['length']!==0x1)throw Error(_0x3fa721(0x249));const _0x51d59d=_0x4809b4(_0x549c70,_0x434bbf[0x0]),_0x3c90b1=_0x5c3f68(_0x51d59d);if(!matches(_0x3c90b1,_0x3fa721(0x266)))throw Error(_0x3fa721(0x207));for(const _0x1a7f75 of children(_0x3c90b1,_0x3fa721(0x201))){const _0x59854d=one(chain(_0x1a7f75,_0x3fa721(0x24e),_0x3fa721(0x21c),_0x3fa721(0x258)),_0x3fa721(0x1cf))[_0x3fa721(0x1e9)][_0x3fa721(0x232)];if(!_0x59854d||_0xbfe41b[_0x3fa721(0x24f)](_0x59854d))throw Error('Invalid\x20or\x20duplicate\x20WPS\x20image\x20ID.');const _0x59dd32=one(chain(_0x1a7f75,_0x3fa721(0x24e),'blipFill',_0x3fa721(0x20c)),'WPS\x20image\x20blip');if(_0x59dd32[_0x3fa721(0x1e9)][_0x3fa721(0x219)])throw Error(_0x3fa721(0x1dd));_0xbfe41b[_0x3fa721(0x243)](_0x59854d,_0x446039(_0x51d59d,_0x59dd32[_0x3fa721(0x1e9)][_0x3fa721(0x1e4)],'image'));}}const _0xcd685c=_0xbfe41b[_0x3fa721(0x252)](_0x516abd);if(!_0xcd685c)throw Error(_0x3fa721(0x276)+_0x516abd+'.');return _0xcd685c;},_0x159f29=new Set();for(const _0x245349 of _0x530e82[_0x702d9b(0x202)](_0x450aea=>children(_0x450aea,'c'))){const _0xef92c9=/^([A-Z]+)([1-9]\d*)$/['exec'](_0x245349[_0x702d9b(0x1e9)]['r']??'');if(!_0xef92c9)continue;let _0x577352=0x0;for(const _0x51b64a of _0xef92c9[0x1])_0x577352=_0x577352*0x1a+_0x51b64a[_0x702d9b(0x25a)](0x0)-0x40;if(!_0x57d160[_0x702d9b(0x24f)](_0x577352))continue;const _0x5d584a=integer(_0xef92c9[0x2],_0x702d9b(0x22f));if(_0x159f29['has'](_0x245349['attrs']['r']))throw Error(_0x702d9b(0x23c));_0x159f29[_0x702d9b(0x209)](_0x245349['attrs']['r']);const _0xdd46a2=children(_0x245349,'f');if(!_0x245349['attrs']['vm']&&!_0xdd46a2[_0x702d9b(0x1fa)])continue;try{if(_0x5d584a<0x1||_0x577352>0x100)throw Error(_0x702d9b(0x236));let _0x2d771e;if(_0x245349[_0x702d9b(0x1e9)]['vm']){if(_0xdd46a2[_0x702d9b(0x1fa)])throw Error(_0x702d9b(0x248));if(_0x245349[_0x702d9b(0x1e9)]['t']!=='e'||children(_0x245349,'v')[_0x702d9b(0x1fa)]!==0x1||children(_0x245349,'v')[0x0]['text']!=='#VALUE!')throw Error(_0x702d9b(0x223));_0x2d771e=_0x193259(_0x245349);}else{const _0x54bfbc=one(_0xdd46a2,_0x702d9b(0x1d1));if(_0x54bfbc['attrs']['t']===_0x702d9b(0x1f3)||_0x54bfbc[_0x702d9b(0x1e9)]['si'])throw Error(_0x702d9b(0x25e));const _0x4187b5=/^\s*=?\s*@?(?:_xlfn\.)?DISPIMG\(\s*"((?:[^"]|"")+)"\s*(?:,\s*[01]\s*)?\)\s*$/i[_0x702d9b(0x21f)](_0x54bfbc['text']);if(!_0x4187b5)throw Error(_0x702d9b(0x226));_0x2d771e=_0x4845a1(_0x4187b5[0x1][_0x702d9b(0x20a)](/""/g,'\x22'));}_0x76ae50({'row':_0x5d584a,'col':_0x577352,'media':[_0x2d771e],'nativeCell':!![]});}catch(_0x5dd6af){_0x76ae50({'row':_0x5d584a,'col':_0x577352,'media':[],'nativeCell':!![],'error':_0x5dd6af[_0x702d9b(0x279)]});}}return _0x18024e;}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ImportContract, ImportOptions } from './runner.js';
|
|
2
|
+
import type { ExcelManifest, ImportImageValue, ImportMedia } from './types.js';
|
|
3
|
+
export interface ImageImportResponse {
|
|
4
|
+
status: string;
|
|
5
|
+
contentHash: string;
|
|
6
|
+
filePath?: string;
|
|
7
|
+
fileName?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ImageImportApi {
|
|
12
|
+
upload(importId: string, media: ImportMedia): Promise<ImageImportResponse>;
|
|
13
|
+
readback(importId: string, media: ImportMedia): Promise<ImageImportResponse>;
|
|
14
|
+
}
|
|
15
|
+
export interface ImageImportOptions extends ImportOptions {
|
|
16
|
+
imageApi: ImageImportApi;
|
|
17
|
+
inputPaths?: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function assertImageImportCapability(contract: ImportContract, manifest: ExcelManifest): void;
|
|
20
|
+
/** 与 Runtime 相同的 JSON 数组身份和稳定对象名,不依赖临时 URL。 */
|
|
21
|
+
export declare function imageObjectValue(contract: ImportContract, importId: string, media: Pick<ImportMedia, 'contentHash' | 'type' | 'size'>): ImportImageValue;
|
|
22
|
+
export declare function bindImageManifest(manifest: ExcelManifest, contract: ImportContract, importId: string): ExcelManifest;
|
|
23
|
+
export declare function runImageExcelImport(options: ImageImportOptions): Promise<{
|
|
24
|
+
checkpoint: string;
|
|
25
|
+
imageCount: number;
|
|
26
|
+
uniqueImages: number;
|
|
27
|
+
importId: string | undefined;
|
|
28
|
+
sourceRows: number;
|
|
29
|
+
emptyRows: number;
|
|
30
|
+
succeeded: number;
|
|
31
|
+
unknown: number;
|
|
32
|
+
conflicts: number;
|
|
33
|
+
notAttempted: number;
|
|
34
|
+
batches: number;
|
|
35
|
+
batchResults: {
|
|
36
|
+
batch: number;
|
|
37
|
+
rowStart: number;
|
|
38
|
+
rowEnd: number;
|
|
39
|
+
count: number;
|
|
40
|
+
bytes: number;
|
|
41
|
+
elapsedMs: number;
|
|
42
|
+
status: string;
|
|
43
|
+
}[];
|
|
44
|
+
elapsedMs: number;
|
|
45
|
+
report: string;
|
|
46
|
+
warnings: string[];
|
|
47
|
+
status: string;
|
|
48
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x565a35,_0x38d173){const _0x33f5af=a142_0x1972,_0x46a12b=_0x565a35();while(!![]){try{const _0x3bd7f7=parseInt(_0x33f5af(0xaa))/0x1*(-parseInt(_0x33f5af(0x97))/0x2)+parseInt(_0x33f5af(0xb1))/0x3+parseInt(_0x33f5af(0xb7))/0x4*(-parseInt(_0x33f5af(0x9d))/0x5)+-parseInt(_0x33f5af(0xab))/0x6+-parseInt(_0x33f5af(0xb5))/0x7+-parseInt(_0x33f5af(0xb2))/0x8+parseInt(_0x33f5af(0xba))/0x9;if(_0x3bd7f7===_0x38d173)break;else _0x46a12b['push'](_0x46a12b['shift']());}catch(_0x145010){_0x46a12b['push'](_0x46a12b['shift']());}}}(a142_0x3367,0x92c52));import{randomUUID,createHash}from'node:crypto';import{lstat,readFile}from'node:fs/promises';import{acquireLock,assertImportContract,assertImportPaths,canonical,resolveImportOutputPath,runExcelImport,saveImportJson}from'./runner.js';import{runAutoIdExcelImport}from'./auto-id-runner.js';import{previewImportBatchCount}from'./preview.js';export function assertImageImportCapability(_0x270315,_0xd4434d){const _0x59c0d2=a142_0x1972;if(!_0xd4434d['media']?.['length'])return;const _0x4cdec3=_0x270315[_0x59c0d2(0x82)];if(!_0x4cdec3||_0x4cdec3[_0x59c0d2(0x7d)]!==0x1||_0x4cdec3[_0x59c0d2(0x8c)]!==_0x59c0d2(0xb4)||_0x4cdec3[_0x59c0d2(0xc5)]!==0xa00000||_0x4cdec3['maxPixels']!==0x2625a00||!Array[_0x59c0d2(0x65)](_0x4cdec3[_0x59c0d2(0xac)])||![_0x59c0d2(0x66),_0x59c0d2(0x70),'image/gif'][_0x59c0d2(0xaf)](_0x2fdd6e=>_0x4cdec3['types'][_0x59c0d2(0xbf)](_0x2fdd6e)))throw Error('The\x20server\x20does\x20not\x20support\x20this\x20image\x20import\x20capability.');}function a142_0x3367(){const _0x5a17c3=['appCode','binding','type','get','reduce','all','stringify','mappingHash','00000000-0000-4000-8000-000000000000','2QBxHYU','readback','contract','png','entries','jpg','2403710SQmdHK','datasetCode','utf8','gif','field','values','runtimeDomain','bytes','maxBatchBytes','imageFields','phase','uploadFields','parse','145779jqKYry','3633078JUYslg','types','contentHash','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','every','rows-started','788085debbHC','1599240PcEtdM','batchSize','sha256','779681kBnKhk','schemaVersion','4lCjcIK','fileName','schemaFingerprint','16936173bvBKQg','upload','missing','value','size','includes','isInteger','key','imageApi','sheet','actorId','maxFileBytes','importId','Image\x20upload\x20outcome\x20is\x20unknown\x20or\x20missing.\x20Resume\x20to\x20reconcile\x20the\x20original\x20upload\x20identity.','succeeded','Invalid\x20image\x20media\x20descriptor.','rowNumber','isArray','image/png','Uploaded\x20image\x20is\x20not\x20visible.\x20Resume\x20to\x20reconcile\x20before\x20continuing.','Image\x20cell\x20references\x20missing\x20media.','Cannot\x20read\x20the\x20image\x20import\x20checkpoint.','hashes','Invalid\x20image\x20manifest\x20limits.','Completed\x20image\x20checkpoint\x20value\x20changed.','test','completed','pending','image/jpeg','imageCells','.lock','media','strategy','ENOENT','fromEntries','hex','manifest','dataset-import/','map','Invalid\x20image\x20readback\x20digest.','name','version','rows','Previously\x20uploaded\x20image\x20is\x20missing;\x20automatic\x20repair\x20is\x20disabled.','hash','.lock.recovery','imageImport','Excel\x20contains\x20invalid\x20or\x20no\x20data\x20rows;\x20no\x20images\x20were\x20uploaded.','maxBatchSize','fileHash','inputPaths','Row\x20phase\x20started\x20but\x20the\x20row\x20checkpoint\x20is\x20missing;\x20stop\x20to\x20avoid\x20duplicate\x20records.','status','length','update','resume','uploadId','rows-preparing'];a142_0x3367=function(){return _0x5a17c3;};return a142_0x3367();}export function imageObjectValue(_0x1a916b,_0x35c7ee,_0x2aff76){const _0x34800c=a142_0x1972,_0x121aff=createHash(_0x34800c(0xb4))[_0x34800c(0x8a)](JSON[_0x34800c(0x94)]([_0x1a916b[_0x34800c(0xc4)],_0x1a916b['appCode'],_0x1a916b[_0x34800c(0x9e)],_0x35c7ee]))['digest'](_0x34800c(0x77)),_0x2b363e={'image/png':_0x34800c(0x9a),'image/jpeg':_0x34800c(0x9c),'image/gif':_0x34800c(0xa0)}[_0x2aff76['type']];if(!_0x2b363e||!/^[0-9a-f]{64}$/[_0x34800c(0x6d)](_0x2aff76[_0x34800c(0xad)])||!Number['isSafeInteger'](_0x2aff76[_0x34800c(0xbe)])||_0x2aff76[_0x34800c(0xbe)]<=0x0||_0x2aff76['size']>0xa00000)throw Error(_0x34800c(0xc9));const _0x305929=_0x2aff76[_0x34800c(0xad)]+'.'+_0x2b363e;return{'key':_0x34800c(0x79)+_0x121aff+'/'+_0x305929,'name':_0x305929,'type':_0x2aff76[_0x34800c(0x90)],'size':_0x2aff76[_0x34800c(0xbe)]};}function a142_0x1972(_0x4b1106,_0x1c10cc){_0x4b1106=_0x4b1106-0x64;const _0x33675a=a142_0x3367();let _0x197205=_0x33675a[_0x4b1106];return _0x197205;}export function bindImageManifest(_0x3617a7,_0x282c2e,_0x56f6b7){const _0x36b5fe=a142_0x1972,_0x562a99=new Map(_0x3617a7[_0x36b5fe(0x73)]?.['map'](_0x4563cc=>[_0x4563cc[_0x36b5fe(0xad)],_0x4563cc])),_0x2cd21a=new Map(_0x3617a7[_0x36b5fe(0x71)]?.[_0x36b5fe(0x7a)](_0x322947=>[_0x322947[_0x36b5fe(0x64)]+':'+_0x322947[_0x36b5fe(0xa1)],_0x322947['hashes']]));return{..._0x3617a7,'rows':_0x3617a7[_0x36b5fe(0x7e)][_0x36b5fe(0x7a)](_0x1a1ffc=>({..._0x1a1ffc,'values':Object[_0x36b5fe(0x76)](Object[_0x36b5fe(0x9b)](_0x1a1ffc[_0x36b5fe(0xa2)])[_0x36b5fe(0x7a)](([_0x2ed91d,_0x473753])=>{const _0xe8fb45=_0x36b5fe,_0xa07253=_0x2cd21a[_0xe8fb45(0x91)](_0x1a1ffc[_0xe8fb45(0x64)]+':'+_0x2ed91d);return[_0x2ed91d,_0xa07253?_0xa07253[_0xe8fb45(0x7a)](_0x23e2bf=>{const _0x3ad236=_0xe8fb45,_0x32e01c=_0x562a99[_0x3ad236(0x91)](_0x23e2bf);if(!_0x32e01c)throw Error(_0x3ad236(0x68));const _0x2471e4=imageObjectValue(_0x282c2e,_0x56f6b7,_0x32e01c);return _0x3617a7['uploadFields']?.['includes'](_0x2ed91d)?{'fileName':_0x2471e4['name'],'filePath':_0x2471e4['key']}:_0x2471e4;}):_0x473753];}))}))};}async function exists(_0x142aef){const _0x2066d1=a142_0x1972;try{return await lstat(_0x142aef),!![];}catch(_0x4ae909){if(_0x4ae909['code']===_0x2066d1(0x75))return![];throw _0x4ae909;}}export async function runImageExcelImport(_0x3186bd){const _0x41c2ce=a142_0x1972;assertImportContract(_0x3186bd[_0x41c2ce(0x99)],_0x3186bd[_0x41c2ce(0x8e)],_0x3186bd[_0x41c2ce(0x9e)]),assertImageImportCapability(_0x3186bd[_0x41c2ce(0x99)],_0x3186bd[_0x41c2ce(0x78)]);if(!Number[_0x41c2ce(0xc0)](_0x3186bd[_0x41c2ce(0xb3)])||_0x3186bd['batchSize']<0x1||_0x3186bd['batchSize']>_0x3186bd['contract'][_0x41c2ce(0x84)])throw Error('Invalid\x20import\x20batch\x20size.');if(_0x3186bd['manifest']['errors'][_0x41c2ce(0x89)]||!_0x3186bd['manifest']['rows'][_0x41c2ce(0x89)])throw Error(_0x41c2ce(0x83));const _0x483473=await resolveImportOutputPath(_0x3186bd['checkpoint']),_0x3858de=await resolveImportOutputPath(_0x3186bd['report']),_0x249376=await resolveImportOutputPath(_0x483473+'.rows.json'),_0x148232=await Promise[_0x41c2ce(0x93)]([_0x249376,_0x249376+'.lock',_0x249376+_0x41c2ce(0x81),..._0x3186bd[_0x41c2ce(0x86)]??[]][_0x41c2ce(0x7a)](resolveImportOutputPath));for(const _0x5d9da0 of[_0x483473,_0x3858de,_0x483473+_0x41c2ce(0x72),_0x483473+_0x41c2ce(0x81)])await resolveImportOutputPath(_0x5d9da0);assertImportPaths(_0x483473,_0x3858de,_0x148232);const {contract:_0x9d92f0,manifest:_0x213a84}=_0x3186bd,_0x4613d0=_0x213a84[_0x41c2ce(0x73)]??[];if(new Set(_0x4613d0[_0x41c2ce(0x7a)](_0x2dbb01=>_0x2dbb01[_0x41c2ce(0xad)]))[_0x41c2ce(0xbe)]!==_0x4613d0[_0x41c2ce(0x89)]||_0x4613d0[_0x41c2ce(0x92)]((_0x2fa883,_0x3b9a6f)=>_0x2fa883+_0x3b9a6f['size'],0x0)>0x32*0x400*0x400||(_0x213a84[_0x41c2ce(0x71)]??[])[_0x41c2ce(0x92)]((_0x4939dd,_0x5071f1)=>_0x4939dd+_0x5071f1[_0x41c2ce(0x6a)][_0x41c2ce(0x89)],0x0)>0x2710)throw Error(_0x41c2ce(0x6b));for(const _0x514305 of _0x4613d0)if(_0x514305[_0x41c2ce(0xbe)]!==_0x514305['bytes']['length']||createHash(_0x41c2ce(0xb4))[_0x41c2ce(0x8a)](_0x514305[_0x41c2ce(0xa4)])['digest'](_0x41c2ce(0x77))!==_0x514305['contentHash'])throw Error('Image\x20media\x20bytes\x20changed.');previewImportBatchCount(bindImageManifest(_0x213a84,_0x9d92f0,_0x41c2ce(0x96)),_0x9d92f0,_0x3186bd[_0x41c2ce(0xb3)]);const _0x50c9b2={'appCode':_0x3186bd[_0x41c2ce(0x8e)],'datasetCode':_0x3186bd[_0x41c2ce(0x9e)],'runtimeDomain':_0x3186bd[_0x41c2ce(0xa3)],'actorId':_0x9d92f0[_0x41c2ce(0xc4)],'fileHash':_0x213a84[_0x41c2ce(0x85)],'mappingHash':_0x213a84[_0x41c2ce(0x95)],'schemaHash':_0x213a84['schemaHash'],'remoteSchemaHash':_0x9d92f0[_0x41c2ce(0xb9)],'strategy':_0x9d92f0[_0x41c2ce(0x74)],'schemaVersion':_0x9d92f0[_0x41c2ce(0xb6)],'batchSize':_0x3186bd[_0x41c2ce(0xb3)],'maxBatchBytes':_0x9d92f0[_0x41c2ce(0xa5)],'sheet':_0x213a84[_0x41c2ce(0xc3)],'parserVersion':_0x213a84['parserVersion'],'imageFields':_0x213a84[_0x41c2ce(0xa6)],'cells':_0x213a84[_0x41c2ce(0x71)],..._0x213a84[_0x41c2ce(0xa8)]?.[_0x41c2ce(0x89)]?{'uploadFields':_0x213a84[_0x41c2ce(0xa8)]}:{},'media':_0x4613d0[_0x41c2ce(0x7a)](({contentHash:_0x2d6136,type:_0x561fc6,size:_0x421e7f})=>({'contentHash':_0x2d6136,'type':_0x561fc6,'size':_0x421e7f})),'rows':_0x213a84[_0x41c2ce(0x7e)]},_0x372744=await acquireLock(_0x483473);try{let _0x7f0229;if(_0x3186bd[_0x41c2ce(0x8b)]){try{_0x7f0229=JSON[_0x41c2ce(0xa9)](await readFile(_0x483473,_0x41c2ce(0x9f)));}catch{throw Error(_0x41c2ce(0x69));}if(_0x7f0229[_0x41c2ce(0x7d)]!==0x3||!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/[_0x41c2ce(0x6d)](_0x7f0229[_0x41c2ce(0xc6)])||canonical(_0x7f0229[_0x41c2ce(0x8f)])!==canonical(_0x50c9b2)||!['media',_0x41c2ce(0x8d),_0x41c2ce(0xb0),'completed'][_0x41c2ce(0xbf)](_0x7f0229[_0x41c2ce(0xa7)])||!Array[_0x41c2ce(0x65)](_0x7f0229['media'])||_0x7f0229['media'][_0x41c2ce(0x89)]!==_0x4613d0[_0x41c2ce(0x89)]||_0x7f0229[_0x41c2ce(0x73)]['some']((_0x5c2d18,_0x217123)=>_0x5c2d18[_0x41c2ce(0x80)]!==_0x4613d0[_0x217123][_0x41c2ce(0xad)]||![_0x41c2ce(0x6f),_0x41c2ce(0xc8)]['includes'](_0x5c2d18[_0x41c2ce(0x88)])))throw Error('Image\x20checkpoint\x20does\x20not\x20match\x20the\x20source,\x20target\x20or\x20identity.');if([_0x41c2ce(0xb0),_0x41c2ce(0x6e)][_0x41c2ce(0xbf)](_0x7f0229[_0x41c2ce(0xa7)])&&!await exists(_0x249376))throw Error(_0x41c2ce(0x87));if(_0x7f0229[_0x41c2ce(0xa7)]===_0x41c2ce(0x73)&&await exists(_0x249376))throw Error('Unexpected\x20row\x20checkpoint\x20during\x20image\x20upload\x20phase.');}else{if(await exists(_0x483473)||await exists(_0x249376))throw Error(_0x41c2ce(0xae));_0x7f0229={'version':0x3,'importId':randomUUID(),'binding':_0x50c9b2,'phase':_0x41c2ce(0x73),'media':_0x4613d0['map'](_0x52cec9=>({'hash':_0x52cec9[_0x41c2ce(0xad)],'status':_0x41c2ce(0x6f)}))},await saveImportJson(_0x483473,_0x7f0229);}const _0x197f5e=(_0x4a88e6,_0x267221)=>{const _0x20251f=_0x41c2ce;if(!_0x4a88e6||_0x4a88e6[_0x20251f(0xad)]!==_0x267221['contentHash'])throw Error(_0x20251f(0x7b));if(_0x4a88e6[_0x20251f(0x88)]===_0x20251f(0xbc))return undefined;const _0x24704a=imageObjectValue(_0x9d92f0,_0x7f0229['importId'],_0x267221);if(_0x4a88e6[_0x20251f(0x88)]!==_0x20251f(0xc8)||_0x4a88e6['filePath']!==_0x24704a[_0x20251f(0xc1)]||_0x4a88e6[_0x20251f(0xb8)]!==_0x24704a[_0x20251f(0x7c)]||_0x4a88e6[_0x20251f(0x90)]!==_0x24704a[_0x20251f(0x90)]||_0x4a88e6['size']!==_0x24704a[_0x20251f(0xbe)])throw Error('Uploaded\x20image\x20metadata\x20changed\x20or\x20is\x20corrupt.');return _0x24704a;};for(let _0x4a66aa=0x0;_0x4a66aa<_0x4613d0[_0x41c2ce(0x89)];_0x4a66aa++){const _0x23518e=_0x4613d0[_0x4a66aa],_0x13e435=_0x7f0229[_0x41c2ce(0x73)][_0x4a66aa],_0x1c9558=imageObjectValue(_0x9d92f0,_0x7f0229['importId'],_0x23518e);if(_0x13e435['status']==='succeeded'&&canonical(_0x13e435['value'])!==canonical(_0x1c9558))throw Error(_0x41c2ce(0x6c));let _0x3aa00a;if(_0x3186bd['resume']||_0x13e435['status']===_0x41c2ce(0xc8))_0x3aa00a=_0x197f5e(await _0x3186bd[_0x41c2ce(0xc2)][_0x41c2ce(0x98)](_0x7f0229[_0x41c2ce(0xc6)],_0x23518e),_0x23518e);if(!_0x3aa00a&&_0x13e435[_0x41c2ce(0x88)]===_0x41c2ce(0xc8))throw Error(_0x41c2ce(0x7f));if(!_0x3aa00a){try{_0x197f5e(await _0x3186bd['imageApi'][_0x41c2ce(0xbb)](_0x7f0229[_0x41c2ce(0xc6)],_0x23518e),_0x23518e);}catch(_0x135a3d){_0x3aa00a=_0x197f5e(await _0x3186bd[_0x41c2ce(0xc2)][_0x41c2ce(0x98)](_0x7f0229[_0x41c2ce(0xc6)],_0x23518e),_0x23518e);if(!_0x3aa00a)throw Error(_0x41c2ce(0xc7));}if(!_0x3aa00a)_0x3aa00a=_0x197f5e(await _0x3186bd['imageApi'][_0x41c2ce(0x98)](_0x7f0229[_0x41c2ce(0xc6)],_0x23518e),_0x23518e);if(!_0x3aa00a)throw Error(_0x41c2ce(0x67));}_0x13e435['status']='succeeded',_0x13e435[_0x41c2ce(0xbd)]=_0x3aa00a,await saveImportJson(_0x483473,_0x7f0229);}const _0x3571a2=bindImageManifest(_0x213a84,_0x9d92f0,_0x7f0229[_0x41c2ce(0xc6)]),_0x141295=_0x7f0229['phase']===_0x41c2ce(0x8d)?await exists(_0x249376):_0x7f0229[_0x41c2ce(0xa7)]!=='media';_0x7f0229[_0x41c2ce(0xa7)]===_0x41c2ce(0x73)&&(_0x7f0229[_0x41c2ce(0xa7)]=_0x41c2ce(0x8d),await saveImportJson(_0x483473,_0x7f0229));const _0x29f3c6={..._0x3186bd,'manifest':_0x3571a2,'checkpoint':_0x249376,'report':_0x3858de,'resume':_0x141295,'onCheckpointReady':async()=>{const _0x5cf363=_0x41c2ce;_0x7f0229[_0x5cf363(0xa7)]='rows-started',await saveImportJson(_0x483473,_0x7f0229);}},_0x28eadd=_0x9d92f0['schemaVersion']===0x2?await runAutoIdExcelImport({..._0x29f3c6,'reconcileImageConflicts':_0x3186bd['resume']===!![]&&_0x141295}):await runExcelImport(_0x29f3c6);return _0x7f0229[_0x41c2ce(0xa7)]='completed',await saveImportJson(_0x483473,_0x7f0229),{..._0x28eadd,'checkpoint':_0x483473,'imageCount':_0x213a84[_0x41c2ce(0x71)]?.[_0x41c2ce(0x92)]((_0x3b2384,_0x13385d)=>_0x3b2384+_0x13385d['hashes'][_0x41c2ce(0x89)],0x0)??0x0,'uniqueImages':_0x4613d0[_0x41c2ce(0x89)]};}finally{await _0x372744();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbecf1d,_0x4b5f59){const _0xcbcce4=a143_0x17ac,_0x3533e7=_0xbecf1d();while(!![]){try{const _0x11d869=parseInt(_0xcbcce4(0x150))/0x1*(parseInt(_0xcbcce4(0x13d))/0x2)+-parseInt(_0xcbcce4(0x14c))/0x3*(-parseInt(_0xcbcce4(0x145))/0x4)+-parseInt(_0xcbcce4(0x142))/0x5+-parseInt(_0xcbcce4(0x141))/0x6+-parseInt(_0xcbcce4(0x13a))/0x7*(parseInt(_0xcbcce4(0x13c))/0x8)+parseInt(_0xcbcce4(0x149))/0x9+-parseInt(_0xcbcce4(0x14b))/0xa*(-parseInt(_0xcbcce4(0x147))/0xb);if(_0x11d869===_0x4b5f59)break;else _0x3533e7['push'](_0x3533e7['shift']());}catch(_0x9d248f){_0x3533e7['push'](_0x3533e7['shift']());}}}(a143_0x1a16,0xaeb8d));function a143_0x17ac(_0x3d93b9,_0x5b4a2d){_0x3d93b9=_0x3d93b9-0x139;const _0x1a1643=a143_0x1a16();let _0x17ac93=_0x1a1643[_0x3d93b9];return _0x17ac93;}function a143_0x1a16(){const _0x4c68fa=['15iFteWc','isArray','source','351001vQXXjb','object','136JgWTSB','130862pYFyyQ','datasetCode','appCode','sourceType','7990926nYwbRc','6824765SJzVOK','modelCode','Dataset\x20metadata\x20is\x20missing.','632ediAAM','dataset','82412gKKglZ','code','12791367acNnYw','string','950ObnSix','21843NASmCv','length','some','filter'];a143_0x1a16=function(){return _0x4c68fa;};return a143_0x1a16();}export function assertDatasetImportTarget(_0x5479a4,_0x2990da,_0x58391a){const _0x2039cf=a143_0x17ac;if(!_0x5479a4||typeof _0x5479a4!==_0x2039cf(0x13b)||Array[_0x2039cf(0x151)](_0x5479a4))throw Error(_0x2039cf(0x144));const _0x2b5b26=[_0x5479a4[_0x2039cf(0x148)],_0x5479a4[_0x2039cf(0x143)],_0x5479a4[_0x2039cf(0x146)]?.[_0x2039cf(0x13e)]]['filter'](_0x51d191=>_0x51d191!=null);if(!_0x2b5b26[_0x2039cf(0x14d)]||_0x2b5b26[_0x2039cf(0x14e)](_0x4e6647=>_0x4e6647!==_0x58391a)||_0x5479a4[_0x2039cf(0x13f)]!=null&&_0x5479a4[_0x2039cf(0x13f)]!==_0x2990da||_0x5479a4[_0x2039cf(0x146)]?.['appCode']!=null&&_0x5479a4[_0x2039cf(0x146)][_0x2039cf(0x13f)]!==_0x2990da)throw Error('Dataset\x20metadata\x20does\x20not\x20match\x20the\x20requested\x20target.');const _0x25bf6b=[_0x5479a4[_0x2039cf(0x139)],_0x5479a4[_0x2039cf(0x146)]?.[_0x2039cf(0x140)]][_0x2039cf(0x14f)](_0x395d4c=>_0x395d4c!=null);if(_0x25bf6b[_0x2039cf(0x14e)](_0x2a20f3=>typeof _0x2a20f3!==_0x2039cf(0x14a)||_0x2a20f3!==_0x25bf6b[0x0]))throw Error('Dataset\x20source\x20metadata\x20is\x20inconsistent.');return _0x25bf6b[0x0];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a144_0x187f(_0x365c7c,_0x6faec2){_0x365c7c=_0x365c7c-0x107;const _0x55afb9=a144_0x55af();let _0x187f0b=_0x55afb9[_0x365c7c];return _0x187f0b;}(function(_0x401a5b,_0x52046f){const _0x41a3bb=a144_0x187f,_0x4315f7=_0x401a5b();while(!![]){try{const _0x36c0b4=parseInt(_0x41a3bb(0x117))/0x1*(parseInt(_0x41a3bb(0x112))/0x2)+parseInt(_0x41a3bb(0x110))/0x3+parseInt(_0x41a3bb(0x119))/0x4*(parseInt(_0x41a3bb(0x10f))/0x5)+-parseInt(_0x41a3bb(0x118))/0x6+-parseInt(_0x41a3bb(0x109))/0x7+-parseInt(_0x41a3bb(0x10b))/0x8*(parseInt(_0x41a3bb(0x113))/0x9)+parseInt(_0x41a3bb(0x10c))/0xa;if(_0x36c0b4===_0x52046f)break;else _0x4315f7['push'](_0x4315f7['shift']());}catch(_0x3883aa){_0x4315f7['push'](_0x4315f7['shift']());}}}(a144_0x55af,0x72357));function a144_0x55af(){const _0x2b2ae0=['values','rows','3908254SnYRYs','length','7318136JOcDqG','7466430WAVhyh','maxBatchBytes','stringify','55chrVou','8232PQDHEd','push','10lVkNke','9tGOxvf','schemaVersion','byteLength','map','110310ZLijdy','1765146xwXvOw','339688JOpNqt','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.'];a144_0x55af=function(){return _0x2b2ae0;};return a144_0x55af();}export function previewImportBatchCount(_0x5cad43,_0x166b81,_0x5c6432){const _0xc96051=a144_0x187f,_0x3ddeb3=_0x7dfd6a=>_0x7dfd6a[_0xc96051(0x116)](_0x4569cf=>_0x166b81[_0xc96051(0x114)]===0x1?{..._0x5cad43[_0xc96051(0x108)][_0x4569cf][_0xc96051(0x107)],'id':-0x1fffffffffffff}:_0x5cad43[_0xc96051(0x108)][_0x4569cf][_0xc96051(0x107)]),_0x5d1481=_0x19ecde=>Buffer[_0xc96051(0x115)](JSON[_0xc96051(0x10e)]({'schemaFingerprint':_0x166b81['schemaFingerprint'],..._0x166b81[_0xc96051(0x114)]===0x2?{'taskId':0x2**0x34}:{},'items':_0x3ddeb3(_0x19ecde)}),'utf8');let _0x41defe=0x0,_0x4a745f=[];for(let _0x1331e2=0x0;_0x1331e2<_0x5cad43[_0xc96051(0x108)]['length'];_0x1331e2++){if(_0x5d1481([_0x1331e2])>_0x166b81[_0xc96051(0x10d)])throw Error('Excel\x20row\x20'+_0x5cad43[_0xc96051(0x108)][_0x1331e2]['rowNumber']+_0xc96051(0x11a));_0x4a745f[_0xc96051(0x10a)]&&(_0x4a745f[_0xc96051(0x10a)]===_0x5c6432||_0x5d1481([..._0x4a745f,_0x1331e2])>_0x166b81['maxBatchBytes'])&&(_0x41defe++,_0x4a745f=[]),_0x4a745f[_0xc96051(0x111)](_0x1331e2);}return _0x41defe+Number(_0x4a745f[_0xc96051(0x10a)]>0x0);}
|
|
@@ -9,6 +9,13 @@ export interface ImportContract {
|
|
|
9
9
|
schemaFingerprint: string;
|
|
10
10
|
maxBatchSize: number;
|
|
11
11
|
maxBatchBytes: number;
|
|
12
|
+
imageImport?: {
|
|
13
|
+
version: number;
|
|
14
|
+
maxFileBytes: number;
|
|
15
|
+
maxPixels: number;
|
|
16
|
+
types: string[];
|
|
17
|
+
uploadId: string;
|
|
18
|
+
};
|
|
12
19
|
}
|
|
13
20
|
export interface ImportApi {
|
|
14
21
|
write(items: Record<string, unknown>[], taskId?: number): Promise<{
|
|
@@ -29,9 +36,11 @@ export interface ImportOptions {
|
|
|
29
36
|
batchSize: number;
|
|
30
37
|
resume?: boolean;
|
|
31
38
|
api: ImportApi;
|
|
39
|
+
/** 行身份持久化并校验后、任何行 API 调用前,在行锁内确认外层状态。 */
|
|
40
|
+
onCheckpointReady?: () => Promise<void>;
|
|
32
41
|
}
|
|
33
42
|
export declare function canonical(value: unknown): string;
|
|
34
|
-
export declare function sameImportValue(expected: unknown, actual: unknown): boolean;
|
|
43
|
+
export declare function sameImportValue(expected: unknown, actual: unknown, image?: boolean): boolean;
|
|
35
44
|
export declare function resolveImportOutputPath(path: string): Promise<string>;
|
|
36
45
|
export declare function assertImportPaths(checkpoint: string, report: string, inputs?: string[]): void;
|
|
37
46
|
export declare function saveImportJson(path: string, value: unknown): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x26ac3d,_0x40798d){const _0x94fdd7=a142_0x5ca6,_0x43e66f=_0x26ac3d();while(!![]){try{const _0x3673e1=parseInt(_0x94fdd7(0xcd))/0x1*(-parseInt(_0x94fdd7(0xfa))/0x2)+-parseInt(_0x94fdd7(0x119))/0x3*(parseInt(_0x94fdd7(0x107))/0x4)+-parseInt(_0x94fdd7(0x105))/0x5*(parseInt(_0x94fdd7(0xe9))/0x6)+parseInt(_0x94fdd7(0xf8))/0x7+-parseInt(_0x94fdd7(0xcf))/0x8+parseInt(_0x94fdd7(0x10b))/0x9*(-parseInt(_0x94fdd7(0xc6))/0xa)+parseInt(_0x94fdd7(0x11f))/0xb;if(_0x3673e1===_0x40798d)break;else _0x43e66f['push'](_0x43e66f['shift']());}catch(_0x437149){_0x43e66f['push'](_0x43e66f['shift']());}}}(a142_0x3dc0,0xd8e8e));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(_0x2b1881){const _0x59770a=a142_0x5ca6;if(Array[_0x59770a(0x104)](_0x2b1881))return'['+_0x2b1881[_0x59770a(0xb5)](canonical)['join'](',')+']';if(_0x2b1881&&typeof _0x2b1881===_0x59770a(0xd3))return'{'+Object[_0x59770a(0xdd)](_0x2b1881)[_0x59770a(0xcc)]()[_0x59770a(0xb5)](_0x57ef32=>JSON[_0x59770a(0xe4)](_0x57ef32)+':'+canonical(_0x2b1881[_0x57ef32]))[_0x59770a(0xf0)](',')+'}';return JSON[_0x59770a(0xe4)](_0x2b1881)??_0x59770a(0xc5);}export function sameImportValue(_0x988a73,_0x1e937c){return _0x988a73===null?_0x1e937c===null||_0x1e937c===undefined:canonical(_0x1e937c)===canonical(_0x988a73);}async function rejectSymlink(_0x202cf7){const _0x41f1b4=a142_0x5ca6;try{if((await lstat(_0x202cf7))[_0x41f1b4(0xc0)]())throw Error('Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.');}catch(_0x565d4f){if(_0x565d4f[_0x41f1b4(0x11e)]!==_0x41f1b4(0xbe))throw _0x565d4f;}}export async function resolveImportOutputPath(_0x224b46){return await rejectSymlink(_0x224b46),resolve(await realpath(dirname(resolve(_0x224b46))),basename(_0x224b46));}function a142_0x5ca6(_0x2c9a68,_0x1a2243){_0x2c9a68=_0x2c9a68-0xb5;const _0x3dc0d8=a142_0x3dc0();let _0x5ca6d6=_0x3dc0d8[_0x2c9a68];return _0x5ca6d6;}export function assertImportPaths(_0x1dbde2,_0x57d6af,_0x49d5ce=[]){const _0x578923=a142_0x5ca6,_0x57dd98=[..._0x49d5ce,_0x1dbde2,_0x57d6af,_0x1dbde2+_0x578923(0x108),_0x1dbde2+'.lock.recovery']['map'](_0xbf822e=>resolve(_0xbf822e));if(new Set(_0x57dd98)[_0x578923(0xdf)]!==_0x57dd98[_0x578923(0xba)])throw Error(_0x578923(0xff));}export async function saveImportJson(_0x2cd0a4,_0x44e7d9){const _0x175f2f=a142_0x5ca6;await rejectSymlink(_0x2cd0a4);const _0xbaaa2=_0x2cd0a4+_0x175f2f(0xbd)+randomUUID(),_0x2bfd66=await open(_0xbaaa2,'wx',0x180);try{await _0x2bfd66[_0x175f2f(0xe3)](JSON[_0x175f2f(0xe4)](_0x44e7d9,null,0x2)),await _0x2bfd66[_0x175f2f(0xed)]();}finally{await _0x2bfd66[_0x175f2f(0xb6)]();}try{await rename(_0xbaaa2,_0x2cd0a4);}catch(_0x2642b6){await unlink(_0xbaaa2)[_0x175f2f(0xc4)](()=>{});throw _0x2642b6;}}function a142_0x3dc0(){const _0x3aee4c=['checkpoint','kill','Invalid\x20import\x20readback\x20response.','maxBatchBytes','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','now','schemaHash','unsent','source','isArray','2506975LkNHnc','elapsedMs','860004BbgXnc','.lock','isInteger','has','8447157nHfRth','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','isSafeInteger','schemaVersion','every','includes','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','pending','parse','rowNumber','utf8','token','toString','appCode','18QQiqSR','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','EEXIST','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','code','37822961VHvmNL','batchSize','byteLength','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','values','pid','importId','succeeded','map','close','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','sheet','schemaFingerprint','length','count','fixed-negative-id','.tmp-','ENOENT','status','isSymbolicLink','incomplete','Excel\x20contains\x20no\x20valid\x20data\x20rows.','strategy','catch','undefined','10SGZCzG','Excel\x20row\x20','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','METADATA','readback','slice','sort','2ZBProM','warnings','478912xpqCKe','unknown','auto-id-task-marker','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','object','message','emptyRows','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','errors','datasetCode','write','report','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','some','keys','conflict','size','string','Invalid\x20write\x20result.','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','writeFile','stringify','completed','Invalid\x20import\x20batch\x20size.','maxBatchSize','actorId','12dsfVIe','resume','push','rows','sync','runtimeDomain','mappingHash','join','filter','set','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','add','forEach','Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','Invalid\x20import\x20lock\x20owner.','7274064lwwJig','ids','297908LWFOko'];a142_0x3dc0=function(){return _0x3aee4c;};return a142_0x3dc0();}export async function acquireLock(_0x46f764){const _0x522d1d=a142_0x5ca6,_0x1e59a0=_0x46f764+_0x522d1d(0x108),_0x406daa=randomUUID();await rejectSymlink(_0x1e59a0);const _0x131cde=_0x1e59a0+'.recovery';let _0x39bf4a,_0x1f5fff;try{try{_0x39bf4a=await open(_0x1e59a0,'wx',0x180);}catch(_0x34becc){if(_0x34becc[_0x522d1d(0x11e)]!=='EEXIST')throw _0x34becc;try{_0x1f5fff=await open(_0x131cde,'wx',0x180);}catch(_0x59116f){if(_0x59116f[_0x522d1d(0x11e)]===_0x522d1d(0x11c))throw Error('Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.');throw _0x59116f;}await _0x1f5fff[_0x522d1d(0xe3)](JSON['stringify']({'pid':process[_0x522d1d(0x124)],'token':_0x406daa})),await _0x1f5fff[_0x522d1d(0xed)](),await rejectSymlink(_0x1e59a0);let _0xe0faaa;try{_0xe0faaa=await readFile(_0x1e59a0,_0x522d1d(0x115));}catch(_0x274241){if(_0x274241[_0x522d1d(0x11e)]!==_0x522d1d(0xbe))throw _0x274241;}if(_0xe0faaa!==undefined){let _0x516fb6;try{_0x516fb6=JSON['parse'](_0xe0faaa);}catch{throw Error(_0x522d1d(0x10c));}if(!_0x516fb6||!Number[_0x522d1d(0x10d)](_0x516fb6[_0x522d1d(0x124)])||_0x516fb6['pid']<=0x0)throw Error(_0x522d1d(0xf7));try{process[_0x522d1d(0xfc)](_0x516fb6['pid'],0x0);throw Error(_0x522d1d(0xe2));}catch(_0x474529){if(_0x474529[_0x522d1d(0x11e)]!=='ESRCH')throw _0x474529;}if(await readFile(_0x1e59a0,_0x522d1d(0x115))!==_0xe0faaa)throw Error('Import\x20lock\x20changed;\x20retry\x20recovery.');await unlink(_0x1e59a0);}_0x39bf4a=await open(_0x1e59a0,'wx',0x180);}await _0x39bf4a['writeFile'](JSON[_0x522d1d(0xe4)]({'pid':process[_0x522d1d(0x124)],'token':_0x406daa})),await _0x39bf4a[_0x522d1d(0xed)]();}finally{try{await _0x39bf4a?.[_0x522d1d(0xb6)]();}finally{if(_0x1f5fff)try{await _0x1f5fff[_0x522d1d(0xb6)]();}finally{await unlink(_0x131cde);}}}return async()=>{const _0x1bcc68=_0x522d1d;if(JSON[_0x1bcc68(0x113)](await readFile(_0x1e59a0,_0x1bcc68(0x115)))[_0x1bcc68(0x116)]===_0x406daa)await unlink(_0x1e59a0);};}export function assertImportContract(_0x3455b1,_0x58831f,_0x2ce7e8){const _0x5ae1ce=a142_0x5ca6;if(!_0x3455b1||!(_0x3455b1[_0x5ae1ce(0x10e)]===0x1&&_0x3455b1[_0x5ae1ce(0xc3)]===_0x5ae1ce(0xbc)||_0x3455b1[_0x5ae1ce(0x10e)]===0x2&&_0x3455b1[_0x5ae1ce(0xc3)]===_0x5ae1ce(0xd1))||_0x3455b1[_0x5ae1ce(0x103)]!==_0x5ae1ce(0xc9)||_0x3455b1[_0x5ae1ce(0x118)]!==_0x58831f||_0x3455b1[_0x5ae1ce(0xd8)]!==_0x2ce7e8||typeof _0x3455b1[_0x5ae1ce(0xe8)]!==_0x5ae1ce(0xe0)||!_0x3455b1[_0x5ae1ce(0xe8)]||typeof _0x3455b1[_0x5ae1ce(0xb9)]!==_0x5ae1ce(0xe0)||!_0x3455b1[_0x5ae1ce(0xb9)]||!Number['isSafeInteger'](_0x3455b1[_0x5ae1ce(0xe7)])||_0x3455b1['maxBatchSize']<0x1||_0x3455b1[_0x5ae1ce(0xe7)]>0x3e8||!Number[_0x5ae1ce(0x10d)](_0x3455b1[_0x5ae1ce(0xfe)])||_0x3455b1[_0x5ae1ce(0xfe)]<0x1||_0x3455b1[_0x5ae1ce(0xfe)]>0x14*0x400*0x400)throw Error(_0x5ae1ce(0xf3));}export async function runExcelImport(_0x46ef02){const _0x5b43ca=a142_0x5ca6;_0x46ef02={..._0x46ef02,'checkpoint':await resolveImportOutputPath(_0x46ef02[_0x5b43ca(0xfb)]),'report':await resolveImportOutputPath(_0x46ef02['report'])};const {manifest:_0x432048,contract:_0x2eb2de,api:_0x2e924f}=_0x46ef02;assertImportContract(_0x2eb2de,_0x46ef02['appCode'],_0x46ef02['datasetCode']);if(_0x2eb2de[_0x5b43ca(0x10e)]!==0x1)throw Error(_0x5b43ca(0x11b));if(_0x432048[_0x5b43ca(0xd7)][_0x5b43ca(0xba)])throw Error(_0x5b43ca(0x122));if(!_0x432048['rows']['length'])throw Error(_0x5b43ca(0xc2));if(!Number[_0x5b43ca(0x109)](_0x46ef02['batchSize'])||_0x46ef02[_0x5b43ca(0x120)]<0x1||_0x46ef02[_0x5b43ca(0x120)]>_0x2eb2de['maxBatchSize'])throw Error(_0x5b43ca(0xe6));for(const _0x2307c7 of _0x432048[_0x5b43ca(0xec)]){if(Buffer[_0x5b43ca(0x121)](JSON[_0x5b43ca(0xe4)]({'schemaFingerprint':_0x2eb2de[_0x5b43ca(0xb9)],'items':[{..._0x2307c7[_0x5b43ca(0x123)],'id':-0x1fffffffffffff}]}),_0x5b43ca(0x115))>_0x2eb2de[_0x5b43ca(0xfe)])throw Error(_0x5b43ca(0xc7)+_0x2307c7[_0x5b43ca(0x114)]+_0x5b43ca(0xc8));}assertImportPaths(_0x46ef02[_0x5b43ca(0xfb)],_0x46ef02[_0x5b43ca(0xda)]);const _0x2105ea={'appCode':_0x46ef02[_0x5b43ca(0x118)],'datasetCode':_0x46ef02[_0x5b43ca(0xd8)],'runtimeDomain':_0x46ef02[_0x5b43ca(0xee)],'actorId':_0x2eb2de['actorId'],'fileHash':_0x432048['fileHash'],'mappingHash':_0x432048[_0x5b43ca(0xef)],'schemaHash':_0x432048[_0x5b43ca(0x101)],'remoteSchemaHash':_0x2eb2de[_0x5b43ca(0xb9)],'batchSize':_0x46ef02[_0x5b43ca(0x120)],'sheet':_0x432048[_0x5b43ca(0xb8)]},_0x3de86c=await acquireLock(_0x46ef02[_0x5b43ca(0xfb)]);let _0x368be1;const _0x4bcf7f=Date[_0x5b43ca(0x100)]();let _0x1b9851=0x0;const _0x5727e1=[],_0x536270=()=>({'importId':_0x368be1?.[_0x5b43ca(0x125)],'sourceRows':_0x432048[_0x5b43ca(0xec)][_0x5b43ca(0xba)],'emptyRows':_0x432048[_0x5b43ca(0xd5)][_0x5b43ca(0xba)],'succeeded':_0x368be1?.[_0x5b43ca(0xec)][_0x5b43ca(0xf1)](_0x4f20c4=>_0x4f20c4[_0x5b43ca(0xbf)]===_0x5b43ca(0x126))[_0x5b43ca(0xba)]??0x0,'unknown':_0x368be1?.[_0x5b43ca(0xec)][_0x5b43ca(0xf1)](_0x4c3f96=>_0x4c3f96[_0x5b43ca(0xbf)]===_0x5b43ca(0x112))[_0x5b43ca(0xba)]??0x0,'conflicts':_0x368be1?.[_0x5b43ca(0xec)]['filter'](_0x1c46ef=>_0x1c46ef[_0x5b43ca(0xbf)]===_0x5b43ca(0xde))[_0x5b43ca(0xba)]??0x0,'notAttempted':_0x368be1?.['rows']['filter'](_0x1a8c1e=>_0x1a8c1e[_0x5b43ca(0xbf)]==='unsent')[_0x5b43ca(0xba)]??_0x432048[_0x5b43ca(0xec)][_0x5b43ca(0xba)],'batches':_0x1b9851,'batchResults':_0x5727e1,'elapsedMs':Date[_0x5b43ca(0x100)]()-_0x4bcf7f,'checkpoint':resolve(_0x46ef02['checkpoint']),'report':resolve(_0x46ef02[_0x5b43ca(0xda)]),'warnings':_0x432048[_0x5b43ca(0xce)]});try{await rejectSymlink(_0x46ef02['checkpoint']);if(_0x46ef02[_0x5b43ca(0xea)]){try{_0x368be1=JSON[_0x5b43ca(0x113)](await readFile(_0x46ef02[_0x5b43ca(0xfb)],'utf8'));}catch{throw Error('Cannot\x20read\x20the\x20import\x20checkpoint.');}if(!_0x368be1||_0x368be1['version']!==0x1||typeof _0x368be1['importId']!==_0x5b43ca(0xe0)||canonical(_0x368be1['binding'])!==canonical(_0x2105ea)||!Array[_0x5b43ca(0x104)](_0x368be1[_0x5b43ca(0xec)])||_0x368be1[_0x5b43ca(0xec)][_0x5b43ca(0xba)]!==_0x432048[_0x5b43ca(0xec)][_0x5b43ca(0xba)]||new Set(_0x368be1[_0x5b43ca(0xec)][_0x5b43ca(0xb5)](_0x125e35=>_0x125e35['id']))[_0x5b43ca(0xdf)]!==_0x368be1['rows'][_0x5b43ca(0xba)]||_0x368be1[_0x5b43ca(0xec)]['some']((_0x18c62d,_0x1829fe)=>!Number['isSafeInteger'](_0x18c62d['id'])||_0x18c62d['id']>=0x0||_0x18c62d['rowNumber']!==_0x432048['rows'][_0x1829fe][_0x5b43ca(0x114)]||![_0x5b43ca(0x102),_0x5b43ca(0x112),_0x5b43ca(0x126),_0x5b43ca(0xde)][_0x5b43ca(0x110)](_0x18c62d[_0x5b43ca(0xbf)])))throw Error(_0x5b43ca(0xd6));}else{try{await lstat(_0x46ef02['checkpoint']);throw Error(_0x5b43ca(0xb7));}catch(_0x36b59f){if(_0x36b59f[_0x5b43ca(0x11e)]!==_0x5b43ca(0xbe))throw _0x36b59f;}const _0x4413ee=new Set();_0x368be1={'version':0x1,'importId':randomUUID(),'binding':_0x2105ea,'rows':_0x432048[_0x5b43ca(0xec)][_0x5b43ca(0xb5)](_0x52cc23=>{const _0x4a974a=_0x5b43ca;let _0x1ca95c;do{_0x1ca95c=-(Number(BigInt('0x'+randomBytes(0x7)[_0x4a974a(0x117)]('hex'))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x4413ee['has'](_0x1ca95c));return _0x4413ee[_0x4a974a(0xf4)](_0x1ca95c),{'id':_0x1ca95c,'rowNumber':_0x52cc23[_0x4a974a(0x114)],'status':_0x4a974a(0x102)};})},await saveImportJson(_0x46ef02[_0x5b43ca(0xfb)],_0x368be1);}const _0x4b6abf=_0x368be1;if(_0x4b6abf[_0x5b43ca(0xec)][_0x5b43ca(0xdc)](_0x269f5d=>_0x269f5d[_0x5b43ca(0xbf)]==='conflict'))throw Error(_0x5b43ca(0xf6));const _0x5c64e4=async _0x3884d7=>{const _0x31d286=_0x5b43ca,_0x269251=await _0x2e924f[_0x31d286(0xca)](_0x3884d7['map'](_0x40c6e7=>_0x4b6abf[_0x31d286(0xec)][_0x40c6e7]['id']));if(!Array[_0x31d286(0x104)](_0x269251))throw Error(_0x31d286(0xfd));const _0x3c79c8=new Set(_0x3884d7[_0x31d286(0xb5)](_0x20580e=>_0x4b6abf[_0x31d286(0xec)][_0x20580e]['id'])),_0x5df5ab=new Map();for(const _0x381961 of _0x269251){const _0x30bcf9=Number(_0x381961?.['id']);if(!_0x3c79c8[_0x31d286(0x10a)](_0x30bcf9)||_0x5df5ab[_0x31d286(0x10a)](_0x30bcf9))throw Error(_0x31d286(0xd2));_0x5df5ab[_0x31d286(0xf2)](_0x30bcf9,_0x381961);}for(const _0x49a545 of _0x3884d7){const _0x1b7a18=_0x5df5ab['get'](_0x4b6abf[_0x31d286(0xec)][_0x49a545]['id']);if(!_0x1b7a18)continue;if(_0x4b6abf[_0x31d286(0xec)][_0x49a545][_0x31d286(0xbf)]==='unsent'){_0x4b6abf[_0x31d286(0xec)][_0x49a545][_0x31d286(0xbf)]=_0x31d286(0xde),await saveImportJson(_0x46ef02['checkpoint'],_0x4b6abf);throw Error(_0x31d286(0x111));}const _0x1a6990=_0x432048[_0x31d286(0xec)][_0x49a545][_0x31d286(0x123)];if(Object[_0x31d286(0xdd)](_0x1a6990)[_0x31d286(0xdc)](_0x211a60=>!sameImportValue(_0x1a6990[_0x211a60],_0x1b7a18[_0x211a60]))){_0x4b6abf['rows'][_0x49a545]['status']=_0x31d286(0xde),await saveImportJson(_0x46ef02[_0x31d286(0xfb)],_0x4b6abf);throw Error(_0x31d286(0x11a)+_0x4b6abf['rows'][_0x49a545][_0x31d286(0x114)]+'.');}_0x4b6abf['rows'][_0x49a545][_0x31d286(0xbf)]=_0x31d286(0x126);}return await saveImportJson(_0x46ef02[_0x31d286(0xfb)],_0x4b6abf),_0x5df5ab;};if(_0x46ef02[_0x5b43ca(0xea)])for(let _0x2676b1=0x0;_0x2676b1<_0x4b6abf[_0x5b43ca(0xec)][_0x5b43ca(0xba)];_0x2676b1+=_0x46ef02[_0x5b43ca(0x120)]){const _0x147061=_0x4b6abf[_0x5b43ca(0xec)][_0x5b43ca(0xcb)](_0x2676b1,_0x2676b1+_0x46ef02[_0x5b43ca(0x120)])[_0x5b43ca(0xb5)]((_0x31cd5f,_0x4d6c8d)=>_0x2676b1+_0x4d6c8d),_0x3e1e52=_0x147061[_0x5b43ca(0xf1)](_0x4a39e3=>_0x4b6abf[_0x5b43ca(0xec)][_0x4a39e3][_0x5b43ca(0xbf)]==='succeeded'),_0x5c9754=await _0x5c64e4(_0x147061),_0x3f6664=_0x3e1e52[_0x5b43ca(0xf1)](_0x26cb3d=>!_0x5c9754[_0x5b43ca(0x10a)](_0x4b6abf[_0x5b43ca(0xec)][_0x26cb3d]['id']));if(_0x3f6664[_0x5b43ca(0xba)]){_0x3f6664[_0x5b43ca(0xf5)](_0xcb6bd8=>{const _0x3d2c6d=_0x5b43ca;_0x4b6abf[_0x3d2c6d(0xec)][_0xcb6bd8][_0x3d2c6d(0xbf)]=_0x3d2c6d(0xde);}),await saveImportJson(_0x46ef02[_0x5b43ca(0xfb)],_0x4b6abf);throw Error(_0x5b43ca(0xdb));}}for(let _0x28627f=0x0;_0x28627f<_0x4b6abf[_0x5b43ca(0xec)]['length'];){const _0x47aae7=[],_0xec58f5=[];while(_0x28627f<_0x4b6abf['rows'][_0x5b43ca(0xba)]&&_0xec58f5[_0x5b43ca(0xba)]<_0x46ef02[_0x5b43ca(0x120)]){const _0x27d6cc=_0x28627f++;if(_0x4b6abf['rows'][_0x27d6cc][_0x5b43ca(0xbf)]===_0x5b43ca(0x126))continue;const _0x3fa8ea={..._0x432048[_0x5b43ca(0xec)][_0x27d6cc][_0x5b43ca(0x123)],'id':_0x4b6abf[_0x5b43ca(0xec)][_0x27d6cc]['id']};if(Buffer[_0x5b43ca(0x121)](JSON[_0x5b43ca(0xe4)]({'schemaFingerprint':_0x2eb2de['schemaFingerprint'],'items':[..._0xec58f5,_0x3fa8ea]}),_0x5b43ca(0x115))>_0x2eb2de[_0x5b43ca(0xfe)]){if(!_0xec58f5[_0x5b43ca(0xba)])throw Error(_0x5b43ca(0xc7)+_0x4b6abf[_0x5b43ca(0xec)][_0x27d6cc][_0x5b43ca(0x114)]+_0x5b43ca(0xc8));_0x28627f--;break;}_0x47aae7[_0x5b43ca(0xeb)](_0x27d6cc),_0xec58f5['push'](_0x3fa8ea);}if(!_0xec58f5['length'])continue;const _0x235be7=_0x47aae7[_0x5b43ca(0xf1)](_0x1619a3=>_0x4b6abf[_0x5b43ca(0xec)][_0x1619a3][_0x5b43ca(0xbf)]===_0x5b43ca(0x102));if(_0x235be7[_0x5b43ca(0xba)]){const _0x3f7b44=await _0x2e924f['readback'](_0x235be7[_0x5b43ca(0xb5)](_0x872768=>_0x4b6abf[_0x5b43ca(0xec)][_0x872768]['id']));if(!Array['isArray'](_0x3f7b44))throw Error('Invalid\x20import\x20readback\x20response.');if(_0x3f7b44[_0x5b43ca(0xba)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x47aae7[_0x5b43ca(0xf5)](_0x4c345e=>{const _0x2bf37c=_0x5b43ca;_0x4b6abf[_0x2bf37c(0xec)][_0x4c345e]['status']=_0x2bf37c(0x112);}),await saveImportJson(_0x46ef02[_0x5b43ca(0xfb)],_0x4b6abf),_0x1b9851++;const _0x41aa66=Date[_0x5b43ca(0x100)](),_0x35e03e={'batch':_0x1b9851,'rowStart':_0x4b6abf['rows'][_0x47aae7[0x0]]['rowNumber'],'rowEnd':_0x4b6abf['rows'][_0x47aae7[_0x47aae7['length']-0x1]][_0x5b43ca(0x114)],'count':_0xec58f5['length'],'bytes':Buffer[_0x5b43ca(0x121)](JSON[_0x5b43ca(0xe4)]({'schemaFingerprint':_0x2eb2de[_0x5b43ca(0xb9)],'items':_0xec58f5}),_0x5b43ca(0x115)),'elapsedMs':0x0,'status':_0x5b43ca(0xd0)};_0x5727e1['push'](_0x35e03e);try{const _0x4971e0=await _0x2e924f[_0x5b43ca(0xd9)](_0xec58f5);if(!_0x4971e0||_0x4971e0[_0x5b43ca(0xbb)]!==_0xec58f5['length']||!Array[_0x5b43ca(0x104)](_0x4971e0[_0x5b43ca(0xf9)])||_0x4971e0[_0x5b43ca(0xf9)][_0x5b43ca(0xba)]!==_0xec58f5[_0x5b43ca(0xba)]||_0x4971e0[_0x5b43ca(0xf9)][_0x5b43ca(0xdc)]((_0x58a041,_0x46e447)=>Number(_0x58a041)!==_0x4b6abf[_0x5b43ca(0xec)][_0x47aae7[_0x46e447]]['id']))throw Error(_0x5b43ca(0xe1));await _0x5c64e4(_0x47aae7);if(_0x47aae7[_0x5b43ca(0xdc)](_0x318551=>_0x4b6abf['rows'][_0x318551]['status']!=='succeeded'))throw Error('Incomplete\x20readback.');}catch(_0x281b95){if(_0x4b6abf['rows'][_0x5b43ca(0xdc)](_0x31bc0a=>_0x31bc0a[_0x5b43ca(0xbf)]===_0x5b43ca(0xde)))throw _0x281b95;try{await _0x5c64e4(_0x47aae7);}catch(_0x5453f9){if(_0x4b6abf[_0x5b43ca(0xec)][_0x5b43ca(0xdc)](_0x2b85bb=>_0x2b85bb['status']===_0x5b43ca(0xde)))throw _0x5453f9;}if(_0x47aae7[_0x5b43ca(0xdc)](_0x59e476=>_0x4b6abf[_0x5b43ca(0xec)][_0x59e476]['status']!==_0x5b43ca(0x126)))throw Error(_0x5b43ca(0x11d));}finally{_0x35e03e[_0x5b43ca(0x106)]=Date['now']()-_0x41aa66;if(_0x47aae7[_0x5b43ca(0x10f)](_0x1d20ed=>_0x4b6abf['rows'][_0x1d20ed][_0x5b43ca(0xbf)]===_0x5b43ca(0x126)))_0x35e03e[_0x5b43ca(0xbf)]=_0x5b43ca(0x126);else{if(_0x47aae7['some'](_0x339429=>_0x4b6abf[_0x5b43ca(0xec)][_0x339429][_0x5b43ca(0xbf)]===_0x5b43ca(0xde)))_0x35e03e[_0x5b43ca(0xbf)]=_0x5b43ca(0xde);}}}const _0x55b422={'status':_0x5b43ca(0xe5),..._0x536270()};return await saveImportJson(_0x46ef02[_0x5b43ca(0xda)],_0x55b422),_0x55b422;}catch(_0x310ca5){if(_0x368be1)await saveImportJson(_0x46ef02[_0x5b43ca(0xda)],{'status':_0x5b43ca(0xc1),..._0x536270(),'message':_0x310ca5[_0x5b43ca(0xd4)]});throw _0x310ca5;}finally{await _0x3de86c();}}
|
|
1
|
+
const a145_0x34202c=a145_0x48c5;(function(_0xddb386,_0x34f81c){const _0x3d0edb=a145_0x48c5,_0x5dcf14=_0xddb386();while(!![]){try{const _0x25da29=-parseInt(_0x3d0edb(0x18c))/0x1+parseInt(_0x3d0edb(0x1e3))/0x2+-parseInt(_0x3d0edb(0x1f1))/0x3*(-parseInt(_0x3d0edb(0x1f0))/0x4)+-parseInt(_0x3d0edb(0x1fc))/0x5+parseInt(_0x3d0edb(0x1ae))/0x6+-parseInt(_0x3d0edb(0x1a7))/0x7*(parseInt(_0x3d0edb(0x19e))/0x8)+-parseInt(_0x3d0edb(0x1aa))/0x9*(-parseInt(_0x3d0edb(0x186))/0xa);if(_0x25da29===_0x34f81c)break;else _0x5dcf14['push'](_0x5dcf14['shift']());}catch(_0x5efbbb){_0x5dcf14['push'](_0x5dcf14['shift']());}}}(a145_0x46aa,0x85d97));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(_0x74f9a0){const _0x478909=a145_0x48c5;if(Array[_0x478909(0x1ab)](_0x74f9a0))return'['+_0x74f9a0['map'](canonical)[_0x478909(0x1ef)](',')+']';if(_0x74f9a0&&typeof _0x74f9a0==='object')return'{'+Object[_0x478909(0x1ed)](_0x74f9a0)[_0x478909(0x1ad)]()[_0x478909(0x1a5)](_0x485bca=>JSON[_0x478909(0x1c3)](_0x485bca)+':'+canonical(_0x74f9a0[_0x485bca]))['join'](',')+'}';return JSON[_0x478909(0x1c3)](_0x74f9a0)??'undefined';}function a145_0x48c5(_0x2ca02b,_0x4a4b2c){_0x2ca02b=_0x2ca02b-0x181;const _0x46aa22=a145_0x46aa();let _0x48c509=_0x46aa22[_0x2ca02b];return _0x48c509;}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a145_0x34202c(0x1da),a145_0x34202c(0x184),'districtAdcode','district',a145_0x34202c(0x1b7),'road',a145_0x34202c(0x1c5),a145_0x34202c(0x1bc),'province','latitude',a145_0x34202c(0x189),a145_0x34202c(0x1d6),a145_0x34202c(0x19d),'streetNumber',a145_0x34202c(0x191),a145_0x34202c(0x197),a145_0x34202c(0x187),a145_0x34202c(0x183),'address','lbswuaCacheId']);export function sameImportValue(_0x171ff0,_0x7e2f24,_0x24fc19=![]){if(_0x24fc19){const _0x257455=_0x1bbdc2=>Array['isArray'](_0x1bbdc2)?_0x1bbdc2['map'](_0x3f7db8=>{const _0x446e82=a145_0x48c5;if(!_0x3f7db8||typeof _0x3f7db8!==_0x446e82(0x1cc)||Array['isArray'](_0x3f7db8))return _0x3f7db8;const _0x504d7e={..._0x3f7db8};delete _0x504d7e['url'],delete _0x504d7e[_0x446e82(0x1c7)];if(_0x504d7e[_0x446e82(0x1e7)]==='')delete _0x504d7e[_0x446e82(0x1e7)];if(_0x504d7e[_0x446e82(0x1d7)]==null)delete _0x504d7e[_0x446e82(0x1d7)];if(_0x504d7e[_0x446e82(0x1ba)]==null)delete _0x504d7e[_0x446e82(0x1ba)];if(_0x504d7e[_0x446e82(0x1cb)]==null||typeof _0x504d7e[_0x446e82(0x1cb)]===_0x446e82(0x1cc)&&!Array[_0x446e82(0x1ab)](_0x504d7e[_0x446e82(0x1cb)])&&Object[_0x446e82(0x1c9)](_0x504d7e['geolocation'])[_0x446e82(0x1b0)](([_0x360215,_0x563393])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x446e82(0x1a6)](_0x360215)&&_0x563393===null))delete _0x504d7e[_0x446e82(0x1cb)];for(const _0x39d0fc of[_0x446e82(0x1ec),_0x446e82(0x1bb),_0x446e82(0x19c)])if(!(_0x39d0fc in _0x504d7e))_0x504d7e[_0x39d0fc]='';if(_0x504d7e[_0x446e82(0x1a9)]==null)_0x504d7e[_0x446e82(0x1a9)]=0x0;return _0x504d7e;}):_0x1bbdc2;return canonical(_0x257455(_0x171ff0))===canonical(_0x257455(_0x7e2f24));}return _0x171ff0===null?_0x7e2f24===null||_0x7e2f24===undefined:canonical(_0x7e2f24)===canonical(_0x171ff0);}async function rejectSymlink(_0x5d9e2a){const _0x32187f=a145_0x34202c;try{if((await lstat(_0x5d9e2a))[_0x32187f(0x18d)]())throw Error(_0x32187f(0x1fe));}catch(_0x39e73d){if(_0x39e73d[_0x32187f(0x1e2)]!==_0x32187f(0x1e4))throw _0x39e73d;}}export async function resolveImportOutputPath(_0x4bf68b){return await rejectSymlink(_0x4bf68b),resolve(await realpath(dirname(resolve(_0x4bf68b))),basename(_0x4bf68b));}export function assertImportPaths(_0x33600b,_0x16bd44,_0x5c72f2=[]){const _0x4511ba=a145_0x34202c,_0x5bfb0=[..._0x5c72f2,_0x33600b,_0x16bd44,_0x33600b+'.lock',_0x33600b+'.lock.recovery'][_0x4511ba(0x1a5)](_0xab1fd=>resolve(_0xab1fd));if(new Set(_0x5bfb0)[_0x4511ba(0x1a9)]!==_0x5bfb0['length'])throw Error('Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.');}function a145_0x46aa(){const _0x50346a=['Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','version','close','netType','createUserId','kill','values','time','pid','Invalid\x20import\x20readback\x20response.','isSafeInteger','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','warnings','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','Invalid\x20write\x20result.','code','1907558jnRmyT','ENOENT','writeFile','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','dingTalkUrl','actorId','unsent','Invalid\x20import\x20batch\x20size.','datasetCode','name','keys','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','join','8yppGoh','82107FamNDK','rowNumber','pending','schemaVersion','EEXIST','ids','utf8','mappingHash','get','byteLength','appCode','800940Jlrrdu','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','add','rows','ESRCH','set','errorMessage','operatorType','.recovery','915440iAjbps','cityAdcode','string','city','succeeded','source','680162WQpWWI','isSymbolicLink','batchSize','Invalid\x20import\x20lock\x20owner.','length','accuracy','forEach','some','write','message','report','longitude','push','sync','uploadFields','now','key','resultCode','8CSuehs','includes','readback','schemaHash','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','Cannot\x20read\x20the\x20import\x20checkpoint.','parse','map','has','3604993VPHbUC','toString','size','54YqBQdD','isArray','count','sort','2074890IGAEVc','checkpoint','every','emptyRows','completed','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','fileHash','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','binding','pois','importId','incomplete','createUserName','type','countryCode','token','conflict','status','schemaFingerprint','filter','hex','stringify','Excel\x20contains\x20no\x20valid\x20data\x20rows.','country','maxBatchBytes','previewUrl','maxBatchSize','entries','resume','geolocation','object','Import\x20lock\x20changed;\x20retry\x20recovery.','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','sheet','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','Excel\x20row\x20'];a145_0x46aa=function(){return _0x50346a;};return a145_0x46aa();}export async function saveImportJson(_0x4589df,_0x345e12){const _0x431702=a145_0x34202c;await rejectSymlink(_0x4589df);const _0x4ddd3a=_0x4589df+'.tmp-'+randomUUID(),_0x245094=await open(_0x4ddd3a,'wx',0x180);try{await _0x245094[_0x431702(0x1e5)](JSON['stringify'](_0x345e12,null,0x2)),await _0x245094['sync']();}finally{await _0x245094['close']();}try{await rename(_0x4ddd3a,_0x4589df);}catch(_0x18362c){await unlink(_0x4ddd3a)['catch'](()=>{});throw _0x18362c;}}export async function acquireLock(_0x5c89e8){const _0x3361ec=a145_0x34202c,_0x21cdb4=_0x5c89e8+'.lock',_0x26c297=randomUUID();await rejectSymlink(_0x21cdb4);const _0x40bf70=_0x21cdb4+_0x3361ec(0x185);let _0x426338,_0x489037;try{try{_0x426338=await open(_0x21cdb4,'wx',0x180);}catch(_0x3d111f){if(_0x3d111f[_0x3361ec(0x1e2)]!==_0x3361ec(0x1f5))throw _0x3d111f;try{_0x489037=await open(_0x40bf70,'wx',0x180);}catch(_0x2be616){if(_0x2be616[_0x3361ec(0x1e2)]===_0x3361ec(0x1f5))throw Error(_0x3361ec(0x1de));throw _0x2be616;}await _0x489037['writeFile'](JSON['stringify']({'pid':process[_0x3361ec(0x1db)],'token':_0x26c297})),await _0x489037[_0x3361ec(0x199)](),await rejectSymlink(_0x21cdb4);let _0x196654;try{_0x196654=await readFile(_0x21cdb4,_0x3361ec(0x1f7));}catch(_0x36a8e8){if(_0x36a8e8[_0x3361ec(0x1e2)]!==_0x3361ec(0x1e4))throw _0x36a8e8;}if(_0x196654!==undefined){let _0xfd89ff;try{_0xfd89ff=JSON[_0x3361ec(0x1a4)](_0x196654);}catch{throw Error(_0x3361ec(0x1e6));}if(!_0xfd89ff||!Number[_0x3361ec(0x1dd)](_0xfd89ff[_0x3361ec(0x1db)])||_0xfd89ff[_0x3361ec(0x1db)]<=0x0)throw Error(_0x3361ec(0x18f));try{process[_0x3361ec(0x1d8)](_0xfd89ff[_0x3361ec(0x1db)],0x0);throw Error(_0x3361ec(0x1d3));}catch(_0x47e667){if(_0x47e667[_0x3361ec(0x1e2)]!==_0x3361ec(0x181))throw _0x47e667;}if(await readFile(_0x21cdb4,_0x3361ec(0x1f7))!==_0x196654)throw Error(_0x3361ec(0x1cd));await unlink(_0x21cdb4);}_0x426338=await open(_0x21cdb4,'wx',0x180);}await _0x426338['writeFile'](JSON[_0x3361ec(0x1c3)]({'pid':process[_0x3361ec(0x1db)],'token':_0x26c297})),await _0x426338[_0x3361ec(0x199)]();}finally{try{await _0x426338?.[_0x3361ec(0x1d5)]();}finally{if(_0x489037)try{await _0x489037[_0x3361ec(0x1d5)]();}finally{await unlink(_0x40bf70);}}}return async()=>{const _0x553287=_0x3361ec;if(JSON[_0x553287(0x1a4)](await readFile(_0x21cdb4,_0x553287(0x1f7)))[_0x553287(0x1bd)]===_0x26c297)await unlink(_0x21cdb4);};}export function assertImportContract(_0x4b3eb5,_0x574759,_0x2714be){const _0x52a95a=a145_0x34202c;if(!_0x4b3eb5||!(_0x4b3eb5[_0x52a95a(0x1f4)]===0x1&&_0x4b3eb5['strategy']==='fixed-negative-id'||_0x4b3eb5[_0x52a95a(0x1f4)]===0x2&&_0x4b3eb5['strategy']==='auto-id-task-marker')||_0x4b3eb5[_0x52a95a(0x18b)]!=='METADATA'||_0x4b3eb5['appCode']!==_0x574759||_0x4b3eb5['datasetCode']!==_0x2714be||typeof _0x4b3eb5['actorId']!==_0x52a95a(0x188)||!_0x4b3eb5[_0x52a95a(0x1e8)]||typeof _0x4b3eb5[_0x52a95a(0x1c0)]!==_0x52a95a(0x188)||!_0x4b3eb5[_0x52a95a(0x1c0)]||!Number[_0x52a95a(0x1dd)](_0x4b3eb5[_0x52a95a(0x1c8)])||_0x4b3eb5[_0x52a95a(0x1c8)]<0x1||_0x4b3eb5[_0x52a95a(0x1c8)]>0x3e8||!Number[_0x52a95a(0x1dd)](_0x4b3eb5[_0x52a95a(0x1c6)])||_0x4b3eb5[_0x52a95a(0x1c6)]<0x1||_0x4b3eb5['maxBatchBytes']>0x14*0x400*0x400)throw Error(_0x52a95a(0x1ee));}export async function runExcelImport(_0x3d9364){const _0x3f7b9c=a145_0x34202c;_0x3d9364={..._0x3d9364,'checkpoint':await resolveImportOutputPath(_0x3d9364['checkpoint']),'report':await resolveImportOutputPath(_0x3d9364[_0x3f7b9c(0x196)])};const {manifest:_0x4a1180,contract:_0x51903d,api:_0x5bf7e0}=_0x3d9364;assertImportContract(_0x51903d,_0x3d9364[_0x3f7b9c(0x1fb)],_0x3d9364[_0x3f7b9c(0x1eb)]);if(_0x51903d[_0x3f7b9c(0x1f4)]!==0x1)throw Error(_0x3f7b9c(0x1b3));if(_0x4a1180['errors'][_0x3f7b9c(0x190)])throw Error(_0x3f7b9c(0x1d0));if(!_0x4a1180[_0x3f7b9c(0x200)]['length'])throw Error(_0x3f7b9c(0x1c4));if(!Number['isInteger'](_0x3d9364[_0x3f7b9c(0x18e)])||_0x3d9364[_0x3f7b9c(0x18e)]<0x1||_0x3d9364[_0x3f7b9c(0x18e)]>_0x51903d[_0x3f7b9c(0x1c8)])throw Error(_0x3f7b9c(0x1ea));for(const _0x4b9178 of _0x4a1180[_0x3f7b9c(0x200)]){if(Buffer[_0x3f7b9c(0x1fa)](JSON['stringify']({'schemaFingerprint':_0x51903d[_0x3f7b9c(0x1c0)],'items':[{..._0x4b9178['values'],'id':-0x1fffffffffffff}]}),'utf8')>_0x51903d[_0x3f7b9c(0x1c6)])throw Error(_0x3f7b9c(0x1d1)+_0x4b9178[_0x3f7b9c(0x1f2)]+_0x3f7b9c(0x1fd));}assertImportPaths(_0x3d9364[_0x3f7b9c(0x1af)],_0x3d9364[_0x3f7b9c(0x196)]);const _0x3eddc1={'appCode':_0x3d9364[_0x3f7b9c(0x1fb)],'datasetCode':_0x3d9364[_0x3f7b9c(0x1eb)],'runtimeDomain':_0x3d9364['runtimeDomain'],'actorId':_0x51903d[_0x3f7b9c(0x1e8)],'fileHash':_0x4a1180[_0x3f7b9c(0x1b4)],'mappingHash':_0x4a1180[_0x3f7b9c(0x1f8)],'schemaHash':_0x4a1180[_0x3f7b9c(0x1a1)],'remoteSchemaHash':_0x51903d['schemaFingerprint'],'batchSize':_0x3d9364[_0x3f7b9c(0x18e)],'sheet':_0x4a1180[_0x3f7b9c(0x1cf)]},_0x185c56=await acquireLock(_0x3d9364[_0x3f7b9c(0x1af)]);let _0x20e392;const _0x5300f2=Date[_0x3f7b9c(0x19b)]();let _0x302acd=0x0;const _0x1bf354=[],_0x69e92b=()=>({'importId':_0x20e392?.[_0x3f7b9c(0x1b8)],'sourceRows':_0x4a1180['rows']['length'],'emptyRows':_0x4a1180[_0x3f7b9c(0x1b1)][_0x3f7b9c(0x190)],'succeeded':_0x20e392?.[_0x3f7b9c(0x200)][_0x3f7b9c(0x1c1)](_0x4e4fd4=>_0x4e4fd4[_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x18a))[_0x3f7b9c(0x190)]??0x0,'unknown':_0x20e392?.[_0x3f7b9c(0x200)][_0x3f7b9c(0x1c1)](_0x8a156b=>_0x8a156b[_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x1f3))[_0x3f7b9c(0x190)]??0x0,'conflicts':_0x20e392?.['rows'][_0x3f7b9c(0x1c1)](_0x48a0ad=>_0x48a0ad[_0x3f7b9c(0x1bf)]==='conflict')['length']??0x0,'notAttempted':_0x20e392?.[_0x3f7b9c(0x200)][_0x3f7b9c(0x1c1)](_0x12a783=>_0x12a783[_0x3f7b9c(0x1bf)]==='unsent')[_0x3f7b9c(0x190)]??_0x4a1180[_0x3f7b9c(0x200)]['length'],'batches':_0x302acd,'batchResults':_0x1bf354,'elapsedMs':Date[_0x3f7b9c(0x19b)]()-_0x5300f2,'checkpoint':resolve(_0x3d9364[_0x3f7b9c(0x1af)]),'report':resolve(_0x3d9364[_0x3f7b9c(0x196)]),'warnings':_0x4a1180[_0x3f7b9c(0x1df)]});try{await rejectSymlink(_0x3d9364[_0x3f7b9c(0x1af)]);if(_0x3d9364['resume']){try{_0x20e392=JSON[_0x3f7b9c(0x1a4)](await readFile(_0x3d9364[_0x3f7b9c(0x1af)],'utf8'));}catch{throw Error(_0x3f7b9c(0x1a3));}if(!_0x20e392||_0x20e392[_0x3f7b9c(0x1d4)]!==0x1||typeof _0x20e392['importId']!==_0x3f7b9c(0x188)||canonical(_0x20e392[_0x3f7b9c(0x1b6)])!==canonical(_0x3eddc1)||!Array[_0x3f7b9c(0x1ab)](_0x20e392[_0x3f7b9c(0x200)])||_0x20e392[_0x3f7b9c(0x200)][_0x3f7b9c(0x190)]!==_0x4a1180[_0x3f7b9c(0x200)]['length']||new Set(_0x20e392['rows'][_0x3f7b9c(0x1a5)](_0x50ffcb=>_0x50ffcb['id']))[_0x3f7b9c(0x1a9)]!==_0x20e392[_0x3f7b9c(0x200)]['length']||_0x20e392[_0x3f7b9c(0x200)]['some']((_0x4020bc,_0x38d138)=>!Number['isSafeInteger'](_0x4020bc['id'])||_0x4020bc['id']>=0x0||_0x4020bc[_0x3f7b9c(0x1f2)]!==_0x4a1180[_0x3f7b9c(0x200)][_0x38d138][_0x3f7b9c(0x1f2)]||!['unsent','pending',_0x3f7b9c(0x18a),_0x3f7b9c(0x1be)][_0x3f7b9c(0x19f)](_0x4020bc[_0x3f7b9c(0x1bf)])))throw Error(_0x3f7b9c(0x1a2));}else{try{await lstat(_0x3d9364['checkpoint']);throw Error('Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.');}catch(_0x5c7f83){if(_0x5c7f83[_0x3f7b9c(0x1e2)]!==_0x3f7b9c(0x1e4))throw _0x5c7f83;}const _0x403c06=new Set();_0x20e392={'version':0x1,'importId':randomUUID(),'binding':_0x3eddc1,'rows':_0x4a1180[_0x3f7b9c(0x200)]['map'](_0x5cf589=>{const _0x42c84e=_0x3f7b9c;let _0x30ff14;do{_0x30ff14=-(Number(BigInt('0x'+randomBytes(0x7)[_0x42c84e(0x1a8)](_0x42c84e(0x1c2)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x403c06[_0x42c84e(0x1a6)](_0x30ff14));return _0x403c06[_0x42c84e(0x1ff)](_0x30ff14),{'id':_0x30ff14,'rowNumber':_0x5cf589[_0x42c84e(0x1f2)],'status':_0x42c84e(0x1e9)};})},await saveImportJson(_0x3d9364[_0x3f7b9c(0x1af)],_0x20e392);}await _0x3d9364['onCheckpointReady']?.();const _0x23e198=_0x20e392;if(_0x23e198[_0x3f7b9c(0x200)][_0x3f7b9c(0x193)](_0x4001ac=>_0x4001ac[_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x1be)))throw Error(_0x3f7b9c(0x1d2));const _0x509815=async _0x58be9b=>{const _0x10472e=_0x3f7b9c,_0x33bb32=await _0x5bf7e0[_0x10472e(0x1a0)](_0x58be9b[_0x10472e(0x1a5)](_0x15a927=>_0x23e198['rows'][_0x15a927]['id']));if(!Array[_0x10472e(0x1ab)](_0x33bb32))throw Error(_0x10472e(0x1dc));const _0x41c913=new Set(_0x58be9b[_0x10472e(0x1a5)](_0x1b396f=>_0x23e198[_0x10472e(0x200)][_0x1b396f]['id'])),_0x59e907=new Map();for(const _0x40a9e3 of _0x33bb32){const _0x537260=Number(_0x40a9e3?.['id']);if(!_0x41c913[_0x10472e(0x1a6)](_0x537260)||_0x59e907[_0x10472e(0x1a6)](_0x537260))throw Error('Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.');_0x59e907[_0x10472e(0x182)](_0x537260,_0x40a9e3);}for(const _0x40ff2d of _0x58be9b){const _0x374aae=_0x59e907[_0x10472e(0x1f9)](_0x23e198['rows'][_0x40ff2d]['id']);if(!_0x374aae)continue;if(_0x23e198[_0x10472e(0x200)][_0x40ff2d][_0x10472e(0x1bf)]===_0x10472e(0x1e9)){_0x23e198[_0x10472e(0x200)][_0x40ff2d][_0x10472e(0x1bf)]='conflict',await saveImportJson(_0x3d9364['checkpoint'],_0x23e198);throw Error(_0x10472e(0x1ce));}const _0x101f6a=_0x4a1180[_0x10472e(0x200)][_0x40ff2d][_0x10472e(0x1d9)];if(Object[_0x10472e(0x1ed)](_0x101f6a)[_0x10472e(0x193)](_0x508068=>!sameImportValue(_0x101f6a[_0x508068],_0x374aae[_0x508068],_0x4a1180['imageFields']?.[_0x10472e(0x19f)](_0x508068)&&!_0x4a1180[_0x10472e(0x19a)]?.[_0x10472e(0x19f)](_0x508068)))){_0x23e198['rows'][_0x40ff2d]['status']=_0x10472e(0x1be),await saveImportJson(_0x3d9364['checkpoint'],_0x23e198);throw Error('Import\x20content\x20conflict\x20at\x20Excel\x20row\x20'+_0x23e198[_0x10472e(0x200)][_0x40ff2d][_0x10472e(0x1f2)]+'.');}_0x23e198[_0x10472e(0x200)][_0x40ff2d]['status']=_0x10472e(0x18a);}return await saveImportJson(_0x3d9364[_0x10472e(0x1af)],_0x23e198),_0x59e907;};if(_0x3d9364[_0x3f7b9c(0x1ca)])for(let _0xcde895=0x0;_0xcde895<_0x23e198[_0x3f7b9c(0x200)]['length'];_0xcde895+=_0x3d9364[_0x3f7b9c(0x18e)]){const _0x1b3664=_0x23e198['rows']['slice'](_0xcde895,_0xcde895+_0x3d9364[_0x3f7b9c(0x18e)])['map']((_0x2dcfa9,_0x3335eb)=>_0xcde895+_0x3335eb),_0x1035ec=_0x1b3664[_0x3f7b9c(0x1c1)](_0x1d3aff=>_0x23e198[_0x3f7b9c(0x200)][_0x1d3aff][_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x18a)),_0x365166=await _0x509815(_0x1b3664),_0x1dd1cf=_0x1035ec[_0x3f7b9c(0x1c1)](_0x3971eb=>!_0x365166[_0x3f7b9c(0x1a6)](_0x23e198['rows'][_0x3971eb]['id']));if(_0x1dd1cf[_0x3f7b9c(0x190)]){_0x1dd1cf[_0x3f7b9c(0x192)](_0x403732=>{const _0x4d3514=_0x3f7b9c;_0x23e198['rows'][_0x403732][_0x4d3514(0x1bf)]='conflict';}),await saveImportJson(_0x3d9364['checkpoint'],_0x23e198);throw Error(_0x3f7b9c(0x1e0));}}for(let _0x5a2b44=0x0;_0x5a2b44<_0x23e198[_0x3f7b9c(0x200)][_0x3f7b9c(0x190)];){const _0x25c6b9=[],_0xfc0809=[];while(_0x5a2b44<_0x23e198['rows'][_0x3f7b9c(0x190)]&&_0xfc0809[_0x3f7b9c(0x190)]<_0x3d9364['batchSize']){const _0x3b6499=_0x5a2b44++;if(_0x23e198['rows'][_0x3b6499]['status']===_0x3f7b9c(0x18a))continue;const _0x2a2c69={..._0x4a1180['rows'][_0x3b6499][_0x3f7b9c(0x1d9)],'id':_0x23e198[_0x3f7b9c(0x200)][_0x3b6499]['id']};if(Buffer[_0x3f7b9c(0x1fa)](JSON['stringify']({'schemaFingerprint':_0x51903d[_0x3f7b9c(0x1c0)],'items':[..._0xfc0809,_0x2a2c69]}),'utf8')>_0x51903d[_0x3f7b9c(0x1c6)]){if(!_0xfc0809['length'])throw Error(_0x3f7b9c(0x1d1)+_0x23e198[_0x3f7b9c(0x200)][_0x3b6499][_0x3f7b9c(0x1f2)]+_0x3f7b9c(0x1fd));_0x5a2b44--;break;}_0x25c6b9[_0x3f7b9c(0x198)](_0x3b6499),_0xfc0809['push'](_0x2a2c69);}if(!_0xfc0809[_0x3f7b9c(0x190)])continue;const _0xde6176=_0x25c6b9['filter'](_0x53003b=>_0x23e198[_0x3f7b9c(0x200)][_0x53003b][_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x1e9));if(_0xde6176['length']){const _0x46a43e=await _0x5bf7e0[_0x3f7b9c(0x1a0)](_0xde6176[_0x3f7b9c(0x1a5)](_0x52a8b1=>_0x23e198[_0x3f7b9c(0x200)][_0x52a8b1]['id']));if(!Array[_0x3f7b9c(0x1ab)](_0x46a43e))throw Error(_0x3f7b9c(0x1dc));if(_0x46a43e[_0x3f7b9c(0x190)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x25c6b9[_0x3f7b9c(0x192)](_0x5b5be9=>{const _0x4b768f=_0x3f7b9c;_0x23e198[_0x4b768f(0x200)][_0x5b5be9]['status']=_0x4b768f(0x1f3);}),await saveImportJson(_0x3d9364[_0x3f7b9c(0x1af)],_0x23e198),_0x302acd++;const _0x91bf76=Date['now'](),_0x284b4c={'batch':_0x302acd,'rowStart':_0x23e198[_0x3f7b9c(0x200)][_0x25c6b9[0x0]][_0x3f7b9c(0x1f2)],'rowEnd':_0x23e198[_0x3f7b9c(0x200)][_0x25c6b9[_0x25c6b9[_0x3f7b9c(0x190)]-0x1]][_0x3f7b9c(0x1f2)],'count':_0xfc0809[_0x3f7b9c(0x190)],'bytes':Buffer[_0x3f7b9c(0x1fa)](JSON['stringify']({'schemaFingerprint':_0x51903d[_0x3f7b9c(0x1c0)],'items':_0xfc0809}),_0x3f7b9c(0x1f7)),'elapsedMs':0x0,'status':'unknown'};_0x1bf354[_0x3f7b9c(0x198)](_0x284b4c);try{const _0x4332d6=await _0x5bf7e0[_0x3f7b9c(0x194)](_0xfc0809);if(!_0x4332d6||_0x4332d6[_0x3f7b9c(0x1ac)]!==_0xfc0809[_0x3f7b9c(0x190)]||!Array[_0x3f7b9c(0x1ab)](_0x4332d6[_0x3f7b9c(0x1f6)])||_0x4332d6[_0x3f7b9c(0x1f6)][_0x3f7b9c(0x190)]!==_0xfc0809[_0x3f7b9c(0x190)]||_0x4332d6[_0x3f7b9c(0x1f6)]['some']((_0xa93ae0,_0x12e110)=>Number(_0xa93ae0)!==_0x23e198[_0x3f7b9c(0x200)][_0x25c6b9[_0x12e110]]['id']))throw Error(_0x3f7b9c(0x1e1));await _0x509815(_0x25c6b9);if(_0x25c6b9[_0x3f7b9c(0x193)](_0x1ffd66=>_0x23e198[_0x3f7b9c(0x200)][_0x1ffd66]['status']!==_0x3f7b9c(0x18a)))throw Error('Incomplete\x20readback.');}catch(_0x3836b0){if(_0x23e198[_0x3f7b9c(0x200)][_0x3f7b9c(0x193)](_0x303405=>_0x303405[_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x1be)))throw _0x3836b0;try{await _0x509815(_0x25c6b9);}catch(_0x70bfdf){if(_0x23e198['rows'][_0x3f7b9c(0x193)](_0x3a155c=>_0x3a155c['status']===_0x3f7b9c(0x1be)))throw _0x70bfdf;}if(_0x25c6b9['some'](_0x5d36b3=>_0x23e198[_0x3f7b9c(0x200)][_0x5d36b3][_0x3f7b9c(0x1bf)]!==_0x3f7b9c(0x18a)))throw Error(_0x3f7b9c(0x1b5));}finally{_0x284b4c['elapsedMs']=Date[_0x3f7b9c(0x19b)]()-_0x91bf76;if(_0x25c6b9['every'](_0x668fab=>_0x23e198['rows'][_0x668fab]['status']===_0x3f7b9c(0x18a)))_0x284b4c[_0x3f7b9c(0x1bf)]=_0x3f7b9c(0x18a);else{if(_0x25c6b9['some'](_0x21b8b8=>_0x23e198[_0x3f7b9c(0x200)][_0x21b8b8]['status']==='conflict'))_0x284b4c[_0x3f7b9c(0x1bf)]=_0x3f7b9c(0x1be);}}}const _0x25f053={'status':_0x3f7b9c(0x1b2),..._0x69e92b()};return await saveImportJson(_0x3d9364[_0x3f7b9c(0x196)],_0x25f053),_0x25f053;}catch(_0x550654){if(_0x20e392)await saveImportJson(_0x3d9364[_0x3f7b9c(0x196)],{'status':_0x3f7b9c(0x1b9),..._0x69e92b(),'message':_0x550654[_0x3f7b9c(0x195)]});throw _0x550654;}finally{await _0x185c56();}}
|
|
@@ -4,9 +4,30 @@ export interface ImportField {
|
|
|
4
4
|
required: boolean;
|
|
5
5
|
generated?: boolean;
|
|
6
6
|
}
|
|
7
|
+
export interface ImportImageValue {
|
|
8
|
+
name: string;
|
|
9
|
+
type: string;
|
|
10
|
+
key: string;
|
|
11
|
+
size: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ImportUploadValue {
|
|
14
|
+
fileName: string;
|
|
15
|
+
filePath: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ImportMedia {
|
|
18
|
+
contentHash: string;
|
|
19
|
+
type: string;
|
|
20
|
+
size: number;
|
|
21
|
+
bytes: Buffer;
|
|
22
|
+
}
|
|
23
|
+
export interface ImportImageCell {
|
|
24
|
+
rowNumber: number;
|
|
25
|
+
field: string;
|
|
26
|
+
hashes: string[];
|
|
27
|
+
}
|
|
7
28
|
export interface ImportRow {
|
|
8
29
|
rowNumber: number;
|
|
9
|
-
values: Record<string, string | number | boolean | null>;
|
|
30
|
+
values: Record<string, string | number | boolean | null | (ImportImageValue | ImportUploadValue)[]>;
|
|
10
31
|
}
|
|
11
32
|
export interface ImportValidationError {
|
|
12
33
|
rowNumber: number;
|
|
@@ -27,6 +48,12 @@ export interface ExcelManifest {
|
|
|
27
48
|
schemaHash: string;
|
|
28
49
|
sheet: string;
|
|
29
50
|
rows: ImportRow[];
|
|
51
|
+
imageFields?: string[];
|
|
52
|
+
media?: ImportMedia[];
|
|
53
|
+
imageCells?: ImportImageCell[];
|
|
54
|
+
parserVersion?: number;
|
|
55
|
+
/** 使用标准附件值的字段;缺省保持历史 IMAGE 检查点协议。 */
|
|
56
|
+
uploadFields?: string[];
|
|
30
57
|
emptyRows: number[];
|
|
31
58
|
errors: ImportValidationError[];
|
|
32
59
|
warnings: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a144_0x527771=a144_0x2b5f;function a144_0x2b5f(_0x5cd8f4,_0x591bb8){_0x5cd8f4=_0x5cd8f4-0x19f;const _0x45981b=a144_0x4598();let _0x2b5fdb=_0x45981b[_0x5cd8f4];return _0x2b5fdb;}(function(_0x1dfeb3,_0x3a4628){const _0x2387a3=a144_0x2b5f,_0x3d8af7=_0x1dfeb3();while(!![]){try{const _0x2a1f99=-parseInt(_0x2387a3(0x1c8))/0x1*(parseInt(_0x2387a3(0x1dc))/0x2)+parseInt(_0x2387a3(0x1c9))/0x3+-parseInt(_0x2387a3(0x1d0))/0x4*(-parseInt(_0x2387a3(0x1b0))/0x5)+parseInt(_0x2387a3(0x1d3))/0x6+parseInt(_0x2387a3(0x1b9))/0x7+-parseInt(_0x2387a3(0x1d7))/0x8+parseInt(_0x2387a3(0x1a1))/0x9;if(_0x2a1f99===_0x3a4628)break;else _0x3d8af7['push'](_0x3d8af7['shift']());}catch(_0x46acb4){_0x3d8af7['push'](_0x3d8af7['shift']());}}}(a144_0x4598,0x94c7e));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a144_0x527771(0x19f),SKILL_NAME=a144_0x527771(0x1c1),debug=debuglog(a144_0x527771(0x1c0));function frontmatterValue(_0x477eef,_0x117f96){const _0x2817fe=a144_0x527771;return _0x477eef['match'](new RegExp('^'+_0x117f96+_0x2817fe(0x1a7),'m'))?.[0x1]?.[_0x2817fe(0x1e1)]()??'';}function listFiles(_0x2d3623,_0x5bc19b=_0x2d3623){return readdirSync(_0x5bc19b,{'withFileTypes':!![]})['flatMap'](_0x33c092=>{const _0x1ba969=a144_0x2b5f,_0x5edb15=join(_0x5bc19b,_0x33c092[_0x1ba969(0x1c3)]),_0x1235dd=lstatSync(_0x5edb15);if(_0x1235dd[_0x1ba969(0x1b2)]())throw new Error(_0x1ba969(0x1a8)+_0x5edb15);if(_0x1235dd[_0x1ba969(0x1b8)]())return listFiles(_0x2d3623,_0x5edb15);if(!_0x1235dd[_0x1ba969(0x1dd)]())throw new Error(_0x1ba969(0x1d5)+_0x5edb15);return[relative(_0x2d3623,_0x5edb15)[_0x1ba969(0x1ad)](sep)[_0x1ba969(0x1a0)]('/')];})['sort']((_0x328b78,_0x15d7e2)=>_0x328b78<_0x15d7e2?-0x1:_0x328b78>_0x15d7e2?0x1:0x0);}function digestFiles(_0x56eb59,_0x54bd83){const _0x21722a=a144_0x527771,_0x2e4ecd=createHash('sha256');for(const _0x1e08d6 of _0x54bd83){if(_0x1e08d6[_0x21722a(0x1ce)]('/')||_0x1e08d6[_0x21722a(0x1ad)]('/')['includes']('..')||_0x1e08d6[_0x21722a(0x1d9)]('\x5c'))throw new Error(_0x21722a(0x1cb)+_0x1e08d6);_0x2e4ecd[_0x21722a(0x1c5)](_0x1e08d6),_0x2e4ecd[_0x21722a(0x1c5)]('\x00'),_0x2e4ecd[_0x21722a(0x1c5)](readFileSync(join(_0x56eb59,..._0x1e08d6['split']('/')))),_0x2e4ecd[_0x21722a(0x1c5)]('\x00');}return _0x2e4ecd[_0x21722a(0x1bb)](_0x21722a(0x1db));}function sameFiles(_0x33040f,_0x1a578a){const _0x416ef8=a144_0x527771;return _0x33040f[_0x416ef8(0x1a6)]===_0x1a578a['length']&&_0x33040f['every']((_0x53901c,_0x1f8e67)=>_0x53901c===_0x1a578a[_0x1f8e67]);}function readSource(_0x3db1d6){const _0xaa0f62=a144_0x527771,_0x3c3d9f=JSON[_0xaa0f62(0x1b1)](readFileSync(join(_0x3db1d6,_0xaa0f62(0x1da)),_0xaa0f62(0x1b6))),_0x4790af=JSON[_0xaa0f62(0x1b1)](readFileSync(join(_0x3db1d6,_0xaa0f62(0x1bc),_0xaa0f62(0x1a9)),'utf8')),_0x249e31=join(_0x3db1d6,_0xaa0f62(0x1bc),SKILL_NAME),_0xdbb6f9=frontmatterValue(readFileSync(join(_0x249e31,'SKILL.md'),_0xaa0f62(0x1b6)),_0xaa0f62(0x1e0)),_0x322959=listFiles(_0x249e31);if(_0x4790af[_0xaa0f62(0x1ae)]!==0x1||_0x4790af['name']!==SKILL_NAME||!_0x3c3d9f['version']||_0x4790af[_0xaa0f62(0x1c2)]!==_0x3c3d9f['version']||_0x4790af[_0xaa0f62(0x1b4)]!==_0x3c3d9f[_0xaa0f62(0x1e0)]||_0xdbb6f9!==_0x3c3d9f[_0xaa0f62(0x1e0)]||!sameFiles(_0x322959,_0x4790af['files'])||digestFiles(_0x249e31,_0x322959)!==_0x4790af['digest'])throw new Error(_0xaa0f62(0x1e2));return{'packageVersion':_0x3c3d9f[_0xaa0f62(0x1e0)],'skillVersion':_0xdbb6f9,'root':_0x249e31,'manifest':_0x4790af};}function installedSkillPath(_0x1d9c71){const _0x5c2941=a144_0x527771,_0x5be8e0=resolveInstalledSkill(SKILL_NAME,{'home':_0x1d9c71});if(_0x5be8e0[_0x5c2941(0x1e3)]===_0x5c2941(0x1aa))return{'state':_0x5c2941(0x1aa),'path':dirname(_0x5be8e0['path'])};if(_0x5be8e0['state']===_0x5c2941(0x1be))return{'state':_0x5c2941(0x1bd)};return{'state':_0x5c2941(0x1cd),'reason':_0x5be8e0['reason']};}export function inspectInstalledBuiltinSkillVersion(_0x4fb239,_0x40de81={}){const _0x5331c7=a144_0x527771,_0x1d7b28=installedSkillPath(_0x40de81['home']??homedir());if(_0x1d7b28['state']===_0x5331c7(0x1bd))return{'state':'missing','expectedVersion':_0x4fb239,'repairCommand':REPAIR_COMMAND};if(_0x1d7b28[_0x5331c7(0x1e3)]===_0x5331c7(0x1cd))return{'state':_0x5331c7(0x1cd),'expectedVersion':_0x4fb239,'reason':_0x1d7b28['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x48e4c9=frontmatterValue(readFileSync(join(_0x1d7b28[_0x5331c7(0x1b3)],_0x5331c7(0x1cf)),'utf8'),_0x5331c7(0x1e0));return{'state':_0x48e4c9===_0x4fb239?'current':_0x5331c7(0x1b7),'expectedVersion':_0x4fb239,'skillVersion':_0x48e4c9,'installedPath':_0x1d7b28['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x4f130e){return{'state':_0x5331c7(0x1cd),'expectedVersion':_0x4fb239,'installedPath':_0x1d7b28[_0x5331c7(0x1b3)],'reason':_0x4f130e instanceof Error?_0x4f130e[_0x5331c7(0x1b5)]:String(_0x4f130e),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x5c849a={}){const _0x332428=a144_0x527771,_0x21e76e=_0x5c849a['packageRoot']??DEFAULT_PACKAGE_ROOT;let _0x5f3069;try{_0x5f3069=readSource(_0x21e76e);}catch(_0x13ae26){return{'state':'unverifiable','packageVersion':_0x332428(0x1d4),'reason':_0x13ae26 instanceof Error?_0x13ae26['message']:String(_0x13ae26),'repairCommand':REPAIR_COMMAND};}const _0xb76baf=installedSkillPath(_0x5c849a[_0x332428(0x1af)]??homedir());if(_0xb76baf[_0x332428(0x1e3)]===_0x332428(0x1bd))return{'state':_0x332428(0x1bd),'packageVersion':_0x5f3069[_0x332428(0x1c2)],'repairCommand':REPAIR_COMMAND};if(_0xb76baf[_0x332428(0x1e3)]===_0x332428(0x1cd))return{'state':_0x332428(0x1cd),'packageVersion':_0x5f3069[_0x332428(0x1c2)],'reason':_0xb76baf['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x206b7f=frontmatterValue(readFileSync(join(_0xb76baf[_0x332428(0x1b3)],'SKILL.md'),'utf8'),'version');if(_0x206b7f!==_0x5f3069[_0x332428(0x1b4)])return{'state':_0x332428(0x1b7),'packageVersion':_0x5f3069[_0x332428(0x1c2)],'skillVersion':_0x206b7f,'installedPath':_0xb76baf['path'],'repairCommand':REPAIR_COMMAND};const _0xd5531e=listFiles(_0xb76baf[_0x332428(0x1b3)]),_0x287bed=digestFiles(_0xb76baf[_0x332428(0x1b3)],_0xd5531e);return{'state':sameFiles(_0xd5531e,_0x5f3069[_0x332428(0x1ac)][_0x332428(0x1bf)])&&_0x287bed===_0x5f3069[_0x332428(0x1ac)][_0x332428(0x1bb)]?'current':_0x332428(0x1d2),'packageVersion':_0x5f3069['packageVersion'],'skillVersion':_0x206b7f,'installedPath':_0xb76baf[_0x332428(0x1b3)],'digest':_0x287bed,'repairCommand':REPAIR_COMMAND};}catch(_0x57bcc0){return{'state':'unverifiable','packageVersion':_0x5f3069[_0x332428(0x1c2)],'installedPath':_0xb76baf[_0x332428(0x1b3)],'reason':_0x57bcc0 instanceof Error?_0x57bcc0[_0x332428(0x1b5)]:String(_0x57bcc0),'repairCommand':REPAIR_COMMAND};}}function failure(_0x2f4b20,_0x3a6090,_0x465d0c,_0x4249a7){const _0x5dc7c2=a144_0x527771;return{'ok':![],'code':_0x2f4b20,'packageVersion':_0x3a6090['packageVersion'],'skillVersion':_0x3a6090[_0x5dc7c2(0x1b4)],'installedPath':_0x4249a7,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x465d0c instanceof Error?_0x465d0c[_0x5dc7c2(0x1b5)]:String(_0x465d0c)};}export function installBuiltinSkill(_0x2e180b={}){const _0x53cc9d=a144_0x527771,_0x2e4e75=_0x2e180b[_0x53cc9d(0x1ca)]??DEFAULT_PACKAGE_ROOT,_0x5dd158=_0x2e180b['home']??homedir();let _0x40725d;try{_0x40725d=readSource(_0x2e4e75);}catch(_0x148d20){return failure(_0x53cc9d(0x1d8),{'packageVersion':_0x53cc9d(0x1d4),'skillVersion':_0x53cc9d(0x1d4)},_0x148d20);}const _0x7f57e3=inspectBuiltinSkill({'packageRoot':_0x2e4e75,'home':_0x5dd158}),_0x131ea2=runNpxSkillsAddGlobal(_0x2e4e75,_0x40725d['root'],{'stdio':_0x2e180b[_0x53cc9d(0x1a4)]??_0x53cc9d(0x1c7),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x5dd158}});if(_0x131ea2[_0x53cc9d(0x1ba)])return{'ok':!![],'packageVersion':_0x40725d[_0x53cc9d(0x1c2)],'skillVersion':_0x40725d[_0x53cc9d(0x1b4)],'installedPath':_0x7f57e3[_0x53cc9d(0x1df)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x131ea2['ok'])return failure(_0x53cc9d(0x1c4),_0x40725d,_0x131ea2[_0x53cc9d(0x1a3)]??'skills@latest\x20exited\x20'+_0x131ea2[_0x53cc9d(0x1cc)]);const _0x542633=inspectBuiltinSkill({'packageRoot':_0x2e4e75,'home':_0x5dd158});if(_0x542633['state']!=='current'){const _0x179399=_0x542633[_0x53cc9d(0x1d1)]??'Installed\x20Skill\x20state\x20is\x20'+_0x542633[_0x53cc9d(0x1e3)];return failure(_0x53cc9d(0x1ab),_0x40725d,_0x131ea2['partialFailure']?_0x179399+'\x0a'+_0x131ea2[_0x53cc9d(0x1c6)][_0x53cc9d(0x1d6)]:_0x179399,_0x542633[_0x53cc9d(0x1df)]);}return _0x131ea2[_0x53cc9d(0x1c6)]&&(debug('Installer\x20reported\x20partial\x20target\x20failures:\x0a%s',_0x131ea2[_0x53cc9d(0x1c6)]['output']),console[_0x53cc9d(0x1de)](_0x53cc9d(0x1a2)+_0x40725d[_0x53cc9d(0x1b4)]+'\x20verified;\x20'+_0x131ea2[_0x53cc9d(0x1c6)]['count']+_0x53cc9d(0x1a5))),{'ok':!![],'packageVersion':_0x40725d[_0x53cc9d(0x1c2)],'skillVersion':_0x40725d[_0x53cc9d(0x1b4)],'installedPath':_0x542633['installedPath'],'changed':_0x7f57e3['state']!=='current','repairCommand':REPAIR_COMMAND};}function a144_0x4598(){const _0x2bb48f=['isSymbolicLink','path','skillVersion','message','utf8','version_mismatch','isDirectory','294406JpHjlz','skipped','digest','skills','missing','absent','files','lovrabet-skills','lovrabet','packageVersion','name','INSTALL_FAILED','update','partialFailure','pipe','252797TOSXSb','1618974wMmlpv','packageRoot','Unsafe\x20manifest\x20path:\x20','status','unverifiable','startsWith','SKILL.md','278804fPlNMJ','reason','content_mismatch','501528zoNoeS','unknown','Unsupported\x20Skill\x20entry:\x20','output','1248896uwftkM','SOURCE_INVALID','includes','package.json','hex','2jdRJaI','isFile','log','installedPath','version','trim','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','state','lovrabet\x20cli-skill\x20install','join','1922481vHFROs','CLI\x20Built-in\x20Skill\x20','error','stdio','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','length',':\x5cs*(.+)$','Symbolic\x20link\x20is\x20not\x20allowed:\x20','lovrabet.manifest.json','present','VERIFY_FAILED','manifest','split','schemaVersion','home','10XFYnGp','parse'];a144_0x4598=function(){return _0x2bb48f;};return a144_0x4598();}
|
|
1
|
+
const a147_0x1d61b2=a147_0x2ef8;(function(_0x17dbee,_0x2eacee){const _0x9da1ab=a147_0x2ef8,_0x12b38a=_0x17dbee();while(!![]){try{const _0x510518=parseInt(_0x9da1ab(0x93))/0x1*(-parseInt(_0x9da1ab(0xa5))/0x2)+-parseInt(_0x9da1ab(0xa7))/0x3+parseInt(_0x9da1ab(0x7a))/0x4*(parseInt(_0x9da1ab(0xb3))/0x5)+parseInt(_0x9da1ab(0x9b))/0x6+parseInt(_0x9da1ab(0x81))/0x7*(parseInt(_0x9da1ab(0x6e))/0x8)+parseInt(_0x9da1ab(0xb1))/0x9+-parseInt(_0x9da1ab(0x86))/0xa*(parseInt(_0x9da1ab(0x92))/0xb);if(_0x510518===_0x2eacee)break;else _0x12b38a['push'](_0x12b38a['shift']());}catch(_0x542489){_0x12b38a['push'](_0x12b38a['shift']());}}}(a147_0x2dca,0x8ae11));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a147_0x1d61b2(0x87),SKILL_NAME=a147_0x1d61b2(0x77),debug=debuglog(a147_0x1d61b2(0x84));function frontmatterValue(_0x34332c,_0x46cff3){const _0x1cc96b=a147_0x1d61b2;return _0x34332c[_0x1cc96b(0x8a)](new RegExp('^'+_0x46cff3+_0x1cc96b(0x78),'m'))?.[0x1]?.[_0x1cc96b(0xb4)]()??'';}function listFiles(_0x4413b5,_0x4723d6=_0x4413b5){const _0x87e554=a147_0x1d61b2;return readdirSync(_0x4723d6,{'withFileTypes':!![]})[_0x87e554(0xa8)](_0x2704c0=>{const _0x5b4344=_0x87e554,_0x45aa9e=join(_0x4723d6,_0x2704c0[_0x5b4344(0x94)]),_0x4eb8bc=lstatSync(_0x45aa9e);if(_0x4eb8bc['isSymbolicLink']())throw new Error(_0x5b4344(0xa9)+_0x45aa9e);if(_0x4eb8bc['isDirectory']())return listFiles(_0x4413b5,_0x45aa9e);if(!_0x4eb8bc[_0x5b4344(0x85)]())throw new Error(_0x5b4344(0x7f)+_0x45aa9e);return[relative(_0x4413b5,_0x45aa9e)[_0x5b4344(0xa6)](sep)[_0x5b4344(0x8f)]('/')];})[_0x87e554(0x97)]((_0x32a7a1,_0x5c6ce6)=>_0x32a7a1<_0x5c6ce6?-0x1:_0x32a7a1>_0x5c6ce6?0x1:0x0);}function digestFiles(_0x3d6a6b,_0x5a072b){const _0x41980b=a147_0x1d61b2,_0x7baafb=createHash('sha256');for(const _0x1ff60e of _0x5a072b){if(_0x1ff60e[_0x41980b(0x91)]('/')||_0x1ff60e[_0x41980b(0xa6)]('/')[_0x41980b(0x95)]('..')||_0x1ff60e['includes']('\x5c'))throw new Error(_0x41980b(0x80)+_0x1ff60e);_0x7baafb[_0x41980b(0xaa)](_0x1ff60e),_0x7baafb[_0x41980b(0xaa)]('\x00'),_0x7baafb[_0x41980b(0xaa)](readFileSync(join(_0x3d6a6b,..._0x1ff60e[_0x41980b(0xa6)]('/')))),_0x7baafb[_0x41980b(0xaa)]('\x00');}return _0x7baafb['digest'](_0x41980b(0x82));}function sameFiles(_0x142db1,_0x3c4043){const _0x20013c=a147_0x1d61b2;return _0x142db1[_0x20013c(0x7c)]===_0x3c4043['length']&&_0x142db1[_0x20013c(0xad)]((_0x4680f0,_0x2a34c4)=>_0x4680f0===_0x3c4043[_0x2a34c4]);}function readSource(_0x449de6){const _0x5c731c=a147_0x1d61b2,_0x282bc7=JSON[_0x5c731c(0x88)](readFileSync(join(_0x449de6,_0x5c731c(0xab)),'utf8')),_0x1f1a0a=JSON[_0x5c731c(0x88)](readFileSync(join(_0x449de6,'skills',_0x5c731c(0x89)),_0x5c731c(0x96))),_0xb0a426=join(_0x449de6,_0x5c731c(0x8e),SKILL_NAME),_0x2cfe7f=frontmatterValue(readFileSync(join(_0xb0a426,_0x5c731c(0x79)),'utf8'),_0x5c731c(0xaf)),_0x59f6d3=listFiles(_0xb0a426);if(_0x1f1a0a[_0x5c731c(0xb0)]!==0x1||_0x1f1a0a[_0x5c731c(0x94)]!==SKILL_NAME||!_0x282bc7[_0x5c731c(0xaf)]||_0x1f1a0a[_0x5c731c(0x9f)]!==_0x282bc7[_0x5c731c(0xaf)]||_0x1f1a0a[_0x5c731c(0x7b)]!==_0x282bc7[_0x5c731c(0xaf)]||_0x2cfe7f!==_0x282bc7[_0x5c731c(0xaf)]||!sameFiles(_0x59f6d3,_0x1f1a0a[_0x5c731c(0x70)])||digestFiles(_0xb0a426,_0x59f6d3)!==_0x1f1a0a[_0x5c731c(0xa0)])throw new Error('Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest');return{'packageVersion':_0x282bc7['version'],'skillVersion':_0x2cfe7f,'root':_0xb0a426,'manifest':_0x1f1a0a};}function installedSkillPath(_0x161d30){const _0xd42b8e=a147_0x1d61b2,_0x1585d0=resolveInstalledSkill(SKILL_NAME,{'home':_0x161d30});if(_0x1585d0['state']===_0xd42b8e(0xb2))return{'state':_0xd42b8e(0xb2),'path':dirname(_0x1585d0[_0xd42b8e(0xa1)])};if(_0x1585d0[_0xd42b8e(0x83)]==='absent')return{'state':_0xd42b8e(0x7d)};return{'state':'unverifiable','reason':_0x1585d0['reason']};}function a147_0x2dca(){const _0xf8ce07=['name','includes','utf8','sort','installedPath','\x20verified;\x20','CLI\x20Built-in\x20Skill\x20','2454180WqzGLE','packageRoot','stdio','current','packageVersion','digest','path','home','root','version_mismatch','14yvhhEn','split','346614ZqlVzm','flatMap','Symbolic\x20link\x20is\x20not\x20allowed:\x20','update','package.json','content_mismatch','every','status','version','schemaVersion','8431443NvPTiE','present','2263950FAJCMC','trim','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','72056pzvGdC','unverifiable','files','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','error','VERIFY_FAILED','skills@latest\x20exited\x20','partialFailure','unknown','lovrabet',':\x5cs*(.+)$','SKILL.md','8zWeYbB','skillVersion','length','missing','output','Unsupported\x20Skill\x20entry:\x20','Unsafe\x20manifest\x20path:\x20','91DDutpC','hex','state','lovrabet-skills','isFile','3365610mdbvyM','lovrabet\x20cli-skill\x20install','parse','lovrabet.manifest.json','match','Installed\x20Skill\x20state\x20is\x20','reason','message','skills','join','INSTALL_FAILED','startsWith','44reZGRP','48271HZBFJu'];a147_0x2dca=function(){return _0xf8ce07;};return a147_0x2dca();}export function inspectInstalledBuiltinSkillVersion(_0x4bd91b,_0x424e64={}){const _0x44880b=a147_0x1d61b2,_0x1b4a87=installedSkillPath(_0x424e64[_0x44880b(0xa2)]??homedir());if(_0x1b4a87[_0x44880b(0x83)]===_0x44880b(0x7d))return{'state':'missing','expectedVersion':_0x4bd91b,'repairCommand':REPAIR_COMMAND};if(_0x1b4a87[_0x44880b(0x83)]===_0x44880b(0x6f))return{'state':_0x44880b(0x6f),'expectedVersion':_0x4bd91b,'reason':_0x1b4a87[_0x44880b(0x8c)],'repairCommand':REPAIR_COMMAND};try{const _0x35c251=frontmatterValue(readFileSync(join(_0x1b4a87['path'],_0x44880b(0x79)),_0x44880b(0x96)),'version');return{'state':_0x35c251===_0x4bd91b?'current':_0x44880b(0xa4),'expectedVersion':_0x4bd91b,'skillVersion':_0x35c251,'installedPath':_0x1b4a87[_0x44880b(0xa1)],'repairCommand':REPAIR_COMMAND};}catch(_0x104cbe){return{'state':_0x44880b(0x6f),'expectedVersion':_0x4bd91b,'installedPath':_0x1b4a87[_0x44880b(0xa1)],'reason':_0x104cbe instanceof Error?_0x104cbe['message']:String(_0x104cbe),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x44e119={}){const _0x5857ff=a147_0x1d61b2,_0x10d3c5=_0x44e119[_0x5857ff(0x9c)]??DEFAULT_PACKAGE_ROOT;let _0x54eec4;try{_0x54eec4=readSource(_0x10d3c5);}catch(_0x2ebc40){return{'state':'unverifiable','packageVersion':_0x5857ff(0x76),'reason':_0x2ebc40 instanceof Error?_0x2ebc40['message']:String(_0x2ebc40),'repairCommand':REPAIR_COMMAND};}const _0x315968=installedSkillPath(_0x44e119[_0x5857ff(0xa2)]??homedir());if(_0x315968[_0x5857ff(0x83)]==='missing')return{'state':_0x5857ff(0x7d),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'repairCommand':REPAIR_COMMAND};if(_0x315968['state']===_0x5857ff(0x6f))return{'state':_0x5857ff(0x6f),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'reason':_0x315968[_0x5857ff(0x8c)],'repairCommand':REPAIR_COMMAND};try{const _0x10bd17=frontmatterValue(readFileSync(join(_0x315968['path'],_0x5857ff(0x79)),_0x5857ff(0x96)),'version');if(_0x10bd17!==_0x54eec4[_0x5857ff(0x7b)])return{'state':_0x5857ff(0xa4),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'skillVersion':_0x10bd17,'installedPath':_0x315968[_0x5857ff(0xa1)],'repairCommand':REPAIR_COMMAND};const _0x282a83=listFiles(_0x315968[_0x5857ff(0xa1)]),_0x39829c=digestFiles(_0x315968[_0x5857ff(0xa1)],_0x282a83);return{'state':sameFiles(_0x282a83,_0x54eec4['manifest'][_0x5857ff(0x70)])&&_0x39829c===_0x54eec4['manifest'][_0x5857ff(0xa0)]?'current':_0x5857ff(0xac),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'skillVersion':_0x10bd17,'installedPath':_0x315968[_0x5857ff(0xa1)],'digest':_0x39829c,'repairCommand':REPAIR_COMMAND};}catch(_0x58bfe0){return{'state':_0x5857ff(0x6f),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'installedPath':_0x315968[_0x5857ff(0xa1)],'reason':_0x58bfe0 instanceof Error?_0x58bfe0[_0x5857ff(0x8d)]:String(_0x58bfe0),'repairCommand':REPAIR_COMMAND};}}function failure(_0x35a8db,_0x489d7e,_0x4b1df2,_0x42ac4b){const _0xc85b96=a147_0x1d61b2;return{'ok':![],'code':_0x35a8db,'packageVersion':_0x489d7e['packageVersion'],'skillVersion':_0x489d7e[_0xc85b96(0x7b)],'installedPath':_0x42ac4b,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x4b1df2 instanceof Error?_0x4b1df2[_0xc85b96(0x8d)]:String(_0x4b1df2)};}function a147_0x2ef8(_0x54b7b0,_0x4b88e1){_0x54b7b0=_0x54b7b0-0x6e;const _0x2dca61=a147_0x2dca();let _0x2ef889=_0x2dca61[_0x54b7b0];return _0x2ef889;}export function installBuiltinSkill(_0x137eb8={}){const _0x34202f=a147_0x1d61b2,_0x1781ff=_0x137eb8['packageRoot']??DEFAULT_PACKAGE_ROOT,_0xc71b4b=_0x137eb8['home']??homedir();let _0x5d302f;try{_0x5d302f=readSource(_0x1781ff);}catch(_0x826695){return failure('SOURCE_INVALID',{'packageVersion':'unknown','skillVersion':'unknown'},_0x826695);}const _0x336663=inspectBuiltinSkill({'packageRoot':_0x1781ff,'home':_0xc71b4b}),_0xfb3ec=runNpxSkillsAddGlobal(_0x1781ff,_0x5d302f[_0x34202f(0xa3)],{'stdio':_0x137eb8[_0x34202f(0x9d)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0xc71b4b}});if(_0xfb3ec['skipped'])return{'ok':!![],'packageVersion':_0x5d302f['packageVersion'],'skillVersion':_0x5d302f[_0x34202f(0x7b)],'installedPath':_0x336663[_0x34202f(0x98)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0xfb3ec['ok'])return failure(_0x34202f(0x90),_0x5d302f,_0xfb3ec[_0x34202f(0x72)]??_0x34202f(0x74)+_0xfb3ec[_0x34202f(0xae)]);const _0x50b84a=inspectBuiltinSkill({'packageRoot':_0x1781ff,'home':_0xc71b4b});if(_0x50b84a[_0x34202f(0x83)]!==_0x34202f(0x9e)){const _0x2fe24d=_0x50b84a['reason']??_0x34202f(0x8b)+_0x50b84a['state'];return failure(_0x34202f(0x73),_0x5d302f,_0xfb3ec[_0x34202f(0x75)]?_0x2fe24d+'\x0a'+_0xfb3ec['partialFailure']['output']:_0x2fe24d,_0x50b84a[_0x34202f(0x98)]);}return _0xfb3ec[_0x34202f(0x75)]&&(debug(_0x34202f(0xb5),_0xfb3ec[_0x34202f(0x75)][_0x34202f(0x7e)]),console['log'](_0x34202f(0x9a)+_0x5d302f['skillVersion']+_0x34202f(0x99)+_0xfb3ec['partialFailure']['count']+_0x34202f(0x71))),{'ok':!![],'packageVersion':_0x5d302f[_0x34202f(0x9f)],'skillVersion':_0x5d302f[_0x34202f(0x7b)],'installedPath':_0x50b84a[_0x34202f(0x98)],'changed':_0x336663[_0x34202f(0x83)]!==_0x34202f(0x9e),'repairCommand':REPAIR_COMMAND};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a148_0x44f727=a148_0x3a86;function a148_0x3a86(_0x17f982,_0x4916cd){_0x17f982=_0x17f982-0x10b;const _0x3b58cc=a148_0x3b58();let _0x3a86c6=_0x3b58cc[_0x17f982];return _0x3a86c6;}(function(_0xc80974,_0x345a9a){const _0x4f3a89=a148_0x3a86,_0x1b4e9f=_0xc80974();while(!![]){try{const _0x50fb50=parseInt(_0x4f3a89(0x130))/0x1+-parseInt(_0x4f3a89(0x10e))/0x2+parseInt(_0x4f3a89(0x133))/0x3*(-parseInt(_0x4f3a89(0x119))/0x4)+parseInt(_0x4f3a89(0x10b))/0x5+parseInt(_0x4f3a89(0x12c))/0x6*(parseInt(_0x4f3a89(0x138))/0x7)+-parseInt(_0x4f3a89(0x128))/0x8*(-parseInt(_0x4f3a89(0x117))/0x9)+parseInt(_0x4f3a89(0x134))/0xa*(-parseInt(_0x4f3a89(0x111))/0xb);if(_0x50fb50===_0x345a9a)break;else _0x1b4e9f['push'](_0x1b4e9f['shift']());}catch(_0x560cde){_0x1b4e9f['push'](_0x1b4e9f['shift']());}}}(a148_0x3b58,0xd2082));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a148_0x24993}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a148_0x24993;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a148_0x44f727(0x12e)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a148_0x44f727(0x120)];export function resolveGlobalSkillName(_0x2344af){const _0x3f570b=a148_0x44f727;switch(_0x2344af[_0x3f570b(0x11e)]()){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[a148_0x44f727(0x10c)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x48970b,_0x22fd1f,_0x3d7401){return{'ok':![],'status':_0x22fd1f,'code':_0x48970b,'error':'['+_0x48970b+']\x20'+_0x3d7401};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a148_0x3b58(){const _0x33a069=['partialFailure','stdout','present','message','pipe','112005oRPGZM','log','1355244BGghXh','absent','\x22\x20install\x20state:\x20','warn','presence','trim','exitCode','globalSkillName','NPM_CONFIG_GLOBAL','CHILD_EXIT_NONZERO','npx\x20failed\x20to\x20start','npx\x20terminated\x20by\x20signal\x20','code','unverifiable','Installer\x20reported\x20','96xOCTrc','filter','SKILL_NOT_INSTALLED','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','707466buFQUg','expectedSkillName','internalSkillSource','signal','533481eSoYip','\x20failed\x20target(s)','join','3cSoHlv','810FUCVMA','shortMessage','failed','match','77DlbuYP','exit\x20','stdio','5332560gtPyBE','skipNpxSkillsEnvSuffix','stderr','1847868VHubBi','PERMISSION_DENIED','state','125389jxpSgK'];a148_0x3b58=function(){return _0x33a069;};return a148_0x3b58();}export function runNpxSkillsAddGlobal(_0x1d4848,_0x31c368=LOVRABET_SKILL_SOURCE,_0x4b31cf){const _0x11a2cd=a148_0x44f727;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5082aa=['-y','skills@latest','add',_0x31c368,'-g','-y'],_0x270f83=['npx',..._0x5082aa][_0x11a2cd(0x132)]('\x20');console[_0x11a2cd(0x118)]('*\x20'+_0x270f83);const _0x193c28={...process.env};delete _0x193c28['npm_config_global'],delete _0x193c28[_0x11a2cd(0x121)];const _0x1a34bd=execaSync('npx',_0x5082aa,{'cwd':_0x1d4848,'stdio':_0x11a2cd(0x116),'env':_0x193c28,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x458c3c=[_0x1a34bd[_0x11a2cd(0x113)]?String(_0x1a34bd['stdout']):'',_0x1a34bd[_0x11a2cd(0x10d)]?String(_0x1a34bd['stderr']):''][_0x11a2cd(0x129)](Boolean)[_0x11a2cd(0x132)]('\x0a')[_0x11a2cd(0x11e)](),_0x21bd27=_0x1a34bd[_0x11a2cd(0x11f)]??null,_0x28e134=_0x18e787=>{const _0x5c1ac7=_0x11a2cd;return _0x4b31cf?.[_0x5c1ac7(0x13a)]!==_0x5c1ac7(0x116)&&!_0x18e787[_0x5c1ac7(0x112)]&&_0x458c3c&&console['log'](_0x458c3c),_0x18e787;};if(_0x1a34bd[_0x11a2cd(0x125)]){const _0x4ceeda=_0x1a34bd[_0x11a2cd(0x125)]==='ENOENT'?'NPX_NOT_FOUND':_0x1a34bd[_0x11a2cd(0x125)]==='EPERM'||_0x1a34bd[_0x11a2cd(0x125)]==='EACCES'?_0x11a2cd(0x10f):'SPAWN_FAILED';return _0x28e134(failure(_0x4ceeda,_0x21bd27,_0x1a34bd['shortMessage']??_0x1a34bd[_0x11a2cd(0x115)]??_0x1a34bd[_0x11a2cd(0x125)]));}if(_0x1a34bd[_0x11a2cd(0x12f)])return _0x28e134(failure('CHILD_TERMINATED',_0x21bd27,_0x11a2cd(0x124)+_0x1a34bd['signal']));if(_0x1a34bd[_0x11a2cd(0x136)]&&_0x21bd27===null)return _0x28e134(failure('SPAWN_FAILED',_0x21bd27,_0x1a34bd[_0x11a2cd(0x135)]??_0x1a34bd[_0x11a2cd(0x115)]??_0x11a2cd(0x123)));if(_0x21bd27!==0x0)return _0x28e134(failure(_0x11a2cd(0x122),_0x21bd27,_0x458c3c||_0x1a34bd[_0x11a2cd(0x135)]||_0x11a2cd(0x139)+(_0x21bd27??'unknown')));const _0x2a686a=_0x4b31cf?.[_0x11a2cd(0x12d)]??resolveGlobalSkillName(_0x31c368),_0x20e442=_0x2a686a?resolveInstalledSkill(_0x2a686a,_0x4b31cf?.[_0x11a2cd(0x11d)]):undefined,_0xe9b3cc=_0x458c3c[_0x11a2cd(0x137)](/Failed to install\s+(\d+)/i);if(_0xe9b3cc&&Number(_0xe9b3cc[0x1])>0x0){const _0x29db8e=_0x11a2cd(0x127)+_0xe9b3cc[0x1]+_0x11a2cd(0x131)+(_0x458c3c?':\x0a'+_0x458c3c:'');if(_0x20e442?.[_0x11a2cd(0x110)]===_0x11a2cd(0x114))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0xe9b3cc[0x1]),'output':_0x458c3c}};return _0x28e134(failure('INSTALL_PARTIAL',0x0,_0x29db8e));}if(_0x2a686a&&_0x20e442){if(_0x20e442['state']===_0x11a2cd(0x11a))return _0x28e134(failure(_0x11a2cd(0x12a),0x0,'Skill\x20\x22'+_0x2a686a+_0x11a2cd(0x12b)+_0x20e442['checked'][_0x11a2cd(0x132)](',\x20')+')'));_0x20e442[_0x11a2cd(0x110)]===_0x11a2cd(0x126)&&console[_0x11a2cd(0x11c)]('!\x20Could\x20not\x20verify\x20\x22'+_0x2a686a+_0x11a2cd(0x11b)+_0x20e442['reason']);}return _0x28e134({'ok':!![],'status':0x0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a149_0x5d8c65=a149_0x116a;function a149_0x116a(_0x2a8fdb,_0x34f75c){_0x2a8fdb=_0x2a8fdb-0x149;const _0x175896=a149_0x1758();let _0x116a48=_0x175896[_0x2a8fdb];return _0x116a48;}(function(_0x47705c,_0x2e678a){const _0x837297=a149_0x116a,_0x5e9c81=_0x47705c();while(!![]){try{const _0x2d009d=-parseInt(_0x837297(0x15e))/0x1+-parseInt(_0x837297(0x155))/0x2*(-parseInt(_0x837297(0x14e))/0x3)+-parseInt(_0x837297(0x15b))/0x4+-parseInt(_0x837297(0x14a))/0x5*(parseInt(_0x837297(0x15a))/0x6)+parseInt(_0x837297(0x14c))/0x7*(parseInt(_0x837297(0x150))/0x8)+-parseInt(_0x837297(0x157))/0x9+parseInt(_0x837297(0x15f))/0xa*(parseInt(_0x837297(0x14d))/0xb);if(_0x2d009d===_0x2e678a)break;else _0x5e9c81['push'](_0x5e9c81['shift']());}catch(_0x597e27){_0x5e9c81['push'](_0x5e9c81['shift']());}}}(a149_0x1758,0x99fb4));export const METADATA_FILE=a149_0x5d8c65(0x14b);export const SKILL_FILE=a149_0x5d8c65(0x153);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);function a149_0x1758(){const _0x3a6aa7=['8KMMiiB','.turbo','.hg','SKILL.md','.next','882MwgkHL','.git','10754298OfJSze','.cache','.svn','150tUrMcE','1228992mOIofY','coverage','build','152265PbwURe','116750bnqGjN','dist','81885DsSIBC','lovrabet.skill.json','9219UPvdBq','1837qiMsTA','5058lwmJcO','node_modules'];a149_0x1758=function(){return _0x3a6aa7;};return a149_0x1758();}export const IGNORED_DIR_NAMES=new Set([a149_0x5d8c65(0x156),a149_0x5d8c65(0x152),a149_0x5d8c65(0x159),a149_0x5d8c65(0x14f),a149_0x5d8c65(0x154),a149_0x5d8c65(0x149),a149_0x5d8c65(0x15d),a149_0x5d8c65(0x15c),a149_0x5d8c65(0x151),a149_0x5d8c65(0x158)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a150_0x28da(){const _0x50407c=['Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','3YvSVMH','3106985QqgHvy','782772iKoWzr','27qteDHo','7430lGzOft','validation','10tLkTPR','425502nqbCzg','isSymbolicLink','from','17088bHayuS','utf8','endsWith','721384RXPeYS','402483igRCXb','startsWith','split','.tmp'];a150_0x28da=function(){return _0x50407c;};return a150_0x28da();}(function(_0xe9219,_0x1b499d){const _0x4910e2=a150_0x4a5b,_0xdae1c2=_0xe9219();while(!![]){try{const _0x41dfb9=parseInt(_0x4910e2(0x12d))/0x1+parseInt(_0x4910e2(0x126))/0x2+parseInt(_0x4910e2(0x132))/0x3*(-parseInt(_0x4910e2(0x121))/0x4)+parseInt(_0x4910e2(0x125))/0x5*(-parseInt(_0x4910e2(0x129))/0x6)+-parseInt(_0x4910e2(0x120))/0x7+parseInt(_0x4910e2(0x12c))/0x8*(parseInt(_0x4910e2(0x122))/0x9)+parseInt(_0x4910e2(0x123))/0xa;if(_0x41dfb9===_0x1b499d)break;else _0xdae1c2['push'](_0xdae1c2['shift']());}catch(_0x49f250){_0xdae1c2['push'](_0xdae1c2['shift']());}}}(a150_0x28da,0x3ae64));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x19a09e,_0x8ae57){const _0x5095f0=a150_0x4a5b,_0x2dc2d6=normalizeSkillRelativePath(_0x8ae57),_0x153750=realOrResolved(_0x19a09e),_0xcbb7ce=resolve(_0x153750,..._0x2dc2d6[_0x5095f0(0x12f)]('/'));if(!isPathInside(_0xcbb7ce,_0x153750))throw CliErrors[_0x5095f0(0x124)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x8ae57);return ensureNoSymlinkInManagedPath(_0x153750,_0x2dc2d6),_0xcbb7ce;}export function ensureNoSymlinkInManagedPath(_0x42838c,_0x59df85){const _0x1317e8=a150_0x4a5b;let _0x488988=_0x42838c;for(const _0x177502 of _0x59df85['split']('/')){_0x488988=resolve(_0x488988,_0x177502);const _0x1c156d=lstatIfPresent(_0x488988);if(_0x1c156d?.[_0x1317e8(0x127)]())throw CliErrors['validation'](_0x1317e8(0x131)+_0x59df85);}}export function isDanglingSymlink(_0x27ae45){try{return lstatSync(_0x27ae45)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x4f931b){const _0xbc3362=readlinkSync(_0x4f931b);return isAbsolute(_0xbc3362)?_0xbc3362:resolve(dirname(_0x4f931b),_0xbc3362);}export function isPathInside(_0x236aa9,_0x9b7648){const _0x4c115a=a150_0x4a5b,_0x335f75=_0x236aa9[_0x4c115a(0x12b)](sep)?_0x236aa9:''+_0x236aa9+sep,_0x43bd17=_0x9b7648[_0x4c115a(0x12b)](sep)?_0x9b7648:''+_0x9b7648+sep;return _0x236aa9===_0x9b7648||_0x335f75[_0x4c115a(0x12e)](_0x43bd17);}export function realOrResolved(_0x5c6bdd){try{return realpathSync(_0x5c6bdd);}catch{return resolve(_0x5c6bdd);}}export function lstatIfPresent(_0x4204d6){try{return lstatSync(_0x4204d6);}catch{return undefined;}}export function writeTextAtomic(_0x149eb5,_0x426fb9,_0x486554){const _0x28682e=a150_0x4a5b;writeBytesAtomic(_0x149eb5,Buffer[_0x28682e(0x128)](_0x426fb9,_0x28682e(0x12a)),_0x486554);}export function writeBytesAtomic(_0x5945c2,_0x4da095,_0x40f5cd){const _0x4ecb10=a150_0x4a5b,_0x5d2ff9=_0x5945c2+_0x4ecb10(0x130);try{writeFileSync(_0x5d2ff9,_0x4da095,{'mode':_0x40f5cd}),renameSync(_0x5d2ff9,_0x5945c2);}catch(_0x36b567){try{rmSync(_0x5d2ff9,{'force':!![]});}catch{}throw _0x36b567;}}function a150_0x4a5b(_0x3314f8,_0x109c87){_0x3314f8=_0x3314f8-0x120;const _0x28da51=a150_0x28da();let _0x4a5bfa=_0x28da51[_0x3314f8];return _0x4a5bfa;}export function writeJsonAtomic(_0x5d8fee,_0x3214ee){writeTextAtomic(_0x5d8fee,JSON['stringify'](_0x3214ee,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3315f9,_0x3a346e){const _0x5a4523=a151_0x1091,_0x5cadeb=_0x3315f9();while(!![]){try{const _0x2d4d67=parseInt(_0x5a4523(0x17e))/0x1*(parseInt(_0x5a4523(0x17c))/0x2)+parseInt(_0x5a4523(0x17d))/0x3*(parseInt(_0x5a4523(0x17a))/0x4)+parseInt(_0x5a4523(0x180))/0x5+-parseInt(_0x5a4523(0x177))/0x6+parseInt(_0x5a4523(0x182))/0x7+parseInt(_0x5a4523(0x17f))/0x8*(parseInt(_0x5a4523(0x184))/0x9)+parseInt(_0x5a4523(0x181))/0xa*(-parseInt(_0x5a4523(0x178))/0xb);if(_0x2d4d67===_0x3a346e)break;else _0x5cadeb['push'](_0x5cadeb['shift']());}catch(_0x16f524){_0x5cadeb['push'](_0x5cadeb['shift']());}}}(a151_0x20bd,0xc558d));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x2e7134){const _0x19b337=a151_0x1091;return createHash(_0x19b337(0x186))[_0x19b337(0x17b)](_0x2e7134)[_0x19b337(0x187)]('hex');}export function fileHash(_0x395b36){return bufferSha256(fileContent(_0x395b36));}function a151_0x20bd(){const _0x2dca1f=['update','46zwVetb','3ODBzDF','41091onHRbS','188608qSnMGS','1725505IjDZdp','10XbZekF','1707328SskOsz','size','27COFhIx','hex','sha256','digest','440886muapHq','8593145lLkqdh','path','232732hyRRWM'];a151_0x20bd=function(){return _0x2dca1f;};return a151_0x20bd();}export function bufferSha256(_0x2ff7d9){return createHash('sha256')['update'](_0x2ff7d9)['digest']('hex');}function a151_0x1091(_0x38d93f,_0x583e48){_0x38d93f=_0x38d93f-0x177;const _0x20bd5b=a151_0x20bd();let _0x109130=_0x20bd5b[_0x38d93f];return _0x109130;}export function fileTreeHash(_0x5286f4){const _0x3c954e=a151_0x1091,_0x19fe98=createHash(_0x3c954e(0x186));for(const _0x5a7dad of normalizeManifestFiles(_0x5286f4)){_0x19fe98[_0x3c954e(0x17b)](_0x5a7dad[_0x3c954e(0x179)]),_0x19fe98[_0x3c954e(0x17b)]('\x00'),_0x19fe98[_0x3c954e(0x17b)](_0x5a7dad['sha256']),_0x19fe98[_0x3c954e(0x17b)]('\x00'),_0x19fe98[_0x3c954e(0x17b)](String(_0x5a7dad[_0x3c954e(0x183)])),_0x19fe98[_0x3c954e(0x17b)]('\x00');}return _0x19fe98[_0x3c954e(0x187)](_0x3c954e(0x185));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a152_0x405c6d=a152_0x582c;function a152_0x582c(_0x1a87ec,_0x1a1534){_0x1a87ec=_0x1a87ec-0x1b7;const _0x5ebe75=a152_0x5ebe();let _0x582c4f=_0x5ebe75[_0x1a87ec];return _0x582c4f;}function a152_0x5ebe(){const _0x3f411b=['6342720KvelcC','cwd','651QiWetv','21LHxvnF','project','6262cucYSd','146008volvgQ','286uKbDvM','9459024GGVhFY','7130598imBAhp','freeze','736DOURta','appCode','skills','.agents','global','10107lzBjrB','6360ALvxTh','44yWigmI'];a152_0x5ebe=function(){return _0x3f411b;};return a152_0x5ebe();}(function(_0x128484,_0x404953){const _0x2a10e0=a152_0x582c,_0x4690cd=_0x128484();while(!![]){try{const _0x3d999b=parseInt(_0x2a10e0(0x1c4))/0x1*(parseInt(_0x2a10e0(0x1c6))/0x2)+-parseInt(_0x2a10e0(0x1c2))/0x3*(parseInt(_0x2a10e0(0x1c5))/0x4)+parseInt(_0x2a10e0(0x1bf))/0x5+parseInt(_0x2a10e0(0x1c8))/0x6+parseInt(_0x2a10e0(0x1c1))/0x7*(-parseInt(_0x2a10e0(0x1b7))/0x8)+parseInt(_0x2a10e0(0x1bc))/0x9*(parseInt(_0x2a10e0(0x1bd))/0xa)+-parseInt(_0x2a10e0(0x1be))/0xb*(parseInt(_0x2a10e0(0x1c7))/0xc);if(_0x3d999b===_0x404953)break;else _0x4690cd['push'](_0x4690cd['shift']());}catch(_0x2f2828){_0x4690cd['push'](_0x4690cd['shift']());}}}(a152_0x5ebe,0x9e979));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x5a68d0,_0x1c587c=a152_0x405c6d(0x1bb),_0x358e97={}){const _0x17ac15=a152_0x405c6d,_0x193126=resolveSkillSyncPaths(_0x358e97),_0x28d1bd=safePathSegment(_0x5a68d0,_0x17ac15(0x1b8)),_0x91eaf1=_0x1c587c===_0x17ac15(0x1c3)?[resolve(_0x358e97[_0x17ac15(0x1c0)]??process[_0x17ac15(0x1c0)](),_0x17ac15(0x1ba),_0x17ac15(0x1b9))]:runtimeAgentSkillRoots(_0x193126);return Object[_0x17ac15(0x1c9)]({'scope':_0x1c587c,'appCode':_0x28d1bd,'skillRoots':Object['freeze'](_0x91eaf1),'managedRoot':_0x193126['managedRoot']});}
|