@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The flag values of `fs.constants` that the extraction uses. */
|
|
2
|
+
export type OpenConstants = {
|
|
3
|
+
O_CREAT: number;
|
|
4
|
+
O_TRUNC: number;
|
|
5
|
+
O_WRONLY: number;
|
|
6
|
+
O_NOFOLLOW?: number;
|
|
7
|
+
UV_FS_O_FILEMAP?: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Make the function that gives the `open` flag for a new file of a
|
|
11
|
+
* given size.
|
|
12
|
+
*
|
|
13
|
+
* With `O_NOFOLLOW`, `open` fails if the path is a symbolic link.
|
|
14
|
+
* Windows does not have it. If `constants` is not set, the flag is
|
|
15
|
+
* `'w'`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const writeFlags: (constants: OpenConstants | undefined, win32: boolean) => ((size: number) => string | number);
|
|
18
|
+
//# sourceMappingURL=write-flag.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeFlags = void 0;
|
|
4
|
+
// Windows writes a small file faster through a file mapping.
|
|
5
|
+
const FMAP_LIMIT = 512 * 1024;
|
|
6
|
+
/**
|
|
7
|
+
* Make the function that gives the `open` flag for a new file of a
|
|
8
|
+
* given size.
|
|
9
|
+
*
|
|
10
|
+
* With `O_NOFOLLOW`, `open` fails if the path is a symbolic link.
|
|
11
|
+
* Windows does not have it. If `constants` is not set, the flag is
|
|
12
|
+
* `'w'`.
|
|
13
|
+
*/
|
|
14
|
+
const writeFlags = (constants, win32) => {
|
|
15
|
+
if (!constants)
|
|
16
|
+
return () => 'w';
|
|
17
|
+
const { O_CREAT, O_TRUNC, O_WRONLY, O_NOFOLLOW, UV_FS_O_FILEMAP } = constants;
|
|
18
|
+
const write = O_TRUNC | O_CREAT | O_WRONLY;
|
|
19
|
+
if (!win32) {
|
|
20
|
+
const flag = typeof O_NOFOLLOW === 'number' ? O_NOFOLLOW | write : 'w';
|
|
21
|
+
return () => flag;
|
|
22
|
+
}
|
|
23
|
+
if (!UV_FS_O_FILEMAP)
|
|
24
|
+
return () => 'w';
|
|
25
|
+
const fmap = UV_FS_O_FILEMAP | write;
|
|
26
|
+
return size => (size < FMAP_LIMIT ? fmap : 'w');
|
|
27
|
+
};
|
|
28
|
+
exports.writeFlags = writeFlags;
|
|
29
|
+
//# sourceMappingURL=write-flag.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** True for a `Uint8Array`, and for a subclass such as `Buffer`. */
|
|
2
|
+
export declare const isUint8Array: (x: unknown) => x is Uint8Array;
|
|
3
|
+
/** True for an `ArrayBuffer`. */
|
|
4
|
+
export declare const isArrayBuffer: (x: unknown) => x is ArrayBuffer;
|
|
5
|
+
/** True for an object that has the size and the stream of a `Blob`. */
|
|
6
|
+
export declare const isBlob: (x: unknown) => x is Blob;
|
|
7
|
+
/** True for an object that has the reader of a `ReadableStream`. */
|
|
8
|
+
export declare const isReadableStream: (x: unknown) => x is ReadableStream<Uint8Array>;
|
|
9
|
+
/** The number of bytes in the UTF-8 form of the string. */
|
|
10
|
+
export declare const utf8Length: (str: string) => number;
|
|
11
|
+
/** Decode the bytes from `start` to `end` as UTF-8. */
|
|
12
|
+
export declare const decodeUtf8: (buf: Uint8Array, start?: number, end?: number) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Write the string as UTF-8 into `size` bytes at `off`. Fill the bytes
|
|
15
|
+
* that are left with zeros. A character that does not fit completely
|
|
16
|
+
* is not written.
|
|
17
|
+
*/
|
|
18
|
+
export declare const encodeUtf8Into: (str: string, buf: Uint8Array, off: number, size: number) => void;
|
|
19
|
+
/** Write a string of ASCII characters at `off`. */
|
|
20
|
+
export declare const writeAscii: (str: string, buf: Uint8Array, off: number) => void;
|
|
21
|
+
//# sourceMappingURL=bytes.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Text and byte helpers that work on a plain Uint8Array in any
|
|
2
|
+
// JavaScript runtime, and type checks for the input of a caller.
|
|
3
|
+
//
|
|
4
|
+
// A check with `instanceof` is false for an object that a different
|
|
5
|
+
// realm made, such as a Node.js `Buffer` in a `node:vm` context, or a
|
|
6
|
+
// `Blob` of a different window. These checks are true for an object
|
|
7
|
+
// of each realm.
|
|
8
|
+
/** True for a `Uint8Array`, and for a subclass such as `Buffer`. */
|
|
9
|
+
export const isUint8Array = (x) => ArrayBuffer.isView(x) &&
|
|
10
|
+
x[Symbol.toStringTag] === 'Uint8Array';
|
|
11
|
+
/** True for an `ArrayBuffer`. */
|
|
12
|
+
export const isArrayBuffer = (x) => Object.prototype.toString.call(x) === '[object ArrayBuffer]';
|
|
13
|
+
/** True for an object that has the size and the stream of a `Blob`. */
|
|
14
|
+
export const isBlob = (x) => typeof x?.size === 'number' &&
|
|
15
|
+
typeof x.stream === 'function';
|
|
16
|
+
/** True for an object that has the reader of a `ReadableStream`. */
|
|
17
|
+
export const isReadableStream = (x) => typeof x?.getReader === 'function';
|
|
18
|
+
// A name can start with U+FEFF. The decoder must keep it.
|
|
19
|
+
const decoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
20
|
+
const encoder = new TextEncoder();
|
|
21
|
+
/** The number of bytes in the UTF-8 form of the string. */
|
|
22
|
+
export const utf8Length = (str) => {
|
|
23
|
+
let len = str.length;
|
|
24
|
+
for (let i = 0; i < str.length; i++) {
|
|
25
|
+
const c = str.charCodeAt(i);
|
|
26
|
+
if (c < 0x80)
|
|
27
|
+
continue;
|
|
28
|
+
if (c < 0x800) {
|
|
29
|
+
len += 1;
|
|
30
|
+
}
|
|
31
|
+
else if (c >= 0xd800 &&
|
|
32
|
+
c <= 0xdbff &&
|
|
33
|
+
(str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
|
|
34
|
+
// A surrogate pair is 2 code units, and 4 bytes.
|
|
35
|
+
len += 2;
|
|
36
|
+
i++;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
len += 2;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return len;
|
|
43
|
+
};
|
|
44
|
+
/** Decode the bytes from `start` to `end` as UTF-8. */
|
|
45
|
+
export const decodeUtf8 = (buf, start = 0, end = buf.length) => {
|
|
46
|
+
// Most names in an archive are short ASCII. That case needs no
|
|
47
|
+
// decoder call.
|
|
48
|
+
let str = '';
|
|
49
|
+
for (let i = start; i < end; i++) {
|
|
50
|
+
const c = buf[i];
|
|
51
|
+
if (c >= 0x80)
|
|
52
|
+
return decoder.decode(buf.subarray(start, end));
|
|
53
|
+
str += String.fromCharCode(c);
|
|
54
|
+
}
|
|
55
|
+
return str;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Write the string as UTF-8 into `size` bytes at `off`. Fill the bytes
|
|
59
|
+
* that are left with zeros. A character that does not fit completely
|
|
60
|
+
* is not written.
|
|
61
|
+
*/
|
|
62
|
+
export const encodeUtf8Into = (str, buf, off, size) => {
|
|
63
|
+
const { written } = encoder.encodeInto(str, buf.subarray(off, off + size));
|
|
64
|
+
buf.fill(0, off + written, off + size);
|
|
65
|
+
};
|
|
66
|
+
/** Write a string of ASCII characters at `off`. */
|
|
67
|
+
export const writeAscii = (str, buf, off) => {
|
|
68
|
+
for (let i = 0; i < str.length; i++) {
|
|
69
|
+
buf[off + i] = str.charCodeAt(i);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=bytes.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** The two ends of a stream that changes data, as a `TransformStream`. */
|
|
2
|
+
export type CodecStream = {
|
|
3
|
+
readable: ReadableStream<Uint8Array>;
|
|
4
|
+
writable: WritableStream<Uint8Array>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* One compression format. Pass codecs in the `codecs` option to add
|
|
8
|
+
* a format, or to replace the gzip support of the runtime.
|
|
9
|
+
*
|
|
10
|
+
* The readers use the first codec for which `detect` returns true.
|
|
11
|
+
* If there is none, and the archive has a file name, and the input
|
|
12
|
+
* does not start with a tar header, they use the first codec that
|
|
13
|
+
* has an ending of the file name in `extensions`.
|
|
14
|
+
*
|
|
15
|
+
* The readers enforce `maxDecompressionRatio` for each codec.
|
|
16
|
+
*/
|
|
17
|
+
export type Codec = {
|
|
18
|
+
name: string;
|
|
19
|
+
/** The number of bytes that `detect` needs. */
|
|
20
|
+
headLength: number;
|
|
21
|
+
/**
|
|
22
|
+
* True if the input is in this format. `head` is the start of the
|
|
23
|
+
* input: `headLength` bytes or more, or all of a shorter input.
|
|
24
|
+
*/
|
|
25
|
+
detect(head: Uint8Array): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* File name endings, such as `.tar.br`, for a format that `detect`
|
|
28
|
+
* cannot identify.
|
|
29
|
+
*/
|
|
30
|
+
extensions?: string[];
|
|
31
|
+
/** Make a stream that decompresses. */
|
|
32
|
+
decompress(): CodecStream;
|
|
33
|
+
/** Make a stream that compresses. */
|
|
34
|
+
compress?(options?: Record<string, unknown>): CodecStream;
|
|
35
|
+
/**
|
|
36
|
+
* Decompress all of `data`. The sync readers need it. It must throw
|
|
37
|
+
* before it makes more than `limit.maxOutputLength` bytes. That
|
|
38
|
+
* number is `Infinity` when the caller sets no ratio limit.
|
|
39
|
+
*/
|
|
40
|
+
decompressSync?(data: Uint8Array, limit: {
|
|
41
|
+
maxOutputLength: number;
|
|
42
|
+
}): Uint8Array;
|
|
43
|
+
/** Compress all of `data`. */
|
|
44
|
+
compressSync?(data: Uint8Array, options?: Record<string, unknown>): Uint8Array;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Gzip with the `DecompressionStream` and `CompressionStream` of the
|
|
48
|
+
* runtime. The async readers always have it, after `opt.codecs`.
|
|
49
|
+
* The option `portable` of `compress` makes output that does not
|
|
50
|
+
* name the system.
|
|
51
|
+
*/
|
|
52
|
+
export declare const gzip: Codec;
|
|
53
|
+
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gzip with the `DecompressionStream` and `CompressionStream` of the
|
|
3
|
+
* runtime. The async readers always have it, after `opt.codecs`.
|
|
4
|
+
* The option `portable` of `compress` makes output that does not
|
|
5
|
+
* name the system.
|
|
6
|
+
*/
|
|
7
|
+
export const gzip = {
|
|
8
|
+
name: 'gzip',
|
|
9
|
+
headLength: 2,
|
|
10
|
+
detect: head => head[0] === 0x1f && head[1] === 0x8b,
|
|
11
|
+
decompress: () => new DecompressionStream('gzip'),
|
|
12
|
+
compress: options => {
|
|
13
|
+
const stream = new CompressionStream('gzip');
|
|
14
|
+
if (!options?.portable)
|
|
15
|
+
return stream;
|
|
16
|
+
// Byte 9 of a gzip stream names the system that made it. Set it
|
|
17
|
+
// to 255, "unknown", so that each system makes the same bytes.
|
|
18
|
+
let pos = 0;
|
|
19
|
+
return {
|
|
20
|
+
writable: stream.writable,
|
|
21
|
+
readable: stream.readable.pipeThrough(new TransformStream({
|
|
22
|
+
transform: (chunk, controller) => {
|
|
23
|
+
if (pos <= 9 && pos + chunk.length > 9)
|
|
24
|
+
chunk[9 - pos] = 255;
|
|
25
|
+
pos += chunk.length;
|
|
26
|
+
controller.enqueue(chunk);
|
|
27
|
+
},
|
|
28
|
+
})),
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=codec.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Copy the parts into one new array. */
|
|
2
|
+
export const concat = (parts) => {
|
|
3
|
+
if (parts.length === 1)
|
|
4
|
+
return parts[0].slice();
|
|
5
|
+
let length = 0;
|
|
6
|
+
for (const part of parts)
|
|
7
|
+
length += part.length;
|
|
8
|
+
const out = new Uint8Array(length);
|
|
9
|
+
let pos = 0;
|
|
10
|
+
for (const part of parts) {
|
|
11
|
+
out.set(part, pos);
|
|
12
|
+
pos += part.length;
|
|
13
|
+
}
|
|
14
|
+
return out;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=concat.js.map
|
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { type FileOption, type NoFileOption, type WithAliases } from './dealias.js';
|
|
2
|
+
import type { CreateFileHandle, CreateFSSync } from './fs.js';
|
|
3
|
+
import type { CreateOptions, CreateOptionsSync } from './options.js';
|
|
4
|
+
import { Pack, PackSync, type PackInput, type PackInputSync } from './pack.js';
|
|
5
|
+
/**
|
|
6
|
+
* Write the chunks to the file, from `position`. Chunks that are
|
|
7
|
+
* smaller than 64 KiB are put together for one write.
|
|
8
|
+
*/
|
|
9
|
+
export declare const writeChunks: (handle: CreateFileHandle, chunks: AsyncIterable<Uint8Array>, position: number) => Promise<void>;
|
|
10
|
+
/** The sync form of `writeChunks`. */
|
|
11
|
+
export declare const writeChunksSync: (fs: CreateFSSync, fd: number, chunks: Iterable<Uint8Array>, position: number) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Make the pack for the files of a command. A name that starts with
|
|
14
|
+
* `@` is the path of an archive: the pack gets its entries.
|
|
15
|
+
*/
|
|
16
|
+
export declare const packFiles: (opt: CreateOptions, files: PackInput[]) => Pack;
|
|
17
|
+
/** The sync form of `packFiles`. */
|
|
18
|
+
export declare const packFilesSync: (opt: CreateOptionsSync, files: PackInputSync[]) => PackSync;
|
|
19
|
+
/**
|
|
20
|
+
* Make an archive of the files. A directory is added with all that
|
|
21
|
+
* is in it. A name that starts with `@` is the path of an archive:
|
|
22
|
+
* its entries are added. A file can also be an entry, or a source of
|
|
23
|
+
* entries, as in `Pack.add()`.
|
|
24
|
+
*
|
|
25
|
+
* With `opt.file`, the archive is written to that path through
|
|
26
|
+
* `opt.fs`. With no `opt.file`, the result is a stream of the bytes
|
|
27
|
+
* of the archive. Files are read only when the stream is read.
|
|
28
|
+
*/
|
|
29
|
+
export declare function create(opt: WithAliases<CreateOptions> & FileOption, files: PackInput[]): Promise<void>;
|
|
30
|
+
export declare function create(opt: WithAliases<CreateOptions> & NoFileOption, files: PackInput[]): ReadableStream<Uint8Array>;
|
|
31
|
+
export declare function create(opt: WithAliases<CreateOptions>, files: PackInput[]): Promise<void> | ReadableStream<Uint8Array>;
|
|
32
|
+
/**
|
|
33
|
+
* The sync form of `create`. With no `opt.file`, the result is an
|
|
34
|
+
* iterator of the bytes of the archive. Files are read only when the
|
|
35
|
+
* iterator is read.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createSync(opt: WithAliases<CreateOptionsSync> & FileOption, files: PackInputSync[]): void;
|
|
38
|
+
export declare function createSync(opt: WithAliases<CreateOptionsSync> & NoFileOption, files: PackInputSync[]): IterableIterator<Uint8Array, undefined>;
|
|
39
|
+
export declare function createSync(opt: WithAliases<CreateOptionsSync>, files: PackInputSync[]): void | IterableIterator<Uint8Array, undefined>;
|
|
3
40
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1,76 +1,159 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { dealias, } from './dealias.js';
|
|
2
|
+
import { TarReader, TarReaderSync } from './entries.js';
|
|
3
|
+
import { Pack, PackSync, } from './pack.js';
|
|
4
|
+
import { readFile, readFileSync } from './read-file.js';
|
|
5
|
+
import { toStream } from './to-stream.js';
|
|
6
|
+
// Chunks that are smaller than this are put together for one write.
|
|
7
|
+
const SMALL = 64 * 1024;
|
|
8
|
+
const BATCH = 4 * SMALL;
|
|
9
|
+
const noop = () => { };
|
|
10
|
+
const check = (opt, files) => {
|
|
11
|
+
if (!files?.length) {
|
|
12
|
+
throw new TypeError('no paths specified to add to archive');
|
|
13
|
+
}
|
|
14
|
+
if (opt.file && !opt.fs) {
|
|
15
|
+
throw new TypeError('the file option needs the fs option');
|
|
16
|
+
}
|
|
13
17
|
};
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
p.pipe(stream);
|
|
20
|
-
const promise = new Promise((res, rej) => {
|
|
21
|
-
stream.on('error', rej);
|
|
22
|
-
stream.on('close', res);
|
|
23
|
-
p.on('error', rej);
|
|
24
|
-
});
|
|
25
|
-
addFilesAsync(p, files).catch(er => p.emit('error', er));
|
|
26
|
-
return promise;
|
|
18
|
+
const writeAll = async (handle, buf, length, position) => {
|
|
19
|
+
for (let off = 0; off < length;) {
|
|
20
|
+
off += (await handle.write(buf, off, length - off, position + off))
|
|
21
|
+
.bytesWritten;
|
|
22
|
+
}
|
|
27
23
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Write the chunks to the file, from `position`. Chunks that are
|
|
26
|
+
* smaller than 64 KiB are put together for one write.
|
|
27
|
+
*/
|
|
28
|
+
export const writeChunks = async (handle, chunks, position) => {
|
|
29
|
+
const batch = new Uint8Array(BATCH);
|
|
30
|
+
let used = 0;
|
|
31
|
+
const flush = async () => {
|
|
32
|
+
await writeAll(handle, batch, used, position);
|
|
33
|
+
position += used;
|
|
34
|
+
used = 0;
|
|
35
|
+
};
|
|
36
|
+
for await (const chunk of chunks) {
|
|
37
|
+
if (used + chunk.length > BATCH || chunk.length >= SMALL)
|
|
38
|
+
await flush();
|
|
39
|
+
if (chunk.length >= SMALL) {
|
|
40
|
+
await writeAll(handle, chunk, chunk.length, position);
|
|
41
|
+
position += chunk.length;
|
|
37
42
|
}
|
|
38
43
|
else {
|
|
39
|
-
|
|
44
|
+
batch.set(chunk, used);
|
|
45
|
+
used += chunk.length;
|
|
40
46
|
}
|
|
41
|
-
}
|
|
42
|
-
|
|
47
|
+
}
|
|
48
|
+
await flush();
|
|
43
49
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
p.add(entry);
|
|
52
|
-
},
|
|
53
|
-
});
|
|
50
|
+
/** The sync form of `writeChunks`. */
|
|
51
|
+
export const writeChunksSync = (fs, fd, chunks, position) => {
|
|
52
|
+
const batch = new Uint8Array(BATCH);
|
|
53
|
+
let used = 0;
|
|
54
|
+
const write = (buf, length) => {
|
|
55
|
+
for (let off = 0; off < length;) {
|
|
56
|
+
off += fs.writeSync(fd, buf, off, length - off, position + off);
|
|
54
57
|
}
|
|
58
|
+
position += length;
|
|
59
|
+
};
|
|
60
|
+
for (const chunk of chunks) {
|
|
61
|
+
if (used + chunk.length > BATCH || chunk.length >= SMALL) {
|
|
62
|
+
write(batch, used);
|
|
63
|
+
used = 0;
|
|
64
|
+
}
|
|
65
|
+
if (chunk.length >= SMALL)
|
|
66
|
+
write(chunk, chunk.length);
|
|
55
67
|
else {
|
|
56
|
-
|
|
68
|
+
batch.set(chunk, used);
|
|
69
|
+
used += chunk.length;
|
|
57
70
|
}
|
|
58
71
|
}
|
|
59
|
-
|
|
72
|
+
write(batch, used);
|
|
60
73
|
};
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
const createFile = async (pack, fs, file, mode) => {
|
|
75
|
+
const handle = await fs.open(file, 'w', mode);
|
|
76
|
+
let ok = false;
|
|
77
|
+
try {
|
|
78
|
+
await writeChunks(handle, pack, 0);
|
|
79
|
+
ok = true;
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
const closed = handle.close();
|
|
83
|
+
await (ok ? closed : closed.catch(noop));
|
|
84
|
+
}
|
|
65
85
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Make the pack for the files of a command. A name that starts with
|
|
88
|
+
* `@` is the path of an archive: the pack gets its entries.
|
|
89
|
+
*/
|
|
90
|
+
export const packFiles = (opt, files) => {
|
|
91
|
+
const { fs, strict, onwarn, codecs, platform } = opt;
|
|
92
|
+
const pack = new Pack(opt);
|
|
93
|
+
for (const item of files) {
|
|
94
|
+
if (typeof item !== 'string' || item.charAt(0) !== '@')
|
|
95
|
+
pack.add(item);
|
|
96
|
+
else {
|
|
97
|
+
const archive = pack.resolve(item.slice(1));
|
|
98
|
+
pack.add(new TarReader(readFile(fs, archive, opt.maxReadSize), {
|
|
99
|
+
strict,
|
|
100
|
+
onwarn,
|
|
101
|
+
codecs,
|
|
102
|
+
platform,
|
|
103
|
+
file: archive,
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return pack.end();
|
|
70
108
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
109
|
+
/** The sync form of `packFiles`. */
|
|
110
|
+
export const packFilesSync = (opt, files) => {
|
|
111
|
+
const { strict, onwarn, codecs, platform } = opt;
|
|
112
|
+
const pack = new PackSync(opt);
|
|
113
|
+
for (const item of files) {
|
|
114
|
+
if (typeof item !== 'string' || item.charAt(0) !== '@')
|
|
115
|
+
pack.add(item);
|
|
116
|
+
else {
|
|
117
|
+
const archive = pack.resolve(item.slice(1));
|
|
118
|
+
pack.add(new TarReaderSync(readFileSync(opt.fs, archive, opt.maxReadSize), { strict, onwarn, codecs, platform, file: archive }));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return pack;
|
|
122
|
+
};
|
|
123
|
+
export function create(options, files) {
|
|
124
|
+
const opt = dealias(options);
|
|
125
|
+
if (!opt.file) {
|
|
126
|
+
check(opt, files);
|
|
127
|
+
return toStream(packFiles(opt, files));
|
|
128
|
+
}
|
|
129
|
+
// The file form returns a promise, so a bad argument rejects it.
|
|
130
|
+
try {
|
|
131
|
+
check(opt, files);
|
|
132
|
+
return createFile(packFiles(opt, files), opt.fs, opt.file, opt.mode || 0o666);
|
|
133
|
+
}
|
|
134
|
+
catch (er) {
|
|
135
|
+
return Promise.reject(er);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export function createSync(options, files) {
|
|
139
|
+
const opt = dealias(options);
|
|
140
|
+
check(opt, files);
|
|
141
|
+
const { file } = opt;
|
|
142
|
+
const fs = opt.fs;
|
|
143
|
+
const pack = packFilesSync(opt, files);
|
|
144
|
+
if (!file)
|
|
145
|
+
return pack;
|
|
146
|
+
const fd = fs.openSync(file, 'w', opt.mode || 0o666);
|
|
147
|
+
try {
|
|
148
|
+
writeChunksSync(fs, fd, pack, 0);
|
|
149
|
+
}
|
|
150
|
+
catch (er) {
|
|
151
|
+
try {
|
|
152
|
+
fs.closeSync(fd);
|
|
153
|
+
}
|
|
154
|
+
catch { }
|
|
155
|
+
throw er;
|
|
74
156
|
}
|
|
75
|
-
|
|
157
|
+
fs.closeSync(fd);
|
|
158
|
+
}
|
|
76
159
|
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The option aliases of the commands: the short names of the tar
|
|
3
|
+
* program, and the long names of version 7. Each alias has the name
|
|
4
|
+
* of its option.
|
|
5
|
+
*/
|
|
6
|
+
export declare const aliases: {
|
|
7
|
+
readonly C: "cwd";
|
|
8
|
+
readonly f: "file";
|
|
9
|
+
readonly z: "gzip";
|
|
10
|
+
readonly P: "preservePaths";
|
|
11
|
+
readonly U: "unlink";
|
|
12
|
+
readonly 'strip-components': "strip";
|
|
13
|
+
readonly stripComponents: "strip";
|
|
14
|
+
readonly 'keep-newer': "newer";
|
|
15
|
+
readonly keepNewer: "newer";
|
|
16
|
+
readonly 'keep-newer-files': "newer";
|
|
17
|
+
readonly keepNewerFiles: "newer";
|
|
18
|
+
readonly k: "keep";
|
|
19
|
+
readonly 'keep-existing': "keep";
|
|
20
|
+
readonly keepExisting: "keep";
|
|
21
|
+
readonly m: "noMtime";
|
|
22
|
+
readonly 'no-mtime': "noMtime";
|
|
23
|
+
readonly p: "preserveOwner";
|
|
24
|
+
readonly L: "follow";
|
|
25
|
+
readonly h: "follow";
|
|
26
|
+
readonly onentry: "onEntry";
|
|
27
|
+
readonly onReadEntry: "onEntry";
|
|
28
|
+
};
|
|
29
|
+
/** The alias names, and the name of the option of each one. */
|
|
30
|
+
export type Aliases = typeof aliases;
|
|
31
|
+
/** The names of the options that have an alias. */
|
|
32
|
+
export type Aliased = Aliases[keyof Aliases];
|
|
33
|
+
/** The alias names of the option `K`. */
|
|
34
|
+
export type AliasOf<K> = {
|
|
35
|
+
[A in keyof Aliases]: Aliases[A] extends K ? A : never;
|
|
36
|
+
}[keyof Aliases];
|
|
37
|
+
/**
|
|
38
|
+
* For each option `K` of `T`, an object type that requires the option
|
|
39
|
+
* or one of its aliases.
|
|
40
|
+
*/
|
|
41
|
+
export type RequiredOption<T, K extends keyof T> = [
|
|
42
|
+
K
|
|
43
|
+
] extends [never] ? unknown : (K extends unknown ? (x: {
|
|
44
|
+
v: {
|
|
45
|
+
[N in K | AliasOf<K>]: {
|
|
46
|
+
[P in N]: T[K];
|
|
47
|
+
};
|
|
48
|
+
}[K | AliasOf<K>];
|
|
49
|
+
}) => void : never) extends (x: infer I extends {
|
|
50
|
+
v: unknown;
|
|
51
|
+
}) => void ? I['v'] : never;
|
|
52
|
+
/**
|
|
53
|
+
* The option type `T` of a command, and the aliases of its options.
|
|
54
|
+
* An alias has the type of its option. An option that `T` requires
|
|
55
|
+
* can be given with its name or with an alias.
|
|
56
|
+
*/
|
|
57
|
+
export type WithAliases<T> = T extends unknown ? Omit<T, Aliased> & Partial<Pick<T, keyof T & Aliased>> & {
|
|
58
|
+
[A in keyof Aliases as Aliases[A] extends keyof T ? A : never]?: T[Aliases[A] & keyof T];
|
|
59
|
+
} & ('chmod' extends keyof T ? {
|
|
60
|
+
/** `noChmod: false` is `chmod: true`, if `chmod` is not set. */
|
|
61
|
+
noChmod?: boolean;
|
|
62
|
+
} : unknown) & RequiredOption<T, {
|
|
63
|
+
[K in keyof T]-?: object extends Pick<T, K> ? never : K;
|
|
64
|
+
}[keyof T] & Aliased> : never;
|
|
65
|
+
/** The `file` option, with its name or with its alias. */
|
|
66
|
+
export type FileOption = RequiredOption<{
|
|
67
|
+
file: string;
|
|
68
|
+
}, 'file'>;
|
|
69
|
+
/** No `file` option. */
|
|
70
|
+
export type NoFileOption = {
|
|
71
|
+
[N in 'file' | AliasOf<'file'>]?: undefined;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* A copy of the options, with no prototype, that has the name of the
|
|
75
|
+
* option in place of each alias. An option that is set wins over its
|
|
76
|
+
* aliases.
|
|
77
|
+
*/
|
|
78
|
+
export declare const dealias: <T extends object>(options: WithAliases<T>) => T;
|
|
79
|
+
//# sourceMappingURL=dealias.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The option aliases of the commands: the short names of the tar
|
|
3
|
+
* program, and the long names of version 7. Each alias has the name
|
|
4
|
+
* of its option.
|
|
5
|
+
*/
|
|
6
|
+
export const aliases = {
|
|
7
|
+
C: 'cwd',
|
|
8
|
+
f: 'file',
|
|
9
|
+
z: 'gzip',
|
|
10
|
+
P: 'preservePaths',
|
|
11
|
+
U: 'unlink',
|
|
12
|
+
'strip-components': 'strip',
|
|
13
|
+
stripComponents: 'strip',
|
|
14
|
+
'keep-newer': 'newer',
|
|
15
|
+
keepNewer: 'newer',
|
|
16
|
+
'keep-newer-files': 'newer',
|
|
17
|
+
keepNewerFiles: 'newer',
|
|
18
|
+
k: 'keep',
|
|
19
|
+
'keep-existing': 'keep',
|
|
20
|
+
keepExisting: 'keep',
|
|
21
|
+
m: 'noMtime',
|
|
22
|
+
'no-mtime': 'noMtime',
|
|
23
|
+
p: 'preserveOwner',
|
|
24
|
+
L: 'follow',
|
|
25
|
+
h: 'follow',
|
|
26
|
+
onentry: 'onEntry',
|
|
27
|
+
onReadEntry: 'onEntry',
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A copy of the options, with no prototype, that has the name of the
|
|
31
|
+
* option in place of each alias. An option that is set wins over its
|
|
32
|
+
* aliases.
|
|
33
|
+
*/
|
|
34
|
+
export const dealias = (options) => {
|
|
35
|
+
const opt = Object.assign(Object.create(null), options);
|
|
36
|
+
for (const [alias, name] of Object.entries(aliases)) {
|
|
37
|
+
if (opt[alias] !== undefined)
|
|
38
|
+
opt[name] ??= opt[alias];
|
|
39
|
+
delete opt[alias];
|
|
40
|
+
}
|
|
41
|
+
if (opt.noChmod === false)
|
|
42
|
+
opt.chmod ??= true;
|
|
43
|
+
delete opt.noChmod;
|
|
44
|
+
return opt;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=dealias.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type WithAliases } from './dealias.js';
|
|
2
|
+
import type { DeleteOptions, DeleteOptionsSync } from './options.js';
|
|
3
|
+
/**
|
|
4
|
+
* Remove entries from an archive file. An entry is removed if
|
|
5
|
+
* `files` lists its path or one of its parent directories. With
|
|
6
|
+
* `opt.filter`, only if the filter also returns true. With no
|
|
7
|
+
* `files`, each entry that the filter accepts is removed. A listed
|
|
8
|
+
* path that no entry matches is a warning.
|
|
9
|
+
*
|
|
10
|
+
* The other entries are written to a new file next to the archive,
|
|
11
|
+
* with the compression and the mode of the archive. The new file
|
|
12
|
+
* then gets the path of the archive. The archive does not change if
|
|
13
|
+
* the command fails.
|
|
14
|
+
*/
|
|
15
|
+
declare const del: (options: WithAliases<DeleteOptions>, files?: string[]) => Promise<void>;
|
|
16
|
+
/** The sync form of `delete`. */
|
|
17
|
+
export declare const deleteSync: (options: WithAliases<DeleteOptionsSync>, files?: string[]) => void;
|
|
18
|
+
export { del as delete };
|
|
19
|
+
//# sourceMappingURL=delete.d.ts.map
|