@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,132 +1,284 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { concat } from './concat.js';
|
|
2
|
+
// The types that are an object of the file system.
|
|
3
|
+
const fsTypes = new Set([
|
|
4
|
+
'File',
|
|
5
|
+
'OldFile',
|
|
6
|
+
'Link',
|
|
7
|
+
'SymbolicLink',
|
|
8
|
+
'CharacterDevice',
|
|
9
|
+
'BlockDevice',
|
|
10
|
+
'Directory',
|
|
11
|
+
'FIFO',
|
|
12
|
+
'ContiguousFile',
|
|
13
|
+
'GNUDumpDir',
|
|
14
|
+
]);
|
|
15
|
+
const winPath = (path) => path.replaceAll('\\', '/');
|
|
16
|
+
/**
|
|
17
|
+
* The metadata of one archive entry: the header fields, with the
|
|
18
|
+
* values of the PAX and GNU extended headers applied.
|
|
19
|
+
*/
|
|
20
|
+
export class EntryData {
|
|
21
|
+
/** The header block of the entry. */
|
|
22
|
+
header;
|
|
23
|
+
/** The PAX header that applies to this entry only. */
|
|
4
24
|
extended;
|
|
25
|
+
/** The global PAX header in effect. */
|
|
5
26
|
globalExtended;
|
|
6
|
-
header;
|
|
7
|
-
startBlockSize;
|
|
8
|
-
blockRemain;
|
|
9
|
-
remain;
|
|
10
27
|
type;
|
|
11
|
-
meta = false;
|
|
12
|
-
ignore = false;
|
|
13
28
|
path;
|
|
29
|
+
/** The permission bits only. */
|
|
14
30
|
mode;
|
|
15
31
|
uid;
|
|
16
32
|
gid;
|
|
17
33
|
uname;
|
|
18
34
|
gname;
|
|
19
|
-
|
|
35
|
+
/** The number of bytes in the body. */
|
|
36
|
+
size;
|
|
20
37
|
mtime;
|
|
21
38
|
atime;
|
|
22
39
|
ctime;
|
|
23
40
|
linkpath;
|
|
41
|
+
devmaj;
|
|
42
|
+
devmin;
|
|
24
43
|
dev;
|
|
25
44
|
ino;
|
|
26
45
|
nlink;
|
|
27
|
-
|
|
46
|
+
/** The absolute path of the entry, when a consumer resolves it. */
|
|
28
47
|
absolute;
|
|
48
|
+
/**
|
|
49
|
+
* The body is skipped. Set for a type that is not an object of the
|
|
50
|
+
* file system, and for an entry that the filter refuses.
|
|
51
|
+
*/
|
|
52
|
+
ignore;
|
|
53
|
+
/** A consumer sets this when it refuses the entry. */
|
|
54
|
+
invalid = false;
|
|
55
|
+
/** A consumer sets this when it does not support the type. */
|
|
29
56
|
unsupported = false;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// in an entry ending before we're ready for it.
|
|
35
|
-
this.pause();
|
|
36
|
-
this.extended = ex;
|
|
37
|
-
this.globalExtended = gex;
|
|
38
|
-
this.header = header;
|
|
39
|
-
/* c8 ignore start */
|
|
40
|
-
this.remain = header.size ?? 0;
|
|
41
|
-
/* c8 ignore stop */
|
|
42
|
-
this.startBlockSize = 512 * Math.ceil(this.remain / 512);
|
|
43
|
-
this.blockRemain = this.startBlockSize;
|
|
44
|
-
this.type = header.type;
|
|
45
|
-
switch (this.type) {
|
|
46
|
-
case 'File':
|
|
47
|
-
case 'OldFile':
|
|
48
|
-
case 'Link':
|
|
49
|
-
case 'SymbolicLink':
|
|
50
|
-
case 'CharacterDevice':
|
|
51
|
-
case 'BlockDevice':
|
|
52
|
-
case 'Directory':
|
|
53
|
-
case 'FIFO':
|
|
54
|
-
case 'ContiguousFile':
|
|
55
|
-
case 'GNUDumpDir':
|
|
56
|
-
break;
|
|
57
|
-
case 'NextFileHasLongLinkpath':
|
|
58
|
-
case 'NextFileHasLongPath':
|
|
59
|
-
case 'OldGnuLongPath':
|
|
60
|
-
case 'GlobalExtendedHeader':
|
|
61
|
-
case 'ExtendedHeader':
|
|
62
|
-
case 'OldExtendedHeader':
|
|
63
|
-
this.meta = true;
|
|
64
|
-
break;
|
|
65
|
-
// NOTE: gnutar and bsdtar treat unrecognized types as 'File'
|
|
66
|
-
// it may be worth doing the same, but with a warning.
|
|
67
|
-
default:
|
|
68
|
-
this.ignore = true;
|
|
69
|
-
}
|
|
70
|
-
/* c8 ignore start */
|
|
57
|
+
/**
|
|
58
|
+
* @param win32 change each `\` in `path` and `linkpath` to `/`
|
|
59
|
+
*/
|
|
60
|
+
constructor(header, ex, gex, win32 = false) {
|
|
71
61
|
if (!header.path) {
|
|
72
62
|
throw new Error('no path provided for tar.ReadEntry');
|
|
73
63
|
}
|
|
74
|
-
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
64
|
+
this.header = header;
|
|
65
|
+
this.extended = ex;
|
|
66
|
+
this.globalExtended = gex;
|
|
67
|
+
this.type = header.type;
|
|
68
|
+
this.ignore = !fsTypes.has(this.type);
|
|
69
|
+
this.path = win32 ? winPath(header.path) : header.path;
|
|
70
|
+
this.mode = header.mode && header.mode & 0o7777;
|
|
80
71
|
this.uid = header.uid;
|
|
81
72
|
this.gid = header.gid;
|
|
82
73
|
this.uname = header.uname;
|
|
83
74
|
this.gname = header.gname;
|
|
84
|
-
this.size =
|
|
75
|
+
this.size = header.size ?? 0;
|
|
85
76
|
this.mtime = header.mtime;
|
|
86
77
|
this.atime = header.atime;
|
|
87
78
|
this.ctime = header.ctime;
|
|
88
|
-
|
|
79
|
+
// Only a link has a linkpath. Other tar programs do not use the
|
|
80
|
+
// link name of an entry of a different type.
|
|
81
|
+
const link = this.type === 'Link' || this.type === 'SymbolicLink';
|
|
89
82
|
this.linkpath =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
link && header.linkpath ?
|
|
84
|
+
win32 ? winPath(header.linkpath)
|
|
85
|
+
: header.linkpath
|
|
86
|
+
: undefined;
|
|
87
|
+
this.devmaj = header.devmaj;
|
|
88
|
+
this.devmin = header.devmin;
|
|
89
|
+
// Apply the global values first, so that the local values win.
|
|
90
|
+
// The header already has the size.
|
|
91
|
+
if (gex)
|
|
92
|
+
this.#apply(gex);
|
|
94
93
|
if (ex) {
|
|
95
|
-
this.#
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
this.#apply(ex);
|
|
95
|
+
// A global header does not set a path or a linkpath.
|
|
96
|
+
if (ex.path != null)
|
|
97
|
+
this.path = win32 ? winPath(ex.path) : ex.path;
|
|
98
|
+
if (link && ex.linkpath != null) {
|
|
99
|
+
this.linkpath = win32 ? winPath(ex.linkpath) : ex.linkpath;
|
|
100
|
+
}
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
#apply(ex) {
|
|
104
|
+
if (ex.uid != null)
|
|
105
|
+
this.uid = ex.uid;
|
|
106
|
+
if (ex.gid != null)
|
|
107
|
+
this.gid = ex.gid;
|
|
108
|
+
if (ex.uname != null)
|
|
109
|
+
this.uname = ex.uname;
|
|
110
|
+
if (ex.gname != null)
|
|
111
|
+
this.gname = ex.gname;
|
|
112
|
+
if (ex.mtime != null)
|
|
113
|
+
this.mtime = ex.mtime;
|
|
114
|
+
if (ex.atime != null)
|
|
115
|
+
this.atime = ex.atime;
|
|
116
|
+
if (ex.ctime != null)
|
|
117
|
+
this.ctime = ex.ctime;
|
|
118
|
+
if (ex.dev != null)
|
|
119
|
+
this.dev = ex.dev;
|
|
120
|
+
if (ex.ino != null)
|
|
121
|
+
this.ino = ex.ino;
|
|
122
|
+
if (ex.nlink != null)
|
|
123
|
+
this.nlink = ex.nlink;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// As `Response.text()` does, this decoder removes a byte order mark
|
|
127
|
+
// at the start of the body.
|
|
128
|
+
const decoder = new TextDecoder();
|
|
129
|
+
const decode = (parts) => {
|
|
130
|
+
let text = '';
|
|
131
|
+
for (const part of parts)
|
|
132
|
+
text += decoder.decode(part, { stream: true });
|
|
133
|
+
return text + decoder.decode();
|
|
134
|
+
};
|
|
135
|
+
const usedError = () => new TypeError('Body has already been consumed');
|
|
136
|
+
/**
|
|
137
|
+
* An archive entry with its body, in the shape of a `Response`. The
|
|
138
|
+
* body can be consumed one time, in one way. It must be consumed
|
|
139
|
+
* before the next entry is read: after that, the rest of it is gone.
|
|
140
|
+
*/
|
|
141
|
+
export class ReadEntry extends EntryData {
|
|
142
|
+
#source;
|
|
143
|
+
#used = false;
|
|
144
|
+
#stream;
|
|
145
|
+
constructor(header, ex, gex, win32, source) {
|
|
146
|
+
super(header, ex, gex, win32);
|
|
147
|
+
this.#source = source;
|
|
148
|
+
}
|
|
149
|
+
/** True when the body started to be consumed. */
|
|
150
|
+
get bodyUsed() {
|
|
151
|
+
return this.#used;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The body as a stream. Each chunk is a view into the input, not a
|
|
155
|
+
* copy. Input is read only when the stream is read.
|
|
156
|
+
*/
|
|
157
|
+
get body() {
|
|
158
|
+
if (this.#stream)
|
|
159
|
+
return this.#stream;
|
|
160
|
+
let started = false;
|
|
161
|
+
return (this.#stream = new ReadableStream({
|
|
162
|
+
pull: async (controller) => {
|
|
163
|
+
if (!started) {
|
|
164
|
+
this.#claim();
|
|
165
|
+
started = true;
|
|
166
|
+
}
|
|
167
|
+
const [part] = await this.#read(1);
|
|
168
|
+
if (part)
|
|
169
|
+
controller.enqueue(part);
|
|
170
|
+
else
|
|
171
|
+
controller.close();
|
|
172
|
+
},
|
|
173
|
+
}, { highWaterMark: 0 }));
|
|
174
|
+
}
|
|
175
|
+
#claim() {
|
|
176
|
+
if (this.#used)
|
|
177
|
+
throw usedError();
|
|
178
|
+
this.#used = true;
|
|
179
|
+
}
|
|
180
|
+
// Add the parts of the body that are in memory to `parts`, up to
|
|
181
|
+
// `max` parts. False if the body has more parts that need input.
|
|
182
|
+
#collect(parts, max = Infinity) {
|
|
183
|
+
const source = this.#source;
|
|
184
|
+
while (source && parts.length < max) {
|
|
185
|
+
const part = source.readBody(this);
|
|
186
|
+
if (part === null)
|
|
187
|
+
break;
|
|
188
|
+
if (part === undefined)
|
|
189
|
+
return false;
|
|
190
|
+
parts.push(part);
|
|
115
191
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
#
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
// Read all the parts of the body that are left, or `max` of them.
|
|
195
|
+
async #read(max) {
|
|
196
|
+
const parts = [];
|
|
197
|
+
while (!this.#collect(parts, max))
|
|
198
|
+
await this.#source?.fill();
|
|
199
|
+
return parts;
|
|
200
|
+
}
|
|
201
|
+
/** The body in a new `Uint8Array`. */
|
|
202
|
+
async bytes() {
|
|
203
|
+
this.#claim();
|
|
204
|
+
const parts = [];
|
|
205
|
+
while (!this.#collect(parts))
|
|
206
|
+
await this.#source?.fill();
|
|
207
|
+
return concat(parts);
|
|
208
|
+
}
|
|
209
|
+
/** The body in a new `ArrayBuffer`. */
|
|
210
|
+
async arrayBuffer() {
|
|
211
|
+
return (await this.bytes()).buffer;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* The body, decoded as UTF-8. As with `Response.text()`, a byte
|
|
215
|
+
* order mark at the start is not in the text.
|
|
216
|
+
*/
|
|
217
|
+
async text() {
|
|
218
|
+
this.#claim();
|
|
219
|
+
return decode(await this.#read());
|
|
220
|
+
}
|
|
221
|
+
/** The body in a new `Blob`. */
|
|
222
|
+
async blob() {
|
|
223
|
+
this.#claim();
|
|
224
|
+
return new Blob((await this.#read()));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* An archive entry with its body, for sync code. The body can be
|
|
229
|
+
* consumed one time, in one way. It must be consumed before the next
|
|
230
|
+
* entry is read: after that, the rest of it is gone.
|
|
231
|
+
*/
|
|
232
|
+
export class ReadEntrySync extends EntryData {
|
|
233
|
+
#source;
|
|
234
|
+
#used = false;
|
|
235
|
+
#body;
|
|
236
|
+
constructor(header, ex, gex, win32, source) {
|
|
237
|
+
super(header, ex, gex, win32);
|
|
238
|
+
this.#source = source;
|
|
239
|
+
}
|
|
240
|
+
/** True when the body started to be consumed. */
|
|
241
|
+
get bodyUsed() {
|
|
242
|
+
return this.#used;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* The parts of the body. Each one is a view into the input, not a
|
|
246
|
+
* copy. Input is read only when the iterator is read.
|
|
247
|
+
*/
|
|
248
|
+
get body() {
|
|
249
|
+
return (this.#body ??= this.#iterate());
|
|
250
|
+
}
|
|
251
|
+
*#iterate() {
|
|
252
|
+
this.#claim();
|
|
253
|
+
for (let part; (part = this.#source?.readBody(this));)
|
|
254
|
+
yield part;
|
|
255
|
+
}
|
|
256
|
+
#claim() {
|
|
257
|
+
if (this.#used)
|
|
258
|
+
throw usedError();
|
|
259
|
+
this.#used = true;
|
|
260
|
+
}
|
|
261
|
+
#read() {
|
|
262
|
+
this.#claim();
|
|
263
|
+
const parts = [];
|
|
264
|
+
for (let part; (part = this.#source?.readBody(this));)
|
|
265
|
+
parts.push(part);
|
|
266
|
+
return parts;
|
|
267
|
+
}
|
|
268
|
+
/** The body in a new `Uint8Array`. */
|
|
269
|
+
bytes() {
|
|
270
|
+
return concat(this.#read());
|
|
271
|
+
}
|
|
272
|
+
/** The body in a new `ArrayBuffer`. */
|
|
273
|
+
arrayBuffer() {
|
|
274
|
+
return this.bytes().buffer;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* The body, decoded as UTF-8. A byte order mark at the start is not
|
|
278
|
+
* in the text.
|
|
279
|
+
*/
|
|
280
|
+
text() {
|
|
281
|
+
return decode(this.#read());
|
|
130
282
|
}
|
|
131
283
|
}
|
|
132
284
|
//# 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,99 @@
|
|
|
1
|
+
import { countOption } from './options.js';
|
|
2
|
+
const MAX_READ = 16 * 1024 * 1024;
|
|
3
|
+
// The size of the first read, and of the read after a skip.
|
|
4
|
+
const FIRST_READ = 64 * 1024;
|
|
5
|
+
// A skip of fewer bytes than this is slower than a read of them.
|
|
6
|
+
const MIN_SKIP = 1024 * 1024;
|
|
7
|
+
/**
|
|
8
|
+
* The key of the method of a chunk source that skips input. A
|
|
9
|
+
* `TarReader` calls it with the number of bytes of a body that are
|
|
10
|
+
* after the chunks given so far, when no consumer reads that body.
|
|
11
|
+
* If it returns true, the next chunk starts after those bytes.
|
|
12
|
+
*/
|
|
13
|
+
export const SKIP = Symbol.for('tar.readFile.skip');
|
|
14
|
+
// The place and the size of the next read of a file.
|
|
15
|
+
class Plan {
|
|
16
|
+
pos = 0;
|
|
17
|
+
/** The size of the file. 0 before the file is open. */
|
|
18
|
+
size = 0;
|
|
19
|
+
#max;
|
|
20
|
+
#want = FIRST_READ;
|
|
21
|
+
constructor(maxReadSize) {
|
|
22
|
+
this.#max = countOption('maxReadSize', maxReadSize, MAX_READ);
|
|
23
|
+
}
|
|
24
|
+
// The number of bytes to read at `pos`. 0 at the end of the file.
|
|
25
|
+
// Each read is two times the size of the read before it, so that
|
|
26
|
+
// an archive of small entries is read in few reads.
|
|
27
|
+
next() {
|
|
28
|
+
const n = Math.min(this.#want, this.#max, this.size - this.pos);
|
|
29
|
+
this.#want *= 2;
|
|
30
|
+
return n;
|
|
31
|
+
}
|
|
32
|
+
// Skip only inside the file: the parser must see where a truncated
|
|
33
|
+
// file ends. The read after a skip is small, because a header
|
|
34
|
+
// comes next, and the body after it can be skipped also.
|
|
35
|
+
skip(n) {
|
|
36
|
+
if (n < MIN_SKIP || this.pos + n > this.size)
|
|
37
|
+
return false;
|
|
38
|
+
this.pos += n;
|
|
39
|
+
this.#want = FIRST_READ;
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function* chunks(fs, file, plan) {
|
|
44
|
+
const handle = await fs.open(file, 'r');
|
|
45
|
+
try {
|
|
46
|
+
plan.size = (await handle.stat()).size;
|
|
47
|
+
for (let n; (n = plan.next());) {
|
|
48
|
+
const buf = new Uint8Array(n);
|
|
49
|
+
const { bytesRead } = await handle.read(buf, 0, n, plan.pos);
|
|
50
|
+
if (!bytesRead)
|
|
51
|
+
break;
|
|
52
|
+
plan.pos += bytesRead;
|
|
53
|
+
yield bytesRead < n ? buf.subarray(0, bytesRead) : buf;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
await handle.close().catch(() => { });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function* chunksSync(fs, file, plan) {
|
|
61
|
+
const fd = fs.openSync(file, 'r');
|
|
62
|
+
try {
|
|
63
|
+
plan.size = fs.fstatSync(fd).size;
|
|
64
|
+
for (let n; (n = plan.next());) {
|
|
65
|
+
const buf = new Uint8Array(n);
|
|
66
|
+
const bytesRead = fs.readSync(fd, buf, 0, n, plan.pos);
|
|
67
|
+
if (!bytesRead)
|
|
68
|
+
break;
|
|
69
|
+
plan.pos += bytesRead;
|
|
70
|
+
yield bytesRead < n ? buf.subarray(0, bytesRead) : buf;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
try {
|
|
75
|
+
fs.closeSync(fd);
|
|
76
|
+
}
|
|
77
|
+
catch { }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Read a file in chunks of `maxReadSize` bytes at most. The default,
|
|
82
|
+
* and the value for 0, is 16 MiB. Each chunk is a new array. The
|
|
83
|
+
* first chunk is small, and the chunks grow. A reader can skip a
|
|
84
|
+
* large part of the file.
|
|
85
|
+
*/
|
|
86
|
+
export const readFile = (fs, file, maxReadSize) => {
|
|
87
|
+
const plan = new Plan(maxReadSize);
|
|
88
|
+
return Object.assign(chunks(fs, file, plan), {
|
|
89
|
+
[SKIP]: (n) => plan.skip(n),
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
/** The sync form of `readFile`. */
|
|
93
|
+
export const readFileSync = (fs, file, maxReadSize) => {
|
|
94
|
+
const plan = new Plan(maxReadSize);
|
|
95
|
+
return Object.assign(chunksSync(fs, file, plan), {
|
|
96
|
+
[SKIP]: (n) => plan.skip(n),
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=read-file.js.map
|
|
@@ -1,2 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
import { type Codec } from './codec.js';
|
|
2
|
+
import { type WithAliases } from './dealias.js';
|
|
3
|
+
import type { ReplaceOptions, ReplaceOptionsSync } from './options.js';
|
|
4
|
+
import type { PackInput, PackInputSync } from './pack.js';
|
|
5
|
+
/**
|
|
6
|
+
* Finds the place in an archive file where new entries go: the end
|
|
7
|
+
* of the last complete entry before the first block that is not a
|
|
8
|
+
* valid header. A PAX or GNU header with no entry after it is not a
|
|
9
|
+
* complete entry.
|
|
10
|
+
*
|
|
11
|
+
* Read the file into `buf` at `pos`, and call `push()`, until it
|
|
12
|
+
* returns false. The bodies of the entries are not read.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AppendScan {
|
|
15
|
+
#private;
|
|
16
|
+
buf: Uint8Array;
|
|
17
|
+
/** The place in the file of the next read. */
|
|
18
|
+
pos: number;
|
|
19
|
+
/**
|
|
20
|
+
* @param size the size of the file
|
|
21
|
+
* @param mtimes gets the path and the `mtime` of each complete entry
|
|
22
|
+
*/
|
|
23
|
+
constructor(size: number, codecs?: Codec[], mtimes?: Map<string, Date>);
|
|
24
|
+
/** The place in the file where new entries go. */
|
|
25
|
+
get position(): number;
|
|
26
|
+
/** The number of bytes to read into `buf` at `pos`. */
|
|
27
|
+
get want(): number;
|
|
28
|
+
/**
|
|
29
|
+
* Parse the first `length` bytes of `buf`. False if the place is
|
|
30
|
+
* found. Throws if the file is compressed.
|
|
31
|
+
*/
|
|
32
|
+
push(length: number): boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Add the files to the end of an archive file that is not
|
|
36
|
+
* compressed. The files are the same as for `create`. If the archive
|
|
37
|
+
* does not exist, it is made.
|
|
38
|
+
*
|
|
39
|
+
* The new entries go after the last complete entry of the archive.
|
|
40
|
+
* A reader of the archive gets the old entry and then the new entry
|
|
41
|
+
* of a path that is in it two times.
|
|
42
|
+
*/
|
|
43
|
+
export declare const replace: (options: WithAliases<ReplaceOptions>, files: PackInput[]) => Promise<void>;
|
|
44
|
+
/** The sync form of `replace`. */
|
|
45
|
+
export declare const replaceSync: (options: WithAliases<ReplaceOptionsSync>, files: PackInputSync[]) => void;
|
|
2
46
|
//# sourceMappingURL=replace.d.ts.map
|