@unbrained/pm-cli 2026.11.30 → 2026.12.2
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 +10 -10
- package/dist/cli/error-guidance.js +5 -5
- package/dist/cli/extension-command-help.js +6 -6
- package/dist/cli/help-json-payload.js +7 -7
- package/dist/cli/main.js +5 -5
- package/dist/cli/register-list-query.js +10 -10
- package/dist/cli/register-mutation.js +3 -3
- package/dist/cli/runtime/invocation-command-path.js +2 -0
- package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-DCWGM7CY.js → chunk-3HKPVOAN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Z7YL2SUM.js → chunk-3KEMIPKG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TX74QJ4W.js → chunk-4YYFY33T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-47ZS6RPL.js → chunk-7NAO7I75.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IGEFPHV7.js → chunk-7V65VACG.js} +52 -52
- package/dist/cli-bundle/chunks/chunk-A5ZEMOVR.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-5PNOVDVO.js → chunk-AHV3CSQG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KCVSSONY.js → chunk-C6WM6ZN4.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-CBUC4X7Q.js +127 -0
- package/dist/cli-bundle/chunks/{chunk-CCKM5YQM.js → chunk-G6TARHFK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TY55UX6M.js → chunk-GOEQXVOI.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-I4SPJQQI.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-Q4VZSMUL.js → chunk-L2ZSSMYY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NHBG5ET3.js → chunk-MZZ4ZJ5Z.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-NRQCBUYD.js +113 -0
- package/dist/cli-bundle/chunks/{chunk-YVTALIN3.js → chunk-OBPO6V7H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KXTKLDKD.js → chunk-OXC5KBIQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HXQ3OHQR.js → chunk-PCDTWL6V.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AOTI76Q6.js → chunk-Q6K7HWZ7.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-QDV7S2QS.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-NZSXWIX7.js → chunk-ROTEELDL.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-WFYE34TO.js → chunk-SDXCJZKB.js} +23 -23
- package/dist/cli-bundle/chunks/{chunk-2SBTXR6C.js → chunk-SY5C3U32.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FR7ULTM4.js → chunk-TKUG2X24.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FECZV72T.js → chunk-UNBW2LF3.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-V2S4XAX3.js +2 -0
- package/dist/cli-bundle/chunks/chunk-WSEIEDEK.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-ZA5NS3PL.js → chunk-ZL6J6JYT.js} +6 -6
- package/dist/cli-bundle/chunks/{field-option-collisions-2F2Z7R7B.js → field-option-collisions-BBGTV7AD.js} +2 -2
- package/dist/cli-bundle/chunks/item-revision-3LENTXYF.js +2 -0
- package/dist/cli-bundle/chunks/item-transaction-56J5OCHA.js +2 -0
- package/dist/cli-bundle/chunks/{linked-resource-value-list-WXPPYUVQ.js → linked-resource-value-list-ZBIY4H23.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-actor-UK3QNEEB.js → mutation-actor-NHN33ITJ.js} +2 -2
- package/dist/cli-bundle/chunks/{mutation-admission-UTDYPFWP.js → mutation-admission-PGKJTCG6.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-DRA3CWHI.js → register-list-query-7S5QWDTI.js} +11 -11
- package/dist/cli-bundle/chunks/{register-mutation-WO74VLEQ.js → register-mutation-EK6DVIQK.js} +5 -5
- package/dist/cli-bundle/chunks/{register-operations-CRBKH7WN.js → register-operations-6MURXE4V.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-6V6NQB5C.js → register-setup-RW26X3GJ.js} +2 -2
- package/dist/cli-bundle/chunks/{stage-DYEHGASU.js → stage-4ZCF74G4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-RQYVX2T6.js → chunk-2DGKVXFT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2UWKU2BQ.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-A3DORTXS.js → chunk-3COWDIPX.js} +54 -54
- package/dist/cli-bundle/focused-chunks/{chunk-UQJ4PY2Y.js → chunk-4SCFAWAW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-7G7JIXLL.js → chunk-6BKT6XQN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-6IY5CVGJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-7A6SEZEY.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-IJ3T3W4U.js → chunk-BHNBPCHP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LWBZ7UGG.js → chunk-EQCQTYKO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FM5WQ6ZU.js → chunk-HTDYNY4L.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TQQO42C2.js → chunk-J72TRWR5.js} +26 -26
- package/dist/cli-bundle/focused-chunks/{chunk-L357ZAES.js → chunk-JPZGC3W4.js} +5 -5
- package/dist/cli-bundle/focused-chunks/{chunk-62AMZMR4.js → chunk-KNBGHCIP.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-N64AC5G6.js +100 -0
- package/dist/cli-bundle/focused-chunks/{chunk-IIVDBAJM.js → chunk-OG57ESZK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MZNV26XE.js → chunk-P2H3GTJK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QZRYGYTI.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-SQMOF65W.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-T3ILWAEV.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SXC3NVZI.js → chunk-TR22GU7M.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-M57KDG7I.js → chunk-TXTPAFHJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-VK3IE3TS.js +29 -0
- package/dist/cli-bundle/focused-chunks/{chunk-NJTKGBSK.js → chunk-VQIC3UZB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-U35K7FSE.js → chunk-W4JMV7GF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{field-option-collisions-7TG7STO7.js → field-option-collisions-2C6DLUC4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-revision-723XCQPS.js +2 -0
- package/dist/cli-bundle/focused-chunks/{item-transaction-2IC2MLML.js → item-transaction-LQLQLZE7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-actor-LJVF2HVD.js → mutation-actor-DJMZUIZI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-SDWQVVHN.js +2 -0
- package/dist/cli-bundle/focused-chunks/{stage-MWR73LTZ.js → stage-QBZIK3T5.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 +61 -61
- 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 +2 -2
- package/dist/core/extensions/reserved-host-flags.js +1 -1
- package/dist/core/shared/secret-rules.d.ts +86 -12
- package/dist/core/shared/secret-rules.js +7 -5
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +50 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/extension/command-options.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 +15 -0
- package/dist/sdk/lifecycle/expect-hash-admission.js +2 -0
- package/dist/sdk/lifecycle/item-revision.d.ts +4 -1
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/mutation-guard.js +1 -1
- package/dist/sdk/output-contracts.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/query/aggregate.js +1 -1
- package/dist/sdk/query/context.js +1 -1
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/next.js +1 -1
- package/dist/sdk/query/search-contracts.js +1 -1
- package/dist/sdk/read-output/surfaces.js +1 -1
- package/dist/sdk/read-output-budget.d.ts +1 -1
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.js +1 -1
- package/docs/COMMANDS.md +37 -0
- package/docs/MUTATION_INTEGRITY.md +226 -10
- package/docs/SDK.md +16 -6
- package/docs/agent-task-token-baseline.json +1 -1
- 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-3TXEWHQX.js +0 -125
- package/dist/cli-bundle/chunks/chunk-JPJNJHQW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NVYDPNQP.js +0 -2
- package/dist/cli-bundle/chunks/chunk-SJWIPGZW.js +0 -113
- package/dist/cli-bundle/chunks/chunk-USBTXMKS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-VCXQ6A35.js +0 -3
- package/dist/cli-bundle/chunks/chunk-YPMNXG2C.js +0 -2
- package/dist/cli-bundle/chunks/item-revision-UAF6L47R.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-RJECL53Y.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2UUBS4BG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4ER3VMST.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4YBMHMBJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HXM7K6VH.js +0 -100
- package/dist/cli-bundle/focused-chunks/chunk-NGHT2LNG.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-P55AZPFN.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-WAP3DF4B.js +0 -27
- package/dist/cli-bundle/focused-chunks/chunk-XR745UGE.js +0 -4
- package/dist/cli-bundle/focused-chunks/item-revision-J7EUGCHR.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-SLFAUONA.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,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
|
|
@@ -1,227 +1,180 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.replace = void 0;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
try {
|
|
28
|
-
fd = node_fs_1.default.openSync(opt.file, 'r+');
|
|
29
|
-
}
|
|
30
|
-
catch (er) {
|
|
31
|
-
if (er?.code === 'ENOENT') {
|
|
32
|
-
fd = node_fs_1.default.openSync(opt.file, 'w+');
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
throw er;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const st = node_fs_1.default.fstatSync(fd);
|
|
39
|
-
const headBuf = Buffer.alloc(512);
|
|
40
|
-
POSITION: for (position = 0; position < st.size; position += 512) {
|
|
41
|
-
for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {
|
|
42
|
-
bytes = node_fs_1.default.readSync(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos);
|
|
43
|
-
if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {
|
|
44
|
-
throw new Error('cannot append to compressed archives');
|
|
45
|
-
}
|
|
46
|
-
if (!bytes) {
|
|
47
|
-
break POSITION;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const h = new header_js_1.Header(headBuf);
|
|
51
|
-
if (!h.cksumValid) {
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
const entryBlockSize = 512 * Math.ceil((h.size || 0) / 512);
|
|
55
|
-
if (position + entryBlockSize + 512 > st.size) {
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
// the 512 for the header we just parsed will be added as well
|
|
59
|
-
// also jump ahead all the blocks for the body
|
|
60
|
-
position += entryBlockSize;
|
|
61
|
-
if (opt.mtimeCache && h.mtime) {
|
|
62
|
-
opt.mtimeCache.set(String(h.path), h.mtime);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
threw = false;
|
|
66
|
-
streamSync(opt, p, position, fd, files);
|
|
3
|
+
exports.replaceSync = exports.replace = exports.AppendScan = void 0;
|
|
4
|
+
const codec_js_1 = require("./codec.js");
|
|
5
|
+
const dealias_js_1 = require("./dealias.js");
|
|
6
|
+
const create_js_1 = require("./create.js");
|
|
7
|
+
const parser_js_1 = require("./parser.js");
|
|
8
|
+
// The most bytes to read from the archive at one time.
|
|
9
|
+
const CHUNK = 64 * 1024;
|
|
10
|
+
// Thrown in the parser to stop at the first block that is not valid.
|
|
11
|
+
const STOP = {};
|
|
12
|
+
const noop = () => { };
|
|
13
|
+
const compressed = () => new Error('cannot append to compressed archives');
|
|
14
|
+
const check = (opt, files) => {
|
|
15
|
+
const { file } = opt;
|
|
16
|
+
if (!file)
|
|
17
|
+
throw new TypeError('file is required');
|
|
18
|
+
if (opt.gzip ||
|
|
19
|
+
opt.brotli ||
|
|
20
|
+
opt.zstd ||
|
|
21
|
+
file.endsWith('.br') ||
|
|
22
|
+
file.endsWith('.tbr')) {
|
|
23
|
+
throw new TypeError(compressed().message);
|
|
67
24
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
node_fs_1.default.closeSync(fd);
|
|
72
|
-
}
|
|
73
|
-
catch { }
|
|
74
|
-
}
|
|
25
|
+
if (!files?.length) {
|
|
26
|
+
throw new TypeError('no paths specified to add/replace');
|
|
75
27
|
}
|
|
76
28
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Finds the place in an archive file where new entries go: the end
|
|
31
|
+
* of the last complete entry before the first block that is not a
|
|
32
|
+
* valid header. A PAX or GNU header with no entry after it is not a
|
|
33
|
+
* complete entry.
|
|
34
|
+
*
|
|
35
|
+
* Read the file into `buf` at `pos`, and call `push()`, until it
|
|
36
|
+
* returns false. The bodies of the entries are not read.
|
|
37
|
+
*/
|
|
38
|
+
class AppendScan {
|
|
39
|
+
buf = new Uint8Array(CHUNK);
|
|
40
|
+
/** The place in the file of the next read. */
|
|
41
|
+
pos = 0;
|
|
42
|
+
#size;
|
|
43
|
+
#parser;
|
|
44
|
+
#codecs;
|
|
45
|
+
#mtimes;
|
|
46
|
+
/**
|
|
47
|
+
* @param size the size of the file
|
|
48
|
+
* @param mtimes gets the path and the `mtime` of each complete entry
|
|
49
|
+
*/
|
|
50
|
+
constructor(size, codecs = [], mtimes) {
|
|
51
|
+
this.#size = size;
|
|
52
|
+
this.#codecs = [...codecs, codec_js_1.gzip];
|
|
53
|
+
this.#mtimes = mtimes;
|
|
54
|
+
this.#parser = new parser_js_1.Parser({
|
|
55
|
+
// The parser must not give the bodies.
|
|
56
|
+
filter: () => false,
|
|
57
|
+
onwarn: () => {
|
|
58
|
+
throw STOP;
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** The place in the file where new entries go. */
|
|
63
|
+
get position() {
|
|
64
|
+
return this.#parser.position;
|
|
65
|
+
}
|
|
66
|
+
/** The number of bytes to read into `buf` at `pos`. */
|
|
67
|
+
get want() {
|
|
68
|
+
return Math.min(CHUNK, this.#size - this.pos);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Parse the first `length` bytes of `buf`. False if the place is
|
|
72
|
+
* found. Throws if the file is compressed.
|
|
73
|
+
*/
|
|
74
|
+
push(length) {
|
|
75
|
+
const chunk = this.buf.subarray(0, length);
|
|
76
|
+
if (this.pos === 0 && this.#codecs.some(c => c.detect(chunk))) {
|
|
77
|
+
throw compressed();
|
|
100
78
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
/* c8 ignore next */
|
|
123
|
-
const entryBlockSize = 512 * Math.ceil((h.size ?? 0) / 512);
|
|
124
|
-
if (position + entryBlockSize + 512 > size) {
|
|
125
|
-
return cb(null, position);
|
|
126
|
-
}
|
|
127
|
-
position += entryBlockSize + 512;
|
|
128
|
-
if (position >= size) {
|
|
129
|
-
return cb(null, position);
|
|
130
|
-
}
|
|
131
|
-
if (opt.mtimeCache && h.mtime) {
|
|
132
|
-
opt.mtimeCache.set(String(h.path), h.mtime);
|
|
133
|
-
}
|
|
134
|
-
bufPos = 0;
|
|
135
|
-
node_fs_1.default.read(fd, headBuf, 0, 512, position, onread);
|
|
136
|
-
};
|
|
137
|
-
node_fs_1.default.read(fd, headBuf, 0, 512, position, onread);
|
|
138
|
-
};
|
|
139
|
-
const promise = new Promise((resolve, reject) => {
|
|
140
|
-
p.on('error', reject);
|
|
141
|
-
let flag = 'r+';
|
|
142
|
-
const onopen = (er, fd) => {
|
|
143
|
-
if (er && er.code === 'ENOENT' && flag === 'r+') {
|
|
144
|
-
flag = 'w+';
|
|
145
|
-
return node_fs_1.default.open(opt.file, flag, onopen);
|
|
146
|
-
}
|
|
147
|
-
if (er || !fd) {
|
|
148
|
-
return reject(er);
|
|
79
|
+
const parser = this.#parser;
|
|
80
|
+
this.pos += length;
|
|
81
|
+
// the end of the body of the last entry in the chunk
|
|
82
|
+
let end = 0;
|
|
83
|
+
parser.push(chunk);
|
|
84
|
+
try {
|
|
85
|
+
for (let ev; (ev = parser.next());) {
|
|
86
|
+
if (ev.type !== 'entry')
|
|
87
|
+
return false;
|
|
88
|
+
const { entry } = ev;
|
|
89
|
+
end = parser.offset + 512 * Math.ceil(entry.size / 512);
|
|
90
|
+
if (end > this.#size)
|
|
91
|
+
return false;
|
|
92
|
+
if (entry.mtime)
|
|
93
|
+
this.#mtimes?.set(entry.path, entry.mtime);
|
|
94
|
+
}
|
|
95
|
+
// The rest of the body of the last entry is not read.
|
|
96
|
+
if (this.pos < end) {
|
|
97
|
+
parser.skipBody();
|
|
98
|
+
this.pos = end;
|
|
149
99
|
}
|
|
150
|
-
node_fs_1.default.fstat(fd, (er, st) => {
|
|
151
|
-
if (er) {
|
|
152
|
-
return node_fs_1.default.close(fd, () => reject(er));
|
|
153
|
-
}
|
|
154
|
-
getPos(fd, st.size, (er, position) => {
|
|
155
|
-
if (er) {
|
|
156
|
-
return reject(er);
|
|
157
|
-
}
|
|
158
|
-
const stream = new fs_minipass_1.WriteStream(opt.file, {
|
|
159
|
-
fd: fd,
|
|
160
|
-
start: position,
|
|
161
|
-
});
|
|
162
|
-
p.pipe(stream);
|
|
163
|
-
stream.on('error', reject);
|
|
164
|
-
stream.on('close', resolve);
|
|
165
|
-
addFilesAsync(p, files);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
};
|
|
169
|
-
node_fs_1.default.open(opt.file, flag, onopen);
|
|
170
|
-
});
|
|
171
|
-
return promise;
|
|
172
|
-
};
|
|
173
|
-
const addFilesSync = (p, files) => {
|
|
174
|
-
files.forEach(file => {
|
|
175
|
-
if (file.charAt(0) === '@') {
|
|
176
|
-
(0, list_js_1.list)({
|
|
177
|
-
file: node_path_1.default.resolve(p.cwd, file.slice(1)),
|
|
178
|
-
sync: true,
|
|
179
|
-
noResume: true,
|
|
180
|
-
onReadEntry: entry => p.add(entry),
|
|
181
|
-
});
|
|
182
100
|
}
|
|
183
|
-
|
|
184
|
-
|
|
101
|
+
catch (er) {
|
|
102
|
+
if (er !== STOP)
|
|
103
|
+
throw er;
|
|
104
|
+
return false;
|
|
185
105
|
}
|
|
106
|
+
return length > 0 && this.pos < this.#size;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.AppendScan = AppendScan;
|
|
110
|
+
/**
|
|
111
|
+
* Add the files to the end of an archive file that is not
|
|
112
|
+
* compressed. The files are the same as for `create`. If the archive
|
|
113
|
+
* does not exist, it is made.
|
|
114
|
+
*
|
|
115
|
+
* The new entries go after the last complete entry of the archive.
|
|
116
|
+
* A reader of the archive gets the old entry and then the new entry
|
|
117
|
+
* of a path that is in it two times.
|
|
118
|
+
*/
|
|
119
|
+
const replace = async (options, files) => {
|
|
120
|
+
const opt = (0, dealias_js_1.dealias)(options);
|
|
121
|
+
check(opt, files);
|
|
122
|
+
const { fs, file } = opt;
|
|
123
|
+
const pack = (0, create_js_1.packFiles)(opt, files);
|
|
124
|
+
if (pack.codec)
|
|
125
|
+
throw new TypeError(compressed().message);
|
|
126
|
+
const handle = await fs.open(file, 'r+').catch(er => {
|
|
127
|
+
if (er?.code !== 'ENOENT')
|
|
128
|
+
throw er;
|
|
129
|
+
return fs.open(file, 'w+', opt.mode || 0o666);
|
|
186
130
|
});
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
p.add(file);
|
|
200
|
-
}
|
|
131
|
+
let ok = false;
|
|
132
|
+
try {
|
|
133
|
+
const { size } = await handle.stat();
|
|
134
|
+
const scan = new AppendScan(size, opt.codecs, opt.mtimeCache);
|
|
135
|
+
while (scan.push((await handle.read(scan.buf, 0, scan.want, scan.pos)).bytesRead))
|
|
136
|
+
;
|
|
137
|
+
await (0, create_js_1.writeChunks)(handle, pack, scan.position);
|
|
138
|
+
ok = true;
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
const closed = handle.close();
|
|
142
|
+
await (ok ? closed : closed.catch(noop));
|
|
201
143
|
}
|
|
202
|
-
p.end();
|
|
203
144
|
};
|
|
204
|
-
exports.replace =
|
|
205
|
-
|
|
206
|
-
() => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
(
|
|
213
|
-
|
|
214
|
-
|
|
145
|
+
exports.replace = replace;
|
|
146
|
+
/** The sync form of `replace`. */
|
|
147
|
+
const replaceSync = (options, files) => {
|
|
148
|
+
const opt = (0, dealias_js_1.dealias)(options);
|
|
149
|
+
check(opt, files);
|
|
150
|
+
const { fs, file } = opt;
|
|
151
|
+
const pack = (0, create_js_1.packFilesSync)(opt, files);
|
|
152
|
+
if (pack.codec)
|
|
153
|
+
throw new TypeError(compressed().message);
|
|
154
|
+
let fd;
|
|
155
|
+
try {
|
|
156
|
+
fd = fs.openSync(file, 'r+');
|
|
215
157
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
opt.file.endsWith('.tbr')) {
|
|
221
|
-
throw new TypeError('cannot append to compressed archives');
|
|
158
|
+
catch (er) {
|
|
159
|
+
if (er?.code !== 'ENOENT')
|
|
160
|
+
throw er;
|
|
161
|
+
fd = fs.openSync(file, 'w+', opt.mode || 0o666);
|
|
222
162
|
}
|
|
223
|
-
|
|
224
|
-
|
|
163
|
+
try {
|
|
164
|
+
const { size } = fs.fstatSync(fd);
|
|
165
|
+
const scan = new AppendScan(size, opt.codecs, opt.mtimeCache);
|
|
166
|
+
while (scan.push(fs.readSync(fd, scan.buf, 0, scan.want, scan.pos)))
|
|
167
|
+
;
|
|
168
|
+
(0, create_js_1.writeChunksSync)(fs, fd, pack, scan.position);
|
|
225
169
|
}
|
|
226
|
-
|
|
170
|
+
catch (er) {
|
|
171
|
+
try {
|
|
172
|
+
fs.closeSync(fd);
|
|
173
|
+
}
|
|
174
|
+
catch { }
|
|
175
|
+
throw er;
|
|
176
|
+
}
|
|
177
|
+
fs.closeSync(fd);
|
|
178
|
+
};
|
|
179
|
+
exports.replaceSync = replaceSync;
|
|
227
180
|
//# sourceMappingURL=replace.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Transform } from 'node:stream';
|
|
2
|
+
import * as nodeZlib from 'node:zlib';
|
|
3
|
+
import type { Codec, CodecStream } from '../codec.js';
|
|
4
|
+
/**
|
|
5
|
+
* The functions of `node:zlib` that the codecs use. A runtime can
|
|
6
|
+
* have no brotli functions or no zstd functions.
|
|
7
|
+
*/
|
|
8
|
+
export type ZlibModule = Pick<typeof nodeZlib, 'createGzip' | 'createGunzip' | 'gzipSync' | 'gunzipSync'> & Partial<Pick<typeof nodeZlib, 'createBrotliCompress' | 'createBrotliDecompress' | 'brotliCompressSync' | 'brotliDecompressSync' | 'createZstdCompress' | 'createZstdDecompress' | 'zstdCompressSync' | 'zstdDecompressSync'>>;
|
|
9
|
+
/**
|
|
10
|
+
* Make the two web streams of a `node:zlib` stream, or of another
|
|
11
|
+
* `Transform` stream of `node:stream`. The result fits the
|
|
12
|
+
* `transform` option of `extract`.
|
|
13
|
+
*
|
|
14
|
+
* As with a `TransformStream`, a write is complete only when the
|
|
15
|
+
* reader asks for more output than the stream has. The zlib stream
|
|
16
|
+
* makes output only until its buffer is full. So the reader of an
|
|
17
|
+
* archive can stop before more is decompressed.
|
|
18
|
+
*
|
|
19
|
+
* @param batch put small chunks of input together for one write.
|
|
20
|
+
* Each write is a task for a thread.
|
|
21
|
+
* @param first called with the first chunk of output
|
|
22
|
+
*/
|
|
23
|
+
export declare const codecStream: (stream: Transform, batch?: boolean, first?: (chunk: Uint8Array) => void) => CodecStream;
|
|
24
|
+
/**
|
|
25
|
+
* The codecs of a `node:zlib` module: gzip, then brotli and zstd if
|
|
26
|
+
* the module has their functions.
|
|
27
|
+
*
|
|
28
|
+
* The value of a `gzip`, `brotli`, or `zstd` option of `create` goes
|
|
29
|
+
* to the zlib function as its options. A gzip codec reads the tar
|
|
30
|
+
* option `portable` in its options: it makes output that does not
|
|
31
|
+
* name the system.
|
|
32
|
+
*
|
|
33
|
+
* A brotli archive has no magic number. The readers use the brotli
|
|
34
|
+
* codec for a file with a name that ends in `.tar.br` or `.tbr`, if
|
|
35
|
+
* the file does not start with a tar header.
|
|
36
|
+
*/
|
|
37
|
+
export declare const zlibCodecs: (z?: ZlibModule) => Codec[];
|
|
38
|
+
//# sourceMappingURL=codecs.d.ts.map
|