@unbrained/pm-cli 2026.12.1 → 2026.12.3
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/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/commander-usage.js +4 -4
- package/dist/cli/expected-revisions.js +1 -1
- package/dist/cli/extension-command-help.js +4 -4
- package/dist/cli/main.js +5 -5
- package/dist/cli/runtime/invocation-rewrites.js +1 -1
- package/dist/cli/runtime-field-commands.js +2 -0
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-3ESBFEQC.js +2 -0
- package/dist/cli-bundle/chunks/chunk-46AZP5QW.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-OBPO6V7H.js → chunk-5WTBF4M4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3KEMIPKG.js → chunk-6TOZQ5BQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YYFY33T.js → chunk-AHVOEE7F.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-CQHB3ZZH.js +2 -0
- package/dist/cli-bundle/chunks/chunk-DZPOS3YT.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-OKEJ4U2I.js → chunk-E5ADC3HT.js} +65 -65
- package/dist/cli-bundle/chunks/{chunk-SY5C3U32.js → chunk-E5HO7HWP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3HKPVOAN.js → chunk-EDJ3KR2H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XME6GIFQ.js → chunk-FWQNWPIV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CWPR234D.js → chunk-H4U3LEOD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MZZ4ZJ5Z.js → chunk-HNMED75Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-U7RBJGLF.js → chunk-HPCMM74Q.js} +22 -22
- package/dist/cli-bundle/chunks/{chunk-WSEIEDEK.js → chunk-ITM4AMVM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q6K7HWZ7.js → chunk-IW4A3I4N.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YQMQOUO.js → chunk-JJ73G5UT.js} +52 -52
- package/dist/cli-bundle/chunks/chunk-L4HMFRHB.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-YSVOXCYH.js → chunk-LTQWPQ7H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q6GLSAJY.js → chunk-MRT3ADO4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZL6J6JYT.js → chunk-PBMLIV74.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NA6D75V5.js → chunk-PJMGWJKU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-Q2HMDV56.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-OXC5KBIQ.js → chunk-RRBNCL63.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CBUC4X7Q.js → chunk-TDOF7BKO.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-UXEZXGAD.js +113 -0
- package/dist/cli-bundle/chunks/{chunk-PCDTWL6V.js → chunk-W7HA65EO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I4SPJQQI.js → chunk-XGNUDSCG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AHV3CSQG.js → chunk-XKJ5NWQ7.js} +2 -2
- package/dist/cli-bundle/chunks/{field-option-collisions-BBGTV7AD.js → field-option-collisions-DXKTKW6J.js} +2 -2
- package/dist/cli-bundle/chunks/item-revision-DXEF4XBU.js +2 -0
- package/dist/cli-bundle/chunks/item-transaction-EANA7V4W.js +2 -0
- package/dist/cli-bundle/chunks/{linked-resource-value-list-E2DX52LY.js → linked-resource-value-list-5JRGUDUB.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-actor-NHN33ITJ.js → mutation-actor-S5G7FMNG.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-admission-PGKJTCG6.js → mutation-admission-HQVNPOXV.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-7S5QWDTI.js → register-list-query-SQF5PSJ4.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-2F6JUBST.js → register-mutation-4AQ4CEBL.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-ET3UKPYK.js → register-operations-76P7OM4P.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-I63QTFCU.js → register-setup-T6OEOZK3.js} +2 -2
- package/dist/cli-bundle/chunks/{stage-4ZCF74G4.js → stage-KUICZHSF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4SCFAWAW.js → chunk-3LHBKFPD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4DDXERKN.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-JPZGC3W4.js → chunk-4YU75CWI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TXTPAFHJ.js → chunk-5JQVPQMN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KNBGHCIP.js → chunk-5Z4DXYBZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-7DOP5HEZ.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TR22GU7M.js → chunk-AX4RBJ7B.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-7A6SEZEY.js → chunk-BEHQCHQV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-BUIF6CMZ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-E2IWEJL5.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-GBU7GKNJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-EQCQTYKO.js → chunk-K35KTBDZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-VQIC3UZB.js → chunk-KNST4PGF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-P2H3GTJK.js → chunk-L2XJB5PK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-L6NOGC4N.js +100 -0
- package/dist/cli-bundle/focused-chunks/{chunk-VK3IE3TS.js → chunk-LWIIDPAV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6IY5CVGJ.js → chunk-M54BMYG4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6BKT6XQN.js → chunk-NEK7RX3N.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BHNBPCHP.js → chunk-OKGWIW6C.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-2DGKVXFT.js → chunk-RFDSSOTZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-SSX5YBDC.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OG57ESZK.js → chunk-TIEQVIFN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SQ72CVUH.js → chunk-VEUBDQDP.js} +54 -54
- package/dist/cli-bundle/focused-chunks/{chunk-2UWKU2BQ.js → chunk-WDHNPNHX.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{field-option-collisions-2C6DLUC4.js → field-option-collisions-32X7FP3H.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-revision-GUYSVVQD.js +2 -0
- package/dist/cli-bundle/focused-chunks/{item-transaction-2K4SFLJ7.js → item-transaction-MLKHZPL7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-actor-DJMZUIZI.js → mutation-actor-RDZJTRW2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-SDWQVVHN.js → mutation-admission-IQB6XL75.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-QBZIK3T5.js → stage-AA7LORZ2.js} +2 -2
- package/dist/cli-bundle/main.js +27 -27
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +63 -63
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +9 -9
- package/dist/core/extensions/loader.d.ts +8 -0
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/item/actionability.js +1 -1
- package/dist/core/output/output.js +16 -16
- package/dist/mcp/server.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/extension/install-sources.d.ts +2 -2
- package/dist/sdk/extension/install-sources.js +5 -5
- package/dist/sdk/lifecycle/expect-hash-admission.d.ts +27 -8
- package/dist/sdk/lifecycle/expect-hash-admission.js +1 -1
- package/dist/sdk/lifecycle/item-revision.d.ts +12 -4
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/output-projection.d.ts +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/read-output/surfaces.js +1 -1
- package/dist/sdk/runtime/schema.js +1 -1
- package/dist/sdk/runtime-input.d.ts +6 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime.js +1 -1
- package/docs/COMMANDS.md +23 -5
- package/docs/EXTENSIONS.md +1 -1
- package/docs/SDK.md +15 -2
- package/marketplace.json +1 -1
- package/node_modules/tar/README.md +1792 -1147
- package/node_modules/tar/dist/commonjs/bytes.d.ts +21 -0
- package/node_modules/tar/dist/commonjs/bytes.js +83 -0
- package/node_modules/tar/dist/commonjs/codec.d.ts +53 -0
- package/node_modules/tar/dist/commonjs/codec.js +35 -0
- package/node_modules/tar/dist/commonjs/concat.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/concat.js +20 -0
- package/node_modules/tar/dist/commonjs/create.d.ts +39 -2
- package/node_modules/tar/dist/commonjs/create.js +150 -64
- package/node_modules/tar/dist/commonjs/dealias.d.ts +79 -0
- package/node_modules/tar/dist/commonjs/dealias.js +50 -0
- package/node_modules/tar/dist/commonjs/delete.d.ts +19 -0
- package/node_modules/tar/dist/commonjs/delete.js +121 -0
- package/node_modules/tar/dist/commonjs/entries.d.ts +82 -0
- package/node_modules/tar/dist/commonjs/entries.js +398 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts +14 -2
- package/node_modules/tar/dist/commonjs/extract.js +40 -81
- package/node_modules/tar/dist/commonjs/fs.d.ts +201 -0
- package/node_modules/tar/dist/commonjs/fs.js +5 -0
- package/node_modules/tar/dist/commonjs/header.d.ts +4 -4
- package/node_modules/tar/dist/commonjs/header.js +71 -53
- package/node_modules/tar/dist/commonjs/index.d.ts +25 -18
- package/node_modules/tar/dist/commonjs/index.js +46 -18
- package/node_modules/tar/dist/commonjs/index.min.js +2 -3
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts +2 -2
- package/node_modules/tar/dist/commonjs/large-numbers.js +4 -4
- package/node_modules/tar/dist/commonjs/list.d.ts +23 -6
- package/node_modules/tar/dist/commonjs/list.js +99 -138
- package/node_modules/tar/dist/commonjs/mkdir.d.ts +16 -11
- package/node_modules/tar/dist/commonjs/mkdir.js +121 -159
- package/node_modules/tar/dist/commonjs/normalize-unicode.js +9 -0
- package/node_modules/tar/dist/commonjs/options.d.ts +284 -513
- package/node_modules/tar/dist/commonjs/options.js +20 -61
- package/node_modules/tar/dist/commonjs/pack.d.ts +150 -96
- package/node_modules/tar/dist/commonjs/pack.js +752 -445
- package/node_modules/tar/dist/commonjs/parser.d.ts +98 -0
- package/node_modules/tar/dist/commonjs/parser.js +452 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts +17 -7
- package/node_modules/tar/dist/commonjs/path-reservations.js +110 -140
- package/node_modules/tar/dist/commonjs/path.d.ts +19 -0
- package/node_modules/tar/dist/commonjs/path.js +90 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts +3 -1
- package/node_modules/tar/dist/commonjs/pax.js +67 -36
- package/node_modules/tar/dist/commonjs/read-entry.d.ts +97 -11
- package/node_modules/tar/dist/commonjs/read-entry.js +251 -97
- package/node_modules/tar/dist/commonjs/read-file.d.ts +22 -0
- package/node_modules/tar/dist/commonjs/read-file.js +104 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts +45 -1
- package/node_modules/tar/dist/commonjs/replace.js +164 -211
- package/node_modules/tar/dist/commonjs/server/codecs.d.ts +38 -0
- package/node_modules/tar/dist/commonjs/server/codecs.js +252 -0
- package/node_modules/tar/dist/commonjs/server/index.d.ts +115 -0
- package/node_modules/tar/dist/commonjs/server/index.js +166 -0
- package/node_modules/tar/dist/commonjs/server/index.min.js +3 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +8 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js +17 -20
- package/node_modules/tar/dist/commonjs/to-stream.d.ts +7 -0
- package/node_modules/tar/dist/commonjs/to-stream.js +22 -0
- package/node_modules/tar/dist/commonjs/types.d.ts +4 -3
- package/node_modules/tar/dist/commonjs/types.js +4 -3
- package/node_modules/tar/dist/commonjs/unpack.d.ts +143 -89
- package/node_modules/tar/dist/commonjs/unpack.js +780 -725
- package/node_modules/tar/dist/commonjs/update.d.ts +11 -1
- package/node_modules/tar/dist/commonjs/update.js +37 -28
- package/node_modules/tar/dist/commonjs/warn.d.ts +27 -0
- package/node_modules/tar/dist/commonjs/warn.js +36 -0
- package/node_modules/tar/dist/commonjs/win32-path.d.ts +16 -0
- package/node_modules/tar/dist/commonjs/win32-path.js +67 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts +64 -111
- package/node_modules/tar/dist/commonjs/write-entry.js +108 -672
- package/node_modules/tar/dist/commonjs/write-flag.d.ts +18 -0
- package/node_modules/tar/dist/commonjs/write-flag.js +29 -0
- package/node_modules/tar/dist/esm/bytes.d.ts +21 -0
- package/node_modules/tar/dist/esm/bytes.js +72 -0
- package/node_modules/tar/dist/esm/codec.d.ts +53 -0
- package/node_modules/tar/dist/esm/codec.js +32 -0
- package/node_modules/tar/dist/esm/concat.d.ts +3 -0
- package/node_modules/tar/dist/esm/concat.js +16 -0
- package/node_modules/tar/dist/esm/create.d.ts +39 -2
- package/node_modules/tar/dist/esm/create.js +144 -61
- package/node_modules/tar/dist/esm/dealias.d.ts +79 -0
- package/node_modules/tar/dist/esm/dealias.js +46 -0
- package/node_modules/tar/dist/esm/delete.d.ts +19 -0
- package/node_modules/tar/dist/esm/delete.js +117 -0
- package/node_modules/tar/dist/esm/entries.d.ts +82 -0
- package/node_modules/tar/dist/esm/entries.js +388 -0
- package/node_modules/tar/dist/esm/extract.d.ts +14 -2
- package/node_modules/tar/dist/esm/extract.js +37 -44
- package/node_modules/tar/dist/esm/fs.d.ts +201 -0
- package/node_modules/tar/dist/esm/fs.js +4 -0
- package/node_modules/tar/dist/esm/header.d.ts +4 -4
- package/node_modules/tar/dist/esm/header.js +71 -53
- package/node_modules/tar/dist/esm/index.d.ts +25 -18
- package/node_modules/tar/dist/esm/index.js +23 -18
- package/node_modules/tar/dist/esm/index.min.js +2 -3
- package/node_modules/tar/dist/esm/large-numbers.d.ts +2 -2
- package/node_modules/tar/dist/esm/large-numbers.js +4 -4
- package/node_modules/tar/dist/esm/list.d.ts +23 -6
- package/node_modules/tar/dist/esm/list.js +96 -101
- package/node_modules/tar/dist/esm/mkdir.d.ts +16 -11
- package/node_modules/tar/dist/esm/mkdir.js +119 -154
- package/node_modules/tar/dist/esm/normalize-unicode.js +9 -0
- package/node_modules/tar/dist/esm/options.d.ts +284 -513
- package/node_modules/tar/dist/esm/options.js +17 -51
- package/node_modules/tar/dist/esm/pack.d.ts +150 -96
- package/node_modules/tar/dist/esm/pack.js +750 -441
- package/node_modules/tar/dist/esm/parser.d.ts +98 -0
- package/node_modules/tar/dist/esm/parser.js +448 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts +17 -7
- package/node_modules/tar/dist/esm/path-reservations.js +110 -140
- package/node_modules/tar/dist/esm/path.d.ts +19 -0
- package/node_modules/tar/dist/esm/path.js +80 -0
- package/node_modules/tar/dist/esm/pax.d.ts +3 -1
- package/node_modules/tar/dist/esm/pax.js +66 -35
- package/node_modules/tar/dist/esm/read-entry.d.ts +97 -11
- package/node_modules/tar/dist/esm/read-entry.js +248 -96
- package/node_modules/tar/dist/esm/read-file.d.ts +22 -0
- package/node_modules/tar/dist/esm/read-file.js +99 -0
- package/node_modules/tar/dist/esm/replace.d.ts +45 -1
- package/node_modules/tar/dist/esm/replace.js +160 -207
- package/node_modules/tar/dist/esm/server/codecs.d.ts +38 -0
- package/node_modules/tar/dist/esm/server/codecs.js +214 -0
- package/node_modules/tar/dist/esm/server/index.d.ts +115 -0
- package/node_modules/tar/dist/esm/server/index.js +102 -0
- package/node_modules/tar/dist/esm/server/index.min.js +3 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +8 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js +17 -20
- package/node_modules/tar/dist/esm/to-stream.d.ts +7 -0
- package/node_modules/tar/dist/esm/to-stream.js +18 -0
- package/node_modules/tar/dist/esm/types.d.ts +4 -3
- package/node_modules/tar/dist/esm/types.js +4 -3
- package/node_modules/tar/dist/esm/unpack.d.ts +143 -89
- package/node_modules/tar/dist/esm/unpack.js +776 -719
- package/node_modules/tar/dist/esm/update.d.ts +11 -1
- package/node_modules/tar/dist/esm/update.js +35 -28
- package/node_modules/tar/dist/esm/warn.d.ts +27 -0
- package/node_modules/tar/dist/esm/warn.js +31 -0
- package/node_modules/tar/dist/esm/win32-path.d.ts +16 -0
- package/node_modules/tar/dist/esm/win32-path.js +60 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts +64 -111
- package/node_modules/tar/dist/esm/write-entry.js +107 -633
- package/node_modules/tar/dist/esm/write-flag.d.ts +18 -0
- package/node_modules/tar/dist/esm/write-flag.js +25 -0
- package/node_modules/tar/package.json +68 -224
- package/package.json +2 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-A5ZEMOVR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-AJLU6KLW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-C6WM6ZN4.js +0 -9
- package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +0 -2
- package/dist/cli-bundle/chunks/chunk-L2ZSSMYY.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NRQCBUYD.js +0 -113
- package/dist/cli-bundle/chunks/chunk-QDV7S2QS.js +0 -2
- package/dist/cli-bundle/chunks/item-revision-3LENTXYF.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-66RDV7PH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HTDYNY4L.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-N64AC5G6.js +0 -100
- package/dist/cli-bundle/focused-chunks/chunk-PT7RT3T6.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-QZRYGYTI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-SQMOF65W.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-T3ILWAEV.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-W4JMV7GF.js +0 -3
- package/dist/cli-bundle/focused-chunks/item-revision-723XCQPS.js +0 -2
- package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
- package/node_modules/@isaacs/fs-minipass/README.md +0 -71
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
- package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
- package/node_modules/@isaacs/fs-minipass/package.json +0 -72
- package/node_modules/chownr/LICENSE.md +0 -63
- package/node_modules/chownr/README.md +0 -3
- package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
- package/node_modules/chownr/dist/commonjs/index.js +0 -93
- package/node_modules/chownr/dist/commonjs/package.json +0 -3
- package/node_modules/chownr/dist/esm/index.d.ts +0 -3
- package/node_modules/chownr/dist/esm/index.js +0 -85
- package/node_modules/chownr/dist/esm/package.json +0 -3
- package/node_modules/chownr/package.json +0 -69
- package/node_modules/minipass/LICENSE.md +0 -55
- package/node_modules/minipass/README.md +0 -825
- package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
- package/node_modules/minipass/dist/commonjs/index.js +0 -1038
- package/node_modules/minipass/dist/commonjs/package.json +0 -3
- package/node_modules/minipass/dist/esm/index.d.ts +0 -545
- package/node_modules/minipass/dist/esm/index.js +0 -1020
- package/node_modules/minipass/dist/esm/package.json +0 -3
- package/node_modules/minipass/package.json +0 -77
- package/node_modules/minizlib/LICENSE +0 -26
- package/node_modules/minizlib/README.md +0 -64
- package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
- package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
- package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
- package/node_modules/minizlib/dist/commonjs/index.js +0 -416
- package/node_modules/minizlib/dist/commonjs/package.json +0 -3
- package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
- package/node_modules/minizlib/dist/esm/constants.js +0 -117
- package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
- package/node_modules/minizlib/dist/esm/index.js +0 -363
- package/node_modules/minizlib/dist/esm/package.json +0 -3
- package/node_modules/minizlib/package.json +0 -80
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
- package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
- package/node_modules/tar/dist/commonjs/make-command.js +0 -52
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
- package/node_modules/tar/dist/commonjs/parse.d.ts +0 -92
- package/node_modules/tar/dist/commonjs/parse.js +0 -655
- package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
- package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
- package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
- package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
- package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
- package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
- package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
- package/node_modules/tar/dist/esm/make-command.js +0 -48
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
- package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
- package/node_modules/tar/dist/esm/parse.d.ts +0 -92
- package/node_modules/tar/dist/esm/parse.js +0 -651
- package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
- package/node_modules/tar/dist/esm/process-umask.js +0 -3
- package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
- package/node_modules/tar/dist/esm/warn-method.js +0 -27
- package/node_modules/yallist/LICENSE.md +0 -63
- package/node_modules/yallist/README.md +0 -205
- package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
- package/node_modules/yallist/dist/commonjs/index.js +0 -384
- package/node_modules/yallist/dist/commonjs/package.json +0 -3
- package/node_modules/yallist/dist/esm/index.d.ts +0 -39
- package/node_modules/yallist/dist/esm/index.js +0 -379
- package/node_modules/yallist/dist/esm/package.json +0 -3
- package/node_modules/yallist/package.json +0 -68
|
@@ -1,36 +1,122 @@
|
|
|
1
|
-
import { Minipass } from 'minipass';
|
|
2
1
|
import type { Header } from './header.js';
|
|
3
2
|
import type { Pax } from './pax.js';
|
|
4
3
|
import type { EntryTypeName } from './types.js';
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The metadata of one archive entry: the header fields, with the
|
|
6
|
+
* values of the PAX and GNU extended headers applied.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EntryData {
|
|
6
9
|
#private;
|
|
10
|
+
/** The header block of the entry. */
|
|
11
|
+
header: Header;
|
|
12
|
+
/** The PAX header that applies to this entry only. */
|
|
7
13
|
extended?: Pax;
|
|
14
|
+
/** The global PAX header in effect. */
|
|
8
15
|
globalExtended?: Pax;
|
|
9
|
-
header: Header;
|
|
10
|
-
startBlockSize: number;
|
|
11
|
-
blockRemain: number;
|
|
12
|
-
remain: number;
|
|
13
16
|
type: EntryTypeName;
|
|
14
|
-
meta: boolean;
|
|
15
|
-
ignore: boolean;
|
|
16
17
|
path: string;
|
|
18
|
+
/** The permission bits only. */
|
|
17
19
|
mode?: number;
|
|
18
20
|
uid?: number;
|
|
19
21
|
gid?: number;
|
|
20
22
|
uname?: string;
|
|
21
23
|
gname?: string;
|
|
24
|
+
/** The number of bytes in the body. */
|
|
22
25
|
size: number;
|
|
23
26
|
mtime?: Date;
|
|
24
27
|
atime?: Date;
|
|
25
28
|
ctime?: Date;
|
|
26
29
|
linkpath?: string;
|
|
30
|
+
devmaj: number;
|
|
31
|
+
devmin: number;
|
|
27
32
|
dev?: number;
|
|
28
33
|
ino?: number;
|
|
29
34
|
nlink?: number;
|
|
30
|
-
|
|
35
|
+
/** The absolute path of the entry, when a consumer resolves it. */
|
|
31
36
|
absolute?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The body is skipped. Set for a type that is not an object of the
|
|
39
|
+
* file system, and for an entry that the filter refuses.
|
|
40
|
+
*/
|
|
41
|
+
ignore: boolean;
|
|
42
|
+
/** A consumer sets this when it refuses the entry. */
|
|
43
|
+
invalid: boolean;
|
|
44
|
+
/** A consumer sets this when it does not support the type. */
|
|
32
45
|
unsupported: boolean;
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
/**
|
|
47
|
+
* @param win32 change each `\` in `path` and `linkpath` to `/`
|
|
48
|
+
*/
|
|
49
|
+
constructor(header: Header, ex?: Pax, gex?: Pax, win32?: boolean);
|
|
50
|
+
}
|
|
51
|
+
/** Where a `ReadEntry` gets its body. */
|
|
52
|
+
export type BodySource = {
|
|
53
|
+
/**
|
|
54
|
+
* The next part of the body of `entry`. `null` at the end of the
|
|
55
|
+
* body. `undefined` if more input is needed: then await `fill()`
|
|
56
|
+
* and call this again. Throws if the source moved to a later entry.
|
|
57
|
+
*/
|
|
58
|
+
readBody(entry: ReadEntry): Uint8Array | null | undefined;
|
|
59
|
+
/** Read more input. */
|
|
60
|
+
fill(): Promise<void>;
|
|
61
|
+
};
|
|
62
|
+
/** Where a `ReadEntrySync` gets its body. */
|
|
63
|
+
export type BodySourceSync = {
|
|
64
|
+
/**
|
|
65
|
+
* The next part of the body of `entry`, or `null` at the end of the
|
|
66
|
+
* body. Throws if the source moved to a later entry.
|
|
67
|
+
*/
|
|
68
|
+
readBody(entry: ReadEntrySync): Uint8Array | null;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* An archive entry with its body, in the shape of a `Response`. The
|
|
72
|
+
* body can be consumed one time, in one way. It must be consumed
|
|
73
|
+
* before the next entry is read: after that, the rest of it is gone.
|
|
74
|
+
*/
|
|
75
|
+
export declare class ReadEntry extends EntryData {
|
|
76
|
+
#private;
|
|
77
|
+
constructor(header: Header, ex?: Pax, gex?: Pax, win32?: boolean, source?: BodySource);
|
|
78
|
+
/** True when the body started to be consumed. */
|
|
79
|
+
get bodyUsed(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The body as a stream. Each chunk is a view into the input, not a
|
|
82
|
+
* copy. Input is read only when the stream is read.
|
|
83
|
+
*/
|
|
84
|
+
get body(): ReadableStream<Uint8Array>;
|
|
85
|
+
/** The body in a new `Uint8Array`. */
|
|
86
|
+
bytes(): Promise<Uint8Array<ArrayBuffer>>;
|
|
87
|
+
/** The body in a new `ArrayBuffer`. */
|
|
88
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
89
|
+
/**
|
|
90
|
+
* The body, decoded as UTF-8. As with `Response.text()`, a byte
|
|
91
|
+
* order mark at the start is not in the text.
|
|
92
|
+
*/
|
|
93
|
+
text(): Promise<string>;
|
|
94
|
+
/** The body in a new `Blob`. */
|
|
95
|
+
blob(): Promise<Blob>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* An archive entry with its body, for sync code. The body can be
|
|
99
|
+
* consumed one time, in one way. It must be consumed before the next
|
|
100
|
+
* entry is read: after that, the rest of it is gone.
|
|
101
|
+
*/
|
|
102
|
+
export declare class ReadEntrySync extends EntryData {
|
|
103
|
+
#private;
|
|
104
|
+
constructor(header: Header, ex?: Pax, gex?: Pax, win32?: boolean, source?: BodySourceSync);
|
|
105
|
+
/** True when the body started to be consumed. */
|
|
106
|
+
get bodyUsed(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* The parts of the body. Each one is a view into the input, not a
|
|
109
|
+
* copy. Input is read only when the iterator is read.
|
|
110
|
+
*/
|
|
111
|
+
get body(): IterableIterator<Uint8Array>;
|
|
112
|
+
/** The body in a new `Uint8Array`. */
|
|
113
|
+
bytes(): Uint8Array<ArrayBuffer>;
|
|
114
|
+
/** The body in a new `ArrayBuffer`. */
|
|
115
|
+
arrayBuffer(): ArrayBuffer;
|
|
116
|
+
/**
|
|
117
|
+
* The body, decoded as UTF-8. A byte order mark at the start is not
|
|
118
|
+
* in the text.
|
|
119
|
+
*/
|
|
120
|
+
text(): string;
|
|
35
121
|
}
|
|
36
122
|
//# sourceMappingURL=read-entry.d.ts.map
|
|
@@ -1,136 +1,290 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReadEntry = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
exports.ReadEntrySync = exports.ReadEntry = exports.EntryData = void 0;
|
|
4
|
+
const concat_js_1 = require("./concat.js");
|
|
5
|
+
// The types that are an object of the file system.
|
|
6
|
+
const fsTypes = new Set([
|
|
7
|
+
'File',
|
|
8
|
+
'OldFile',
|
|
9
|
+
'Link',
|
|
10
|
+
'SymbolicLink',
|
|
11
|
+
'CharacterDevice',
|
|
12
|
+
'BlockDevice',
|
|
13
|
+
'Directory',
|
|
14
|
+
'FIFO',
|
|
15
|
+
'ContiguousFile',
|
|
16
|
+
'GNUDumpDir',
|
|
17
|
+
]);
|
|
18
|
+
const winPath = (path) => path.replaceAll('\\', '/');
|
|
19
|
+
/**
|
|
20
|
+
* The metadata of one archive entry: the header fields, with the
|
|
21
|
+
* values of the PAX and GNU extended headers applied.
|
|
22
|
+
*/
|
|
23
|
+
class EntryData {
|
|
24
|
+
/** The header block of the entry. */
|
|
25
|
+
header;
|
|
26
|
+
/** The PAX header that applies to this entry only. */
|
|
7
27
|
extended;
|
|
28
|
+
/** The global PAX header in effect. */
|
|
8
29
|
globalExtended;
|
|
9
|
-
header;
|
|
10
|
-
startBlockSize;
|
|
11
|
-
blockRemain;
|
|
12
|
-
remain;
|
|
13
30
|
type;
|
|
14
|
-
meta = false;
|
|
15
|
-
ignore = false;
|
|
16
31
|
path;
|
|
32
|
+
/** The permission bits only. */
|
|
17
33
|
mode;
|
|
18
34
|
uid;
|
|
19
35
|
gid;
|
|
20
36
|
uname;
|
|
21
37
|
gname;
|
|
22
|
-
|
|
38
|
+
/** The number of bytes in the body. */
|
|
39
|
+
size;
|
|
23
40
|
mtime;
|
|
24
41
|
atime;
|
|
25
42
|
ctime;
|
|
26
43
|
linkpath;
|
|
44
|
+
devmaj;
|
|
45
|
+
devmin;
|
|
27
46
|
dev;
|
|
28
47
|
ino;
|
|
29
48
|
nlink;
|
|
30
|
-
|
|
49
|
+
/** The absolute path of the entry, when a consumer resolves it. */
|
|
31
50
|
absolute;
|
|
51
|
+
/**
|
|
52
|
+
* The body is skipped. Set for a type that is not an object of the
|
|
53
|
+
* file system, and for an entry that the filter refuses.
|
|
54
|
+
*/
|
|
55
|
+
ignore;
|
|
56
|
+
/** A consumer sets this when it refuses the entry. */
|
|
57
|
+
invalid = false;
|
|
58
|
+
/** A consumer sets this when it does not support the type. */
|
|
32
59
|
unsupported = false;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// in an entry ending before we're ready for it.
|
|
38
|
-
this.pause();
|
|
39
|
-
this.extended = ex;
|
|
40
|
-
this.globalExtended = gex;
|
|
41
|
-
this.header = header;
|
|
42
|
-
/* c8 ignore start */
|
|
43
|
-
this.remain = header.size ?? 0;
|
|
44
|
-
/* c8 ignore stop */
|
|
45
|
-
this.startBlockSize = 512 * Math.ceil(this.remain / 512);
|
|
46
|
-
this.blockRemain = this.startBlockSize;
|
|
47
|
-
this.type = header.type;
|
|
48
|
-
switch (this.type) {
|
|
49
|
-
case 'File':
|
|
50
|
-
case 'OldFile':
|
|
51
|
-
case 'Link':
|
|
52
|
-
case 'SymbolicLink':
|
|
53
|
-
case 'CharacterDevice':
|
|
54
|
-
case 'BlockDevice':
|
|
55
|
-
case 'Directory':
|
|
56
|
-
case 'FIFO':
|
|
57
|
-
case 'ContiguousFile':
|
|
58
|
-
case 'GNUDumpDir':
|
|
59
|
-
break;
|
|
60
|
-
case 'NextFileHasLongLinkpath':
|
|
61
|
-
case 'NextFileHasLongPath':
|
|
62
|
-
case 'OldGnuLongPath':
|
|
63
|
-
case 'GlobalExtendedHeader':
|
|
64
|
-
case 'ExtendedHeader':
|
|
65
|
-
case 'OldExtendedHeader':
|
|
66
|
-
this.meta = true;
|
|
67
|
-
break;
|
|
68
|
-
// NOTE: gnutar and bsdtar treat unrecognized types as 'File'
|
|
69
|
-
// it may be worth doing the same, but with a warning.
|
|
70
|
-
default:
|
|
71
|
-
this.ignore = true;
|
|
72
|
-
}
|
|
73
|
-
/* c8 ignore start */
|
|
60
|
+
/**
|
|
61
|
+
* @param win32 change each `\` in `path` and `linkpath` to `/`
|
|
62
|
+
*/
|
|
63
|
+
constructor(header, ex, gex, win32 = false) {
|
|
74
64
|
if (!header.path) {
|
|
75
65
|
throw new Error('no path provided for tar.ReadEntry');
|
|
76
66
|
}
|
|
77
|
-
|
|
78
|
-
this.
|
|
79
|
-
this.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
this.header = header;
|
|
68
|
+
this.extended = ex;
|
|
69
|
+
this.globalExtended = gex;
|
|
70
|
+
this.type = header.type;
|
|
71
|
+
this.ignore = !fsTypes.has(this.type);
|
|
72
|
+
this.path = win32 ? winPath(header.path) : header.path;
|
|
73
|
+
this.mode = header.mode && header.mode & 0o7777;
|
|
83
74
|
this.uid = header.uid;
|
|
84
75
|
this.gid = header.gid;
|
|
85
76
|
this.uname = header.uname;
|
|
86
77
|
this.gname = header.gname;
|
|
87
|
-
this.size =
|
|
78
|
+
this.size = header.size ?? 0;
|
|
88
79
|
this.mtime = header.mtime;
|
|
89
80
|
this.atime = header.atime;
|
|
90
81
|
this.ctime = header.ctime;
|
|
91
|
-
|
|
82
|
+
// Only a link has a linkpath. Other tar programs do not use the
|
|
83
|
+
// link name of an entry of a different type.
|
|
84
|
+
const link = this.type === 'Link' || this.type === 'SymbolicLink';
|
|
92
85
|
this.linkpath =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
link && header.linkpath ?
|
|
87
|
+
win32 ? winPath(header.linkpath)
|
|
88
|
+
: header.linkpath
|
|
89
|
+
: undefined;
|
|
90
|
+
this.devmaj = header.devmaj;
|
|
91
|
+
this.devmin = header.devmin;
|
|
92
|
+
// Apply the global values first, so that the local values win.
|
|
93
|
+
// The header already has the size.
|
|
94
|
+
if (gex)
|
|
95
|
+
this.#apply(gex);
|
|
97
96
|
if (ex) {
|
|
98
|
-
this.#
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
this.#apply(ex);
|
|
98
|
+
// A global header does not set a path or a linkpath.
|
|
99
|
+
if (ex.path != null)
|
|
100
|
+
this.path = win32 ? winPath(ex.path) : ex.path;
|
|
101
|
+
if (link && ex.linkpath != null) {
|
|
102
|
+
this.linkpath = win32 ? winPath(ex.linkpath) : ex.linkpath;
|
|
103
|
+
}
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
#apply(ex) {
|
|
107
|
+
if (ex.uid != null)
|
|
108
|
+
this.uid = ex.uid;
|
|
109
|
+
if (ex.gid != null)
|
|
110
|
+
this.gid = ex.gid;
|
|
111
|
+
if (ex.uname != null)
|
|
112
|
+
this.uname = ex.uname;
|
|
113
|
+
if (ex.gname != null)
|
|
114
|
+
this.gname = ex.gname;
|
|
115
|
+
if (ex.mtime != null)
|
|
116
|
+
this.mtime = ex.mtime;
|
|
117
|
+
if (ex.atime != null)
|
|
118
|
+
this.atime = ex.atime;
|
|
119
|
+
if (ex.ctime != null)
|
|
120
|
+
this.ctime = ex.ctime;
|
|
121
|
+
if (ex.dev != null)
|
|
122
|
+
this.dev = ex.dev;
|
|
123
|
+
if (ex.ino != null)
|
|
124
|
+
this.ino = ex.ino;
|
|
125
|
+
if (ex.nlink != null)
|
|
126
|
+
this.nlink = ex.nlink;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.EntryData = EntryData;
|
|
130
|
+
// As `Response.text()` does, this decoder removes a byte order mark
|
|
131
|
+
// at the start of the body.
|
|
132
|
+
const decoder = new TextDecoder();
|
|
133
|
+
const decode = (parts) => {
|
|
134
|
+
let text = '';
|
|
135
|
+
for (const part of parts)
|
|
136
|
+
text += decoder.decode(part, { stream: true });
|
|
137
|
+
return text + decoder.decode();
|
|
138
|
+
};
|
|
139
|
+
const usedError = () => new TypeError('Body has already been consumed');
|
|
140
|
+
/**
|
|
141
|
+
* An archive entry with its body, in the shape of a `Response`. The
|
|
142
|
+
* body can be consumed one time, in one way. It must be consumed
|
|
143
|
+
* before the next entry is read: after that, the rest of it is gone.
|
|
144
|
+
*/
|
|
145
|
+
class ReadEntry extends EntryData {
|
|
146
|
+
#source;
|
|
147
|
+
#used = false;
|
|
148
|
+
#stream;
|
|
149
|
+
constructor(header, ex, gex, win32, source) {
|
|
150
|
+
super(header, ex, gex, win32);
|
|
151
|
+
this.#source = source;
|
|
152
|
+
}
|
|
153
|
+
/** True when the body started to be consumed. */
|
|
154
|
+
get bodyUsed() {
|
|
155
|
+
return this.#used;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The body as a stream. Each chunk is a view into the input, not a
|
|
159
|
+
* copy. Input is read only when the stream is read.
|
|
160
|
+
*/
|
|
161
|
+
get body() {
|
|
162
|
+
if (this.#stream)
|
|
163
|
+
return this.#stream;
|
|
164
|
+
let started = false;
|
|
165
|
+
return (this.#stream = new ReadableStream({
|
|
166
|
+
pull: async (controller) => {
|
|
167
|
+
if (!started) {
|
|
168
|
+
this.#claim();
|
|
169
|
+
started = true;
|
|
170
|
+
}
|
|
171
|
+
const [part] = await this.#read(1);
|
|
172
|
+
if (part)
|
|
173
|
+
controller.enqueue(part);
|
|
174
|
+
else
|
|
175
|
+
controller.close();
|
|
176
|
+
},
|
|
177
|
+
}, { highWaterMark: 0 }));
|
|
178
|
+
}
|
|
179
|
+
#claim() {
|
|
180
|
+
if (this.#used)
|
|
181
|
+
throw usedError();
|
|
182
|
+
this.#used = true;
|
|
183
|
+
}
|
|
184
|
+
// Add the parts of the body that are in memory to `parts`, up to
|
|
185
|
+
// `max` parts. False if the body has more parts that need input.
|
|
186
|
+
#collect(parts, max = Infinity) {
|
|
187
|
+
const source = this.#source;
|
|
188
|
+
while (source && parts.length < max) {
|
|
189
|
+
const part = source.readBody(this);
|
|
190
|
+
if (part === null)
|
|
191
|
+
break;
|
|
192
|
+
if (part === undefined)
|
|
193
|
+
return false;
|
|
194
|
+
parts.push(part);
|
|
118
195
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
#
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
// Read all the parts of the body that are left, or `max` of them.
|
|
199
|
+
async #read(max) {
|
|
200
|
+
const parts = [];
|
|
201
|
+
while (!this.#collect(parts, max))
|
|
202
|
+
await this.#source?.fill();
|
|
203
|
+
return parts;
|
|
204
|
+
}
|
|
205
|
+
/** The body in a new `Uint8Array`. */
|
|
206
|
+
async bytes() {
|
|
207
|
+
this.#claim();
|
|
208
|
+
const parts = [];
|
|
209
|
+
while (!this.#collect(parts))
|
|
210
|
+
await this.#source?.fill();
|
|
211
|
+
return (0, concat_js_1.concat)(parts);
|
|
212
|
+
}
|
|
213
|
+
/** The body in a new `ArrayBuffer`. */
|
|
214
|
+
async arrayBuffer() {
|
|
215
|
+
return (await this.bytes()).buffer;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* The body, decoded as UTF-8. As with `Response.text()`, a byte
|
|
219
|
+
* order mark at the start is not in the text.
|
|
220
|
+
*/
|
|
221
|
+
async text() {
|
|
222
|
+
this.#claim();
|
|
223
|
+
return decode(await this.#read());
|
|
224
|
+
}
|
|
225
|
+
/** The body in a new `Blob`. */
|
|
226
|
+
async blob() {
|
|
227
|
+
this.#claim();
|
|
228
|
+
return new Blob((await this.#read()));
|
|
133
229
|
}
|
|
134
230
|
}
|
|
135
231
|
exports.ReadEntry = ReadEntry;
|
|
232
|
+
/**
|
|
233
|
+
* An archive entry with its body, for sync code. The body can be
|
|
234
|
+
* consumed one time, in one way. It must be consumed before the next
|
|
235
|
+
* entry is read: after that, the rest of it is gone.
|
|
236
|
+
*/
|
|
237
|
+
class ReadEntrySync extends EntryData {
|
|
238
|
+
#source;
|
|
239
|
+
#used = false;
|
|
240
|
+
#body;
|
|
241
|
+
constructor(header, ex, gex, win32, source) {
|
|
242
|
+
super(header, ex, gex, win32);
|
|
243
|
+
this.#source = source;
|
|
244
|
+
}
|
|
245
|
+
/** True when the body started to be consumed. */
|
|
246
|
+
get bodyUsed() {
|
|
247
|
+
return this.#used;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* The parts of the body. Each one is a view into the input, not a
|
|
251
|
+
* copy. Input is read only when the iterator is read.
|
|
252
|
+
*/
|
|
253
|
+
get body() {
|
|
254
|
+
return (this.#body ??= this.#iterate());
|
|
255
|
+
}
|
|
256
|
+
*#iterate() {
|
|
257
|
+
this.#claim();
|
|
258
|
+
for (let part; (part = this.#source?.readBody(this));)
|
|
259
|
+
yield part;
|
|
260
|
+
}
|
|
261
|
+
#claim() {
|
|
262
|
+
if (this.#used)
|
|
263
|
+
throw usedError();
|
|
264
|
+
this.#used = true;
|
|
265
|
+
}
|
|
266
|
+
#read() {
|
|
267
|
+
this.#claim();
|
|
268
|
+
const parts = [];
|
|
269
|
+
for (let part; (part = this.#source?.readBody(this));)
|
|
270
|
+
parts.push(part);
|
|
271
|
+
return parts;
|
|
272
|
+
}
|
|
273
|
+
/** The body in a new `Uint8Array`. */
|
|
274
|
+
bytes() {
|
|
275
|
+
return (0, concat_js_1.concat)(this.#read());
|
|
276
|
+
}
|
|
277
|
+
/** The body in a new `ArrayBuffer`. */
|
|
278
|
+
arrayBuffer() {
|
|
279
|
+
return this.bytes().buffer;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* The body, decoded as UTF-8. A byte order mark at the start is not
|
|
283
|
+
* in the text.
|
|
284
|
+
*/
|
|
285
|
+
text() {
|
|
286
|
+
return decode(this.#read());
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
exports.ReadEntrySync = ReadEntrySync;
|
|
136
290
|
//# sourceMappingURL=read-entry.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TarFS, TarFSSync } from './fs.js';
|
|
2
|
+
/**
|
|
3
|
+
* The key of the method of a chunk source that skips input. A
|
|
4
|
+
* `TarReader` calls it with the number of bytes of a body that are
|
|
5
|
+
* after the chunks given so far, when no consumer reads that body.
|
|
6
|
+
* If it returns true, the next chunk starts after those bytes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SKIP: unique symbol;
|
|
9
|
+
/** A chunk source that can skip input. */
|
|
10
|
+
export type Skip = {
|
|
11
|
+
[SKIP](n: number): boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Read a file in chunks of `maxReadSize` bytes at most. The default,
|
|
15
|
+
* and the value for 0, is 16 MiB. Each chunk is a new array. The
|
|
16
|
+
* first chunk is small, and the chunks grow. A reader can skip a
|
|
17
|
+
* large part of the file.
|
|
18
|
+
*/
|
|
19
|
+
export declare const readFile: (fs: TarFS, file: string, maxReadSize?: number) => AsyncGenerator<Uint8Array, void, void> & Skip;
|
|
20
|
+
/** The sync form of `readFile`. */
|
|
21
|
+
export declare const readFileSync: (fs: TarFSSync, file: string, maxReadSize?: number) => Generator<Uint8Array, void, void> & Skip;
|
|
22
|
+
//# sourceMappingURL=read-file.d.ts.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readFileSync = exports.readFile = exports.SKIP = void 0;
|
|
4
|
+
const options_js_1 = require("./options.js");
|
|
5
|
+
const MAX_READ = 16 * 1024 * 1024;
|
|
6
|
+
// The size of the first read, and of the read after a skip.
|
|
7
|
+
const FIRST_READ = 64 * 1024;
|
|
8
|
+
// A skip of fewer bytes than this is slower than a read of them.
|
|
9
|
+
const MIN_SKIP = 1024 * 1024;
|
|
10
|
+
/**
|
|
11
|
+
* The key of the method of a chunk source that skips input. A
|
|
12
|
+
* `TarReader` calls it with the number of bytes of a body that are
|
|
13
|
+
* after the chunks given so far, when no consumer reads that body.
|
|
14
|
+
* If it returns true, the next chunk starts after those bytes.
|
|
15
|
+
*/
|
|
16
|
+
exports.SKIP = Symbol.for('tar.readFile.skip');
|
|
17
|
+
// The place and the size of the next read of a file.
|
|
18
|
+
class Plan {
|
|
19
|
+
pos = 0;
|
|
20
|
+
/** The size of the file. 0 before the file is open. */
|
|
21
|
+
size = 0;
|
|
22
|
+
#max;
|
|
23
|
+
#want = FIRST_READ;
|
|
24
|
+
constructor(maxReadSize) {
|
|
25
|
+
this.#max = (0, options_js_1.countOption)('maxReadSize', maxReadSize, MAX_READ);
|
|
26
|
+
}
|
|
27
|
+
// The number of bytes to read at `pos`. 0 at the end of the file.
|
|
28
|
+
// Each read is two times the size of the read before it, so that
|
|
29
|
+
// an archive of small entries is read in few reads.
|
|
30
|
+
next() {
|
|
31
|
+
const n = Math.min(this.#want, this.#max, this.size - this.pos);
|
|
32
|
+
this.#want *= 2;
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
// Skip only inside the file: the parser must see where a truncated
|
|
36
|
+
// file ends. The read after a skip is small, because a header
|
|
37
|
+
// comes next, and the body after it can be skipped also.
|
|
38
|
+
skip(n) {
|
|
39
|
+
if (n < MIN_SKIP || this.pos + n > this.size)
|
|
40
|
+
return false;
|
|
41
|
+
this.pos += n;
|
|
42
|
+
this.#want = FIRST_READ;
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function* chunks(fs, file, plan) {
|
|
47
|
+
const handle = await fs.open(file, 'r');
|
|
48
|
+
try {
|
|
49
|
+
plan.size = (await handle.stat()).size;
|
|
50
|
+
for (let n; (n = plan.next());) {
|
|
51
|
+
const buf = new Uint8Array(n);
|
|
52
|
+
const { bytesRead } = await handle.read(buf, 0, n, plan.pos);
|
|
53
|
+
if (!bytesRead)
|
|
54
|
+
break;
|
|
55
|
+
plan.pos += bytesRead;
|
|
56
|
+
yield bytesRead < n ? buf.subarray(0, bytesRead) : buf;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
await handle.close().catch(() => { });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function* chunksSync(fs, file, plan) {
|
|
64
|
+
const fd = fs.openSync(file, 'r');
|
|
65
|
+
try {
|
|
66
|
+
plan.size = fs.fstatSync(fd).size;
|
|
67
|
+
for (let n; (n = plan.next());) {
|
|
68
|
+
const buf = new Uint8Array(n);
|
|
69
|
+
const bytesRead = fs.readSync(fd, buf, 0, n, plan.pos);
|
|
70
|
+
if (!bytesRead)
|
|
71
|
+
break;
|
|
72
|
+
plan.pos += bytesRead;
|
|
73
|
+
yield bytesRead < n ? buf.subarray(0, bytesRead) : buf;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
try {
|
|
78
|
+
fs.closeSync(fd);
|
|
79
|
+
}
|
|
80
|
+
catch { }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Read a file in chunks of `maxReadSize` bytes at most. The default,
|
|
85
|
+
* and the value for 0, is 16 MiB. Each chunk is a new array. The
|
|
86
|
+
* first chunk is small, and the chunks grow. A reader can skip a
|
|
87
|
+
* large part of the file.
|
|
88
|
+
*/
|
|
89
|
+
const readFile = (fs, file, maxReadSize) => {
|
|
90
|
+
const plan = new Plan(maxReadSize);
|
|
91
|
+
return Object.assign(chunks(fs, file, plan), {
|
|
92
|
+
[exports.SKIP]: (n) => plan.skip(n),
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
exports.readFile = readFile;
|
|
96
|
+
/** The sync form of `readFile`. */
|
|
97
|
+
const readFileSync = (fs, file, maxReadSize) => {
|
|
98
|
+
const plan = new Plan(maxReadSize);
|
|
99
|
+
return Object.assign(chunksSync(fs, file, plan), {
|
|
100
|
+
[exports.SKIP]: (n) => plan.skip(n),
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
exports.readFileSync = readFileSync;
|
|
104
|
+
//# sourceMappingURL=read-file.js.map
|