@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,166 +1,136 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// is called with a cb that clears the reservation.
|
|
5
|
-
//
|
|
6
|
-
// Used by async unpack to avoid clobbering paths in use,
|
|
7
|
-
// while still allowing maximal safe parallelization.
|
|
8
|
-
import { join } from 'node:path';
|
|
1
|
+
// The async extraction does several entries at one time. Two entries
|
|
2
|
+
// must not work on the same path at one time: a link needs its
|
|
3
|
+
// target, and an entry can replace an object of a different type.
|
|
9
4
|
import { normalizeUnicode } from './normalize-unicode.js';
|
|
10
5
|
import { stripTrailingSlashes } from './strip-trailing-slashes.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (s !== undefined) {
|
|
22
|
-
path = join(s, path);
|
|
23
|
-
}
|
|
24
|
-
set.push(path || '/');
|
|
25
|
-
return set;
|
|
26
|
-
}, []);
|
|
27
|
-
return dirs;
|
|
28
|
-
};
|
|
6
|
+
import { join } from './path.js';
|
|
7
|
+
/**
|
|
8
|
+
* Gives each task the exclusive use of its paths, and the shared use
|
|
9
|
+
* of their parent directories. A task starts when each task before
|
|
10
|
+
* it that uses one of its paths, or a directory above or below one,
|
|
11
|
+
* is done.
|
|
12
|
+
*
|
|
13
|
+
* Paths that differ only in case or in Unicode form are the same
|
|
14
|
+
* path, because they can be the same file on disk.
|
|
15
|
+
*/
|
|
29
16
|
export class PathReservations {
|
|
30
|
-
|
|
31
|
-
// A Set object means a directory reservation
|
|
32
|
-
// A fn is a direct reservation on that path
|
|
33
|
-
#queues = new Map();
|
|
34
|
-
// fn => {paths:[path,...], dirs:[path, ...]}
|
|
17
|
+
#root = { queue: [], name: '' };
|
|
35
18
|
#reservations = new Map();
|
|
36
|
-
// functions currently running
|
|
37
19
|
#running = new Set();
|
|
20
|
+
#win32;
|
|
21
|
+
/** @param win32 run one task at a time */
|
|
22
|
+
constructor(win32 = false) {
|
|
23
|
+
this.#win32 = win32;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Call `fn` when it is first in line for each of its paths. The
|
|
27
|
+
* paths are free again when the promise of `fn` settles. Returns a
|
|
28
|
+
* promise with the result of `fn`.
|
|
29
|
+
*/
|
|
38
30
|
reserve(paths, fn) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
return new Promise((res, rej) => {
|
|
32
|
+
const handler = () => {
|
|
33
|
+
fn().then(() => {
|
|
34
|
+
this.#clear(handler);
|
|
35
|
+
res();
|
|
36
|
+
}, er => {
|
|
37
|
+
this.#clear(handler);
|
|
38
|
+
rej(er);
|
|
45
39
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
else {
|
|
68
|
-
q.push(new Set([fn]));
|
|
69
|
-
}
|
|
40
|
+
};
|
|
41
|
+
this.#add(paths, handler);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
#add(names, fn) {
|
|
45
|
+
const root = this.#root;
|
|
46
|
+
const paths = new Set();
|
|
47
|
+
const dirs = new Set();
|
|
48
|
+
for (const name of this.#win32 ?
|
|
49
|
+
['win32 parallelization disabled']
|
|
50
|
+
: names) {
|
|
51
|
+
const path = this.#win32 ? name : (stripTrailingSlashes(join(normalizeUnicode(name))));
|
|
52
|
+
let node = root;
|
|
53
|
+
for (const part of path.split('/')) {
|
|
54
|
+
if (node !== root)
|
|
55
|
+
dirs.add(node);
|
|
56
|
+
const kids = (node.kids ??= new Map());
|
|
57
|
+
let kid = kids.get(part);
|
|
58
|
+
if (!kid)
|
|
59
|
+
kids.set(part, (kid = { queue: [], name: part, up: node }));
|
|
60
|
+
node = kid;
|
|
70
61
|
}
|
|
62
|
+
paths.add(node);
|
|
71
63
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
64
|
+
// A path of the task is exclusive, so it also covers the use of
|
|
65
|
+
// that path as a parent directory of another path.
|
|
66
|
+
for (const p of paths)
|
|
67
|
+
dirs.delete(p);
|
|
68
|
+
this.#reservations.set(fn, { dirs, paths });
|
|
69
|
+
for (const p of paths)
|
|
70
|
+
p.queue.push(fn);
|
|
71
|
+
for (const { queue } of dirs) {
|
|
72
|
+
const last = queue[queue.length - 1];
|
|
73
|
+
if (last instanceof Set)
|
|
74
|
+
last.add(fn);
|
|
75
|
+
else
|
|
76
|
+
queue.push(new Set([fn]));
|
|
81
77
|
}
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
paths: res.paths.map((path) => this.#queues.get(path)),
|
|
85
|
-
dirs: [...res.dirs].map(path => this.#queues.get(path)),
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
// check if fn is first in line for all its paths, and is
|
|
89
|
-
// included in the first set for all its dir queues
|
|
90
|
-
check(fn) {
|
|
91
|
-
const { paths, dirs } = this.#getQueues(fn);
|
|
92
|
-
return (paths.every(q => q && q[0] === fn) &&
|
|
93
|
-
dirs.every(q => q && q[0] instanceof Set && q[0].has(fn)));
|
|
78
|
+
this.#run(fn);
|
|
94
79
|
}
|
|
95
|
-
//
|
|
80
|
+
// Start the task if it is first in line for each path, and in the
|
|
81
|
+
// first set for each directory. A task that waits is never first in
|
|
82
|
+
// line for each of them, so a task starts one time only.
|
|
96
83
|
#run(fn) {
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
const { paths, dirs } = this.#reservations.get(fn);
|
|
85
|
+
for (const p of paths) {
|
|
86
|
+
if (p.queue[0] !== fn)
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
for (const { queue } of dirs) {
|
|
90
|
+
const first = queue[0];
|
|
91
|
+
if (!(first instanceof Set) || !first.has(fn))
|
|
92
|
+
return;
|
|
99
93
|
}
|
|
100
94
|
this.#running.add(fn);
|
|
101
|
-
fn(
|
|
102
|
-
return true;
|
|
95
|
+
fn();
|
|
103
96
|
}
|
|
104
97
|
#clear(fn) {
|
|
105
|
-
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
const res = this.#reservations.get(fn);
|
|
109
|
-
/* c8 ignore start */
|
|
110
|
-
if (!res) {
|
|
111
|
-
throw new Error('invalid reservation');
|
|
112
|
-
}
|
|
113
|
-
/* c8 ignore stop */
|
|
114
|
-
const { paths, dirs } = res;
|
|
98
|
+
const { paths, dirs } = this.#reservations.get(fn);
|
|
115
99
|
const next = new Set();
|
|
116
|
-
for (const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (!q0) {
|
|
125
|
-
this.#queues.delete(path);
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
q.shift();
|
|
129
|
-
if (typeof q0 === 'function') {
|
|
130
|
-
next.add(q0);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
for (const f of q0) {
|
|
100
|
+
for (const { queue } of paths) {
|
|
101
|
+
// A running task is first in the queue of each of its paths.
|
|
102
|
+
queue.shift();
|
|
103
|
+
const after = queue[0];
|
|
104
|
+
if (typeof after === 'function')
|
|
105
|
+
next.add(after);
|
|
106
|
+
else if (after)
|
|
107
|
+
for (const f of after)
|
|
134
108
|
next.add(f);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
109
|
}
|
|
138
|
-
for (const
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
continue;
|
|
144
|
-
if (q0.size === 1 && q.length === 1) {
|
|
145
|
-
this.#queues.delete(dir);
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
else if (q0.size === 1) {
|
|
149
|
-
q.shift();
|
|
150
|
-
// next one must be a function,
|
|
151
|
-
// or else the Set would've been reused
|
|
152
|
-
const n = q[0];
|
|
153
|
-
if (typeof n === 'function') {
|
|
154
|
-
next.add(n);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
110
|
+
for (const { queue } of dirs) {
|
|
111
|
+
// A running task is in the first set of each of its directories.
|
|
112
|
+
const first = queue[0];
|
|
113
|
+
if (first.size > 1)
|
|
114
|
+
first.delete(fn);
|
|
157
115
|
else {
|
|
158
|
-
|
|
116
|
+
queue.shift();
|
|
117
|
+
// Two sets in a row would be one set, so this is a function.
|
|
118
|
+
if (queue.length)
|
|
119
|
+
next.add(queue[0]);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Remove each node that no task uses. Each directory of the task
|
|
123
|
+
// is above one of its paths.
|
|
124
|
+
for (let node of paths) {
|
|
125
|
+
while (node.up && !node.queue.length && !node.kids?.size) {
|
|
126
|
+
node.up.kids?.delete(node.name);
|
|
127
|
+
node = node.up;
|
|
159
128
|
}
|
|
160
129
|
}
|
|
161
130
|
this.#running.delete(fn);
|
|
162
|
-
|
|
163
|
-
|
|
131
|
+
this.#reservations.delete(fn);
|
|
132
|
+
for (const f of next)
|
|
133
|
+
this.#run(f);
|
|
164
134
|
}
|
|
165
135
|
}
|
|
166
136
|
//# sourceMappingURL=path-reservations.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Resolve `.` and `..` parts, and remove repeated slashes. */
|
|
2
|
+
export declare const normalize: (path: string) => string;
|
|
3
|
+
/** Join the parts with a slash, then normalize the result. */
|
|
4
|
+
export declare const join: (...parts: string[]) => string;
|
|
5
|
+
/** The path without its last part. */
|
|
6
|
+
export declare const dirname: (path: string) => string;
|
|
7
|
+
/** The last part of the path. */
|
|
8
|
+
export declare const basename: (path: string) => string;
|
|
9
|
+
/** True if the path starts with a slash. */
|
|
10
|
+
export declare const isAbsolute: (path: string) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the parts from right to left, up to the first absolute
|
|
13
|
+
* part. There is no working directory here: if no part is absolute,
|
|
14
|
+
* the result is a relative path.
|
|
15
|
+
*/
|
|
16
|
+
export declare const resolve: (...parts: string[]) => string;
|
|
17
|
+
/** The relative path from `from` to `to`. */
|
|
18
|
+
export declare const relative: (from: string, to: string) => string;
|
|
19
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// The POSIX path functions that tar paths need. Each one gives the
|
|
2
|
+
// same result as the function of the same name in `path.posix`.
|
|
3
|
+
/** Resolve `.` and `..` parts, and remove repeated slashes. */
|
|
4
|
+
export const normalize = (path) => {
|
|
5
|
+
const absolute = path.charCodeAt(0) === 47;
|
|
6
|
+
const out = [];
|
|
7
|
+
for (const part of path.split('/')) {
|
|
8
|
+
if (part === '' || part === '.')
|
|
9
|
+
continue;
|
|
10
|
+
if (part !== '..')
|
|
11
|
+
out.push(part);
|
|
12
|
+
else if (out.length && out[out.length - 1] !== '..')
|
|
13
|
+
out.pop();
|
|
14
|
+
else if (!absolute)
|
|
15
|
+
out.push(part);
|
|
16
|
+
}
|
|
17
|
+
const trail = out.length && path.charCodeAt(path.length - 1) === 47;
|
|
18
|
+
const res = out.join('/') + (trail ? '/' : '');
|
|
19
|
+
if (absolute)
|
|
20
|
+
return '/' + res;
|
|
21
|
+
return res || (path.endsWith('/') ? './' : '.');
|
|
22
|
+
};
|
|
23
|
+
/** Join the parts with a slash, then normalize the result. */
|
|
24
|
+
export const join = (...parts) => normalize(parts.filter(p => p).join('/'));
|
|
25
|
+
/** The path without its last part. */
|
|
26
|
+
export const dirname = (path) => {
|
|
27
|
+
let end = path.length;
|
|
28
|
+
while (end > 1 && path.charCodeAt(end - 1) === 47)
|
|
29
|
+
end--;
|
|
30
|
+
const slash = path.lastIndexOf('/', end - 1);
|
|
31
|
+
if (slash === -1)
|
|
32
|
+
return '.';
|
|
33
|
+
if (slash === 0)
|
|
34
|
+
return '/';
|
|
35
|
+
if (slash === 1 && path.charCodeAt(0) === 47)
|
|
36
|
+
return '//';
|
|
37
|
+
return path.slice(0, slash);
|
|
38
|
+
};
|
|
39
|
+
/** The last part of the path. */
|
|
40
|
+
export const basename = (path) => {
|
|
41
|
+
let end = path.length;
|
|
42
|
+
while (end > 0 && path.charCodeAt(end - 1) === 47)
|
|
43
|
+
end--;
|
|
44
|
+
return path.slice(path.lastIndexOf('/', end - 1) + 1, end);
|
|
45
|
+
};
|
|
46
|
+
/** True if the path starts with a slash. */
|
|
47
|
+
export const isAbsolute = (path) => path.charCodeAt(0) === 47;
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the parts from right to left, up to the first absolute
|
|
50
|
+
* part. There is no working directory here: if no part is absolute,
|
|
51
|
+
* the result is a relative path.
|
|
52
|
+
*/
|
|
53
|
+
export const resolve = (...parts) => {
|
|
54
|
+
let path = '';
|
|
55
|
+
for (let i = parts.length - 1; i >= 0 && !isAbsolute(path); i--) {
|
|
56
|
+
const part = parts[i];
|
|
57
|
+
if (part)
|
|
58
|
+
path = path ? part + '/' + path : part;
|
|
59
|
+
}
|
|
60
|
+
const res = normalize(path);
|
|
61
|
+
return res.length > 1 && res.endsWith('/') ? res.slice(0, -1) : res;
|
|
62
|
+
};
|
|
63
|
+
/** The relative path from `from` to `to`. */
|
|
64
|
+
export const relative = (from, to) => {
|
|
65
|
+
const f = resolve(from).split('/');
|
|
66
|
+
const t = resolve(to).split('/');
|
|
67
|
+
// The root gives an empty last part.
|
|
68
|
+
if (!f[f.length - 1])
|
|
69
|
+
f.pop();
|
|
70
|
+
if (!t[t.length - 1])
|
|
71
|
+
t.pop();
|
|
72
|
+
let same = 0;
|
|
73
|
+
while (same < f.length && same < t.length && f[same] === t[same])
|
|
74
|
+
same++;
|
|
75
|
+
return [
|
|
76
|
+
...Array.from({ length: f.length - same }, () => '..'),
|
|
77
|
+
...t.slice(same),
|
|
78
|
+
].join('/');
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -18,9 +18,11 @@ export declare class Pax implements HeaderData {
|
|
|
18
18
|
mode?: number;
|
|
19
19
|
global: boolean;
|
|
20
20
|
constructor(obj: HeaderData, global?: boolean);
|
|
21
|
-
encode():
|
|
21
|
+
encode(): Uint8Array<ArrayBuffer>;
|
|
22
22
|
encodeBody(): string;
|
|
23
23
|
encodeField(field: keyof Pax): string;
|
|
24
24
|
static parse(str: string, ex?: HeaderData, g?: boolean): Pax;
|
|
25
|
+
/** Parse the body of a PAX header entry. */
|
|
26
|
+
static parseBytes(buf: Uint8Array, ex?: HeaderData, g?: boolean): Pax;
|
|
25
27
|
}
|
|
26
28
|
//# sourceMappingURL=pax.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { basename } from 'node:path';
|
|
2
1
|
import { Header } from './header.js';
|
|
2
|
+
import { decodeUtf8, encodeUtf8Into, utf8Length } from './bytes.js';
|
|
3
|
+
import { basename } from './path.js';
|
|
4
|
+
const SIMPLE_NUMBER = /^\d+$/;
|
|
3
5
|
export class Pax {
|
|
4
6
|
atime;
|
|
5
7
|
mtime;
|
|
@@ -39,24 +41,18 @@ export class Pax {
|
|
|
39
41
|
encode() {
|
|
40
42
|
const body = this.encodeBody();
|
|
41
43
|
if (body === '') {
|
|
42
|
-
return
|
|
44
|
+
return new Uint8Array(0);
|
|
43
45
|
}
|
|
44
|
-
const bodyLen =
|
|
46
|
+
const bodyLen = utf8Length(body);
|
|
45
47
|
// round up to 512 bytes
|
|
46
48
|
// add 512 for header
|
|
47
49
|
const bufLen = 512 * Math.ceil(1 + bodyLen / 512);
|
|
48
|
-
const buf =
|
|
49
|
-
// 0-fill the header section, it might not hit every field
|
|
50
|
-
for (let i = 0; i < 512; i++) {
|
|
51
|
-
buf[i] = 0;
|
|
52
|
-
}
|
|
50
|
+
const buf = new Uint8Array(bufLen);
|
|
53
51
|
new Header({
|
|
54
52
|
// XXX split the path
|
|
55
53
|
// then the path should be PaxHeader + basename, but less than 99,
|
|
56
54
|
// prepend with the dirname
|
|
57
|
-
/* c8 ignore start */
|
|
58
55
|
path: ('PaxHeader/' + basename(this.path ?? '')).slice(0, 99),
|
|
59
|
-
/* c8 ignore stop */
|
|
60
56
|
mode: this.mode || 0o644,
|
|
61
57
|
uid: this.uid,
|
|
62
58
|
gid: this.gid,
|
|
@@ -71,11 +67,7 @@ export class Pax {
|
|
|
71
67
|
atime: this.atime,
|
|
72
68
|
ctime: this.ctime,
|
|
73
69
|
}).encode(buf);
|
|
74
|
-
|
|
75
|
-
// null pad after the body
|
|
76
|
-
for (let i = bodyLen + 512; i < buf.length; i++) {
|
|
77
|
-
buf[i] = 0;
|
|
78
|
-
}
|
|
70
|
+
encodeUtf8Into(body, buf, 512, bodyLen);
|
|
79
71
|
return buf;
|
|
80
72
|
}
|
|
81
73
|
encodeBody() {
|
|
@@ -100,7 +92,7 @@ export class Pax {
|
|
|
100
92
|
return '';
|
|
101
93
|
}
|
|
102
94
|
const r = this[field];
|
|
103
|
-
const v = r
|
|
95
|
+
const v = typeof r === 'object' ? r.getTime() / 1000 : r;
|
|
104
96
|
const s = ' ' +
|
|
105
97
|
(field === 'dev' || field === 'ino' || field === 'nlink' ?
|
|
106
98
|
'SCHILY.'
|
|
@@ -109,7 +101,7 @@ export class Pax {
|
|
|
109
101
|
'=' +
|
|
110
102
|
v +
|
|
111
103
|
'\n';
|
|
112
|
-
const byteLen =
|
|
104
|
+
const byteLen = utf8Length(s);
|
|
113
105
|
// the digits includes the length of the digits in ascii base-10
|
|
114
106
|
// so if it's 9 characters, then adding 1 for the 9 makes it 10
|
|
115
107
|
// which makes it 11 chars.
|
|
@@ -121,29 +113,56 @@ export class Pax {
|
|
|
121
113
|
return len + s;
|
|
122
114
|
}
|
|
123
115
|
static parse(str, ex, g = false) {
|
|
124
|
-
return new
|
|
116
|
+
return Pax.parseBytes(new TextEncoder().encode(str), ex, g);
|
|
117
|
+
}
|
|
118
|
+
/** Parse the body of a PAX header entry. */
|
|
119
|
+
static parseBytes(buf, ex, g = false) {
|
|
120
|
+
return new Pax(merge(parseKV(buf), ex), g);
|
|
125
121
|
}
|
|
126
122
|
}
|
|
127
123
|
const merge = (a, b) => b ? Object.assign({}, b, a) : a;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
124
|
+
// Each record is "<len> <key>=<value>\n". <len> is the byte length of
|
|
125
|
+
// the whole record. A value can contain a newline, so use the length
|
|
126
|
+
// to find the end of the record. A NUL where a record starts is the
|
|
127
|
+
// end of the records, as it is for GNU tar and Python. A record that
|
|
128
|
+
// is not valid is an error, because the records after it can set the
|
|
129
|
+
// size or the name of the entry.
|
|
130
|
+
const parseKV = (buf) => {
|
|
131
|
+
const set = Object.create(null);
|
|
132
|
+
let pos = 0;
|
|
133
|
+
while (pos < buf.length && buf[pos] !== 0) {
|
|
134
|
+
let sp = pos;
|
|
135
|
+
while (sp < buf.length &&
|
|
136
|
+
buf[sp] >= 0x30 &&
|
|
137
|
+
buf[sp] <= 0x39) {
|
|
138
|
+
sp++;
|
|
139
|
+
}
|
|
140
|
+
const end = pos + Number(decodeUtf8(buf, pos, sp));
|
|
141
|
+
if (sp === pos ||
|
|
142
|
+
buf[sp] !== 0x20 ||
|
|
143
|
+
end <= sp + 1 ||
|
|
144
|
+
end > buf.length ||
|
|
145
|
+
buf[end - 1] !== 0x0a) {
|
|
146
|
+
throw new Error('invalid PAX record');
|
|
147
|
+
}
|
|
148
|
+
parseKVLine(set, decodeUtf8(buf, sp + 1, end - 1));
|
|
149
|
+
pos = end;
|
|
138
150
|
}
|
|
139
|
-
|
|
151
|
+
return set;
|
|
152
|
+
};
|
|
153
|
+
const parseKVLine = (set, line) => {
|
|
140
154
|
const kv = line.split('=');
|
|
155
|
+
if (kv.length === 1)
|
|
156
|
+
throw new Error('invalid PAX record');
|
|
141
157
|
const r = kv.shift();
|
|
142
158
|
if (!r) {
|
|
143
159
|
return set;
|
|
144
160
|
}
|
|
145
161
|
const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, '$1');
|
|
146
|
-
|
|
162
|
+
// The value ends at the first NUL.
|
|
163
|
+
const joined = kv.join('=');
|
|
164
|
+
const nul = joined.indexOf('\0');
|
|
165
|
+
const v = nul === -1 ? joined : joined.slice(0, nul);
|
|
147
166
|
switch (k) {
|
|
148
167
|
case 'path':
|
|
149
168
|
case 'linkpath':
|
|
@@ -157,12 +176,18 @@ const parseKVLine = (set, line) => {
|
|
|
157
176
|
case 'ctime':
|
|
158
177
|
case 'atime':
|
|
159
178
|
case 'mtime':
|
|
160
|
-
|
|
179
|
+
const d = new Date(Number(v) * 1000);
|
|
180
|
+
if (!isNaN(d.getTime()))
|
|
181
|
+
set[k] = d;
|
|
161
182
|
break;
|
|
162
183
|
case 'size':
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
184
|
+
// The size sets where the next header is. Other tar programs
|
|
185
|
+
// read a value that is not only decimal digits in different
|
|
186
|
+
// ways, so it is an error.
|
|
187
|
+
if (!SIMPLE_NUMBER.test(joined) || !Number.isSafeInteger(+joined)) {
|
|
188
|
+
throw new Error('invalid PAX size');
|
|
189
|
+
}
|
|
190
|
+
set[k] = +joined;
|
|
166
191
|
break;
|
|
167
192
|
case 'gid':
|
|
168
193
|
case 'uid':
|
|
@@ -170,7 +195,13 @@ const parseKVLine = (set, line) => {
|
|
|
170
195
|
case 'ino':
|
|
171
196
|
case 'nlink':
|
|
172
197
|
case 'mode':
|
|
173
|
-
|
|
198
|
+
// value must be a string of decimal digits
|
|
199
|
+
if (!SIMPLE_NUMBER.test(v.trim()))
|
|
200
|
+
break;
|
|
201
|
+
const s = +v;
|
|
202
|
+
if (!Number.isSafeInteger(s))
|
|
203
|
+
break;
|
|
204
|
+
set[k] = s;
|
|
174
205
|
break;
|
|
175
206
|
}
|
|
176
207
|
return set;
|