@unbrained/pm-cli 2026.12.1 → 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.
Files changed (267) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli-bundle/bundle-manifest.json +1 -1
  3. package/dist/cli-bundle/chunks/{chunk-CWPR234D.js → chunk-7NAO7I75.js} +2 -2
  4. package/dist/cli-bundle/chunks/{chunk-4YQMQOUO.js → chunk-7V65VACG.js} +52 -52
  5. package/dist/cli-bundle/chunks/{chunk-NA6D75V5.js → chunk-G6TARHFK.js} +2 -2
  6. package/dist/cli-bundle/chunks/{chunk-YSVOXCYH.js → chunk-GOEQXVOI.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-OKEJ4U2I.js → chunk-ROTEELDL.js} +3 -3
  8. package/dist/cli-bundle/chunks/{chunk-U7RBJGLF.js → chunk-SDXCJZKB.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-XME6GIFQ.js → chunk-TKUG2X24.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-Q6GLSAJY.js → chunk-UNBW2LF3.js} +2 -2
  11. package/dist/cli-bundle/chunks/chunk-V2S4XAX3.js +2 -0
  12. package/dist/cli-bundle/chunks/{item-transaction-66RDV7PH.js → item-transaction-56J5OCHA.js} +2 -2
  13. package/dist/cli-bundle/chunks/{linked-resource-value-list-E2DX52LY.js → linked-resource-value-list-ZBIY4H23.js} +2 -2
  14. package/dist/cli-bundle/chunks/{register-mutation-2F6JUBST.js → register-mutation-EK6DVIQK.js} +2 -2
  15. package/dist/cli-bundle/chunks/{register-operations-ET3UKPYK.js → register-operations-6MURXE4V.js} +2 -2
  16. package/dist/cli-bundle/chunks/{register-setup-I63QTFCU.js → register-setup-RW26X3GJ.js} +2 -2
  17. package/dist/cli-bundle/focused-chunks/{chunk-SQ72CVUH.js → chunk-3COWDIPX.js} +54 -54
  18. package/dist/cli-bundle/focused-chunks/{chunk-PT7RT3T6.js → chunk-J72TRWR5.js} +3 -3
  19. package/dist/cli-bundle/focused-chunks/{item-transaction-2K4SFLJ7.js → item-transaction-LQLQLZE7.js} +2 -2
  20. package/dist/cli-bundle/main.js +3 -3
  21. package/dist/cli-bundle/sdk-core.js +1 -1
  22. package/dist/cli-bundle/sdk-governance.js +1 -1
  23. package/dist/cli-bundle/sdk-merge.js +1 -1
  24. package/dist/cli-bundle/sdk-runtime.js +1 -1
  25. package/dist/cli-bundle/sdk-testing.js +1 -1
  26. package/dist/cli-bundle/sdk.js +1 -1
  27. package/dist/sdk/extension/install-sources.d.ts +2 -2
  28. package/dist/sdk/extension/install-sources.js +5 -5
  29. package/marketplace.json +1 -1
  30. package/node_modules/tar/README.md +1792 -1147
  31. package/node_modules/tar/dist/commonjs/bytes.d.ts +21 -0
  32. package/node_modules/tar/dist/commonjs/bytes.js +83 -0
  33. package/node_modules/tar/dist/commonjs/codec.d.ts +53 -0
  34. package/node_modules/tar/dist/commonjs/codec.js +35 -0
  35. package/node_modules/tar/dist/commonjs/concat.d.ts +3 -0
  36. package/node_modules/tar/dist/commonjs/concat.js +20 -0
  37. package/node_modules/tar/dist/commonjs/create.d.ts +39 -2
  38. package/node_modules/tar/dist/commonjs/create.js +150 -64
  39. package/node_modules/tar/dist/commonjs/dealias.d.ts +79 -0
  40. package/node_modules/tar/dist/commonjs/dealias.js +50 -0
  41. package/node_modules/tar/dist/commonjs/delete.d.ts +19 -0
  42. package/node_modules/tar/dist/commonjs/delete.js +121 -0
  43. package/node_modules/tar/dist/commonjs/entries.d.ts +82 -0
  44. package/node_modules/tar/dist/commonjs/entries.js +398 -0
  45. package/node_modules/tar/dist/commonjs/extract.d.ts +14 -2
  46. package/node_modules/tar/dist/commonjs/extract.js +40 -81
  47. package/node_modules/tar/dist/commonjs/fs.d.ts +201 -0
  48. package/node_modules/tar/dist/commonjs/fs.js +5 -0
  49. package/node_modules/tar/dist/commonjs/header.d.ts +4 -4
  50. package/node_modules/tar/dist/commonjs/header.js +71 -53
  51. package/node_modules/tar/dist/commonjs/index.d.ts +25 -18
  52. package/node_modules/tar/dist/commonjs/index.js +46 -18
  53. package/node_modules/tar/dist/commonjs/index.min.js +2 -3
  54. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +2 -2
  55. package/node_modules/tar/dist/commonjs/large-numbers.js +4 -4
  56. package/node_modules/tar/dist/commonjs/list.d.ts +23 -6
  57. package/node_modules/tar/dist/commonjs/list.js +99 -138
  58. package/node_modules/tar/dist/commonjs/mkdir.d.ts +16 -11
  59. package/node_modules/tar/dist/commonjs/mkdir.js +121 -159
  60. package/node_modules/tar/dist/commonjs/normalize-unicode.js +9 -0
  61. package/node_modules/tar/dist/commonjs/options.d.ts +284 -513
  62. package/node_modules/tar/dist/commonjs/options.js +20 -61
  63. package/node_modules/tar/dist/commonjs/pack.d.ts +150 -96
  64. package/node_modules/tar/dist/commonjs/pack.js +752 -445
  65. package/node_modules/tar/dist/commonjs/parser.d.ts +98 -0
  66. package/node_modules/tar/dist/commonjs/parser.js +452 -0
  67. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +17 -7
  68. package/node_modules/tar/dist/commonjs/path-reservations.js +110 -140
  69. package/node_modules/tar/dist/commonjs/path.d.ts +19 -0
  70. package/node_modules/tar/dist/commonjs/path.js +90 -0
  71. package/node_modules/tar/dist/commonjs/pax.d.ts +3 -1
  72. package/node_modules/tar/dist/commonjs/pax.js +67 -36
  73. package/node_modules/tar/dist/commonjs/read-entry.d.ts +97 -11
  74. package/node_modules/tar/dist/commonjs/read-entry.js +251 -97
  75. package/node_modules/tar/dist/commonjs/read-file.d.ts +22 -0
  76. package/node_modules/tar/dist/commonjs/read-file.js +104 -0
  77. package/node_modules/tar/dist/commonjs/replace.d.ts +45 -1
  78. package/node_modules/tar/dist/commonjs/replace.js +164 -211
  79. package/node_modules/tar/dist/commonjs/server/codecs.d.ts +38 -0
  80. package/node_modules/tar/dist/commonjs/server/codecs.js +252 -0
  81. package/node_modules/tar/dist/commonjs/server/index.d.ts +115 -0
  82. package/node_modules/tar/dist/commonjs/server/index.js +166 -0
  83. package/node_modules/tar/dist/commonjs/server/index.min.js +3 -0
  84. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +8 -0
  85. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +17 -20
  86. package/node_modules/tar/dist/commonjs/to-stream.d.ts +7 -0
  87. package/node_modules/tar/dist/commonjs/to-stream.js +22 -0
  88. package/node_modules/tar/dist/commonjs/types.d.ts +4 -3
  89. package/node_modules/tar/dist/commonjs/types.js +4 -3
  90. package/node_modules/tar/dist/commonjs/unpack.d.ts +143 -89
  91. package/node_modules/tar/dist/commonjs/unpack.js +780 -725
  92. package/node_modules/tar/dist/commonjs/update.d.ts +11 -1
  93. package/node_modules/tar/dist/commonjs/update.js +37 -28
  94. package/node_modules/tar/dist/commonjs/warn.d.ts +27 -0
  95. package/node_modules/tar/dist/commonjs/warn.js +36 -0
  96. package/node_modules/tar/dist/commonjs/win32-path.d.ts +16 -0
  97. package/node_modules/tar/dist/commonjs/win32-path.js +67 -0
  98. package/node_modules/tar/dist/commonjs/write-entry.d.ts +64 -111
  99. package/node_modules/tar/dist/commonjs/write-entry.js +108 -672
  100. package/node_modules/tar/dist/commonjs/write-flag.d.ts +18 -0
  101. package/node_modules/tar/dist/commonjs/write-flag.js +29 -0
  102. package/node_modules/tar/dist/esm/bytes.d.ts +21 -0
  103. package/node_modules/tar/dist/esm/bytes.js +72 -0
  104. package/node_modules/tar/dist/esm/codec.d.ts +53 -0
  105. package/node_modules/tar/dist/esm/codec.js +32 -0
  106. package/node_modules/tar/dist/esm/concat.d.ts +3 -0
  107. package/node_modules/tar/dist/esm/concat.js +16 -0
  108. package/node_modules/tar/dist/esm/create.d.ts +39 -2
  109. package/node_modules/tar/dist/esm/create.js +144 -61
  110. package/node_modules/tar/dist/esm/dealias.d.ts +79 -0
  111. package/node_modules/tar/dist/esm/dealias.js +46 -0
  112. package/node_modules/tar/dist/esm/delete.d.ts +19 -0
  113. package/node_modules/tar/dist/esm/delete.js +117 -0
  114. package/node_modules/tar/dist/esm/entries.d.ts +82 -0
  115. package/node_modules/tar/dist/esm/entries.js +388 -0
  116. package/node_modules/tar/dist/esm/extract.d.ts +14 -2
  117. package/node_modules/tar/dist/esm/extract.js +37 -44
  118. package/node_modules/tar/dist/esm/fs.d.ts +201 -0
  119. package/node_modules/tar/dist/esm/fs.js +4 -0
  120. package/node_modules/tar/dist/esm/header.d.ts +4 -4
  121. package/node_modules/tar/dist/esm/header.js +71 -53
  122. package/node_modules/tar/dist/esm/index.d.ts +25 -18
  123. package/node_modules/tar/dist/esm/index.js +23 -18
  124. package/node_modules/tar/dist/esm/index.min.js +2 -3
  125. package/node_modules/tar/dist/esm/large-numbers.d.ts +2 -2
  126. package/node_modules/tar/dist/esm/large-numbers.js +4 -4
  127. package/node_modules/tar/dist/esm/list.d.ts +23 -6
  128. package/node_modules/tar/dist/esm/list.js +96 -101
  129. package/node_modules/tar/dist/esm/mkdir.d.ts +16 -11
  130. package/node_modules/tar/dist/esm/mkdir.js +119 -154
  131. package/node_modules/tar/dist/esm/normalize-unicode.js +9 -0
  132. package/node_modules/tar/dist/esm/options.d.ts +284 -513
  133. package/node_modules/tar/dist/esm/options.js +17 -51
  134. package/node_modules/tar/dist/esm/pack.d.ts +150 -96
  135. package/node_modules/tar/dist/esm/pack.js +750 -441
  136. package/node_modules/tar/dist/esm/parser.d.ts +98 -0
  137. package/node_modules/tar/dist/esm/parser.js +448 -0
  138. package/node_modules/tar/dist/esm/path-reservations.d.ts +17 -7
  139. package/node_modules/tar/dist/esm/path-reservations.js +110 -140
  140. package/node_modules/tar/dist/esm/path.d.ts +19 -0
  141. package/node_modules/tar/dist/esm/path.js +80 -0
  142. package/node_modules/tar/dist/esm/pax.d.ts +3 -1
  143. package/node_modules/tar/dist/esm/pax.js +66 -35
  144. package/node_modules/tar/dist/esm/read-entry.d.ts +97 -11
  145. package/node_modules/tar/dist/esm/read-entry.js +248 -96
  146. package/node_modules/tar/dist/esm/read-file.d.ts +22 -0
  147. package/node_modules/tar/dist/esm/read-file.js +99 -0
  148. package/node_modules/tar/dist/esm/replace.d.ts +45 -1
  149. package/node_modules/tar/dist/esm/replace.js +160 -207
  150. package/node_modules/tar/dist/esm/server/codecs.d.ts +38 -0
  151. package/node_modules/tar/dist/esm/server/codecs.js +214 -0
  152. package/node_modules/tar/dist/esm/server/index.d.ts +115 -0
  153. package/node_modules/tar/dist/esm/server/index.js +102 -0
  154. package/node_modules/tar/dist/esm/server/index.min.js +3 -0
  155. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +8 -0
  156. package/node_modules/tar/dist/esm/strip-absolute-path.js +17 -20
  157. package/node_modules/tar/dist/esm/to-stream.d.ts +7 -0
  158. package/node_modules/tar/dist/esm/to-stream.js +18 -0
  159. package/node_modules/tar/dist/esm/types.d.ts +4 -3
  160. package/node_modules/tar/dist/esm/types.js +4 -3
  161. package/node_modules/tar/dist/esm/unpack.d.ts +143 -89
  162. package/node_modules/tar/dist/esm/unpack.js +776 -719
  163. package/node_modules/tar/dist/esm/update.d.ts +11 -1
  164. package/node_modules/tar/dist/esm/update.js +35 -28
  165. package/node_modules/tar/dist/esm/warn.d.ts +27 -0
  166. package/node_modules/tar/dist/esm/warn.js +31 -0
  167. package/node_modules/tar/dist/esm/win32-path.d.ts +16 -0
  168. package/node_modules/tar/dist/esm/win32-path.js +60 -0
  169. package/node_modules/tar/dist/esm/write-entry.d.ts +64 -111
  170. package/node_modules/tar/dist/esm/write-entry.js +107 -633
  171. package/node_modules/tar/dist/esm/write-flag.d.ts +18 -0
  172. package/node_modules/tar/dist/esm/write-flag.js +25 -0
  173. package/node_modules/tar/package.json +68 -224
  174. package/package.json +2 -2
  175. package/packages/pm-beads/package.json +1 -1
  176. package/packages/pm-calendar/package.json +1 -1
  177. package/packages/pm-command-kit/package.json +1 -1
  178. package/packages/pm-digital-twin/package.json +1 -1
  179. package/packages/pm-governance-audit/package.json +1 -1
  180. package/packages/pm-guide-shell/package.json +1 -1
  181. package/packages/pm-kanban/package.json +1 -1
  182. package/packages/pm-lifecycle-hooks/package.json +1 -1
  183. package/packages/pm-linked-test-adapters/package.json +1 -1
  184. package/packages/pm-search-advanced/package.json +1 -1
  185. package/packages/pm-templates/package.json +1 -1
  186. package/packages/pm-todos/package.json +1 -1
  187. package/packages/pm-vcs/package.json +1 -1
  188. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  189. package/plugins/pm-claude/package.json +1 -1
  190. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  191. package/plugins/pm-codex/package.json +1 -1
  192. package/plugins/pm-codex/plugin.json +1 -1
  193. package/runtime-dependencies.json +1 -1
  194. package/dist/cli-bundle/chunks/chunk-AJLU6KLW.js +0 -2
  195. package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
  196. package/node_modules/@isaacs/fs-minipass/README.md +0 -71
  197. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
  198. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
  199. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
  200. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
  201. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
  202. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
  203. package/node_modules/@isaacs/fs-minipass/package.json +0 -72
  204. package/node_modules/chownr/LICENSE.md +0 -63
  205. package/node_modules/chownr/README.md +0 -3
  206. package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
  207. package/node_modules/chownr/dist/commonjs/index.js +0 -93
  208. package/node_modules/chownr/dist/commonjs/package.json +0 -3
  209. package/node_modules/chownr/dist/esm/index.d.ts +0 -3
  210. package/node_modules/chownr/dist/esm/index.js +0 -85
  211. package/node_modules/chownr/dist/esm/package.json +0 -3
  212. package/node_modules/chownr/package.json +0 -69
  213. package/node_modules/minipass/LICENSE.md +0 -55
  214. package/node_modules/minipass/README.md +0 -825
  215. package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
  216. package/node_modules/minipass/dist/commonjs/index.js +0 -1038
  217. package/node_modules/minipass/dist/commonjs/package.json +0 -3
  218. package/node_modules/minipass/dist/esm/index.d.ts +0 -545
  219. package/node_modules/minipass/dist/esm/index.js +0 -1020
  220. package/node_modules/minipass/dist/esm/package.json +0 -3
  221. package/node_modules/minipass/package.json +0 -77
  222. package/node_modules/minizlib/LICENSE +0 -26
  223. package/node_modules/minizlib/README.md +0 -64
  224. package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
  225. package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
  226. package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
  227. package/node_modules/minizlib/dist/commonjs/index.js +0 -416
  228. package/node_modules/minizlib/dist/commonjs/package.json +0 -3
  229. package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
  230. package/node_modules/minizlib/dist/esm/constants.js +0 -117
  231. package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
  232. package/node_modules/minizlib/dist/esm/index.js +0 -363
  233. package/node_modules/minizlib/dist/esm/package.json +0 -3
  234. package/node_modules/minizlib/package.json +0 -80
  235. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
  236. package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
  237. package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
  238. package/node_modules/tar/dist/commonjs/make-command.js +0 -52
  239. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
  240. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
  241. package/node_modules/tar/dist/commonjs/parse.d.ts +0 -92
  242. package/node_modules/tar/dist/commonjs/parse.js +0 -655
  243. package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
  244. package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
  245. package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
  246. package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
  247. package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
  248. package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
  249. package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
  250. package/node_modules/tar/dist/esm/make-command.js +0 -48
  251. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
  252. package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
  253. package/node_modules/tar/dist/esm/parse.d.ts +0 -92
  254. package/node_modules/tar/dist/esm/parse.js +0 -651
  255. package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
  256. package/node_modules/tar/dist/esm/process-umask.js +0 -3
  257. package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
  258. package/node_modules/tar/dist/esm/warn-method.js +0 -27
  259. package/node_modules/yallist/LICENSE.md +0 -63
  260. package/node_modules/yallist/README.md +0 -205
  261. package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
  262. package/node_modules/yallist/dist/commonjs/index.js +0 -384
  263. package/node_modules/yallist/dist/commonjs/package.json +0 -3
  264. package/node_modules/yallist/dist/esm/index.d.ts +0 -39
  265. package/node_modules/yallist/dist/esm/index.js +0 -379
  266. package/node_modules/yallist/dist/esm/package.json +0 -3
  267. package/node_modules/yallist/package.json +0 -68
@@ -1,2 +1,12 @@
1
- export declare const update: import("./make-command.js").TarCommand<never, never>;
1
+ import type { WithAliases } from './dealias.js';
2
+ import type { ReplaceOptions, ReplaceOptionsSync } from './options.js';
3
+ import type { PackInput, PackInputSync } from './pack.js';
4
+ /**
5
+ * The same as `replace`, but a file is added only if it is newer than
6
+ * the last entry of the archive that has its path. A directory is
7
+ * always added, and each path in it is checked.
8
+ */
9
+ export declare const update: (opt: WithAliases<ReplaceOptions>, files: PackInput[]) => Promise<void>;
10
+ /** The sync form of `update`. */
11
+ export declare const updateSync: (opt: WithAliases<ReplaceOptionsSync>, files: PackInputSync[]) => void;
2
12
  //# sourceMappingURL=update.d.ts.map
@@ -1,30 +1,37 @@
1
- // tar -u
2
- import { makeCommand } from './make-command.js';
3
- import { replace as r } from './replace.js';
4
- // just call tar.r with the filter and mtimeCache
5
- export const update = makeCommand(r.syncFile, r.asyncFile, r.syncNoFile, r.asyncNoFile, (opt, entries = []) => {
6
- r.validate?.(opt, entries);
7
- mtimeFilter(opt);
8
- });
9
- const mtimeFilter = (opt) => {
10
- const filter = opt.filter;
11
- if (!opt.mtimeCache) {
12
- opt.mtimeCache = new Map();
13
- }
14
- opt.filter =
15
- filter ?
16
- (path, stat) => filter(path, stat) &&
17
- !(
18
- /* c8 ignore start */
19
- ((opt.mtimeCache?.get(path) ?? stat.mtime ?? 0) >
20
- (stat.mtime ?? 0))
21
- /* c8 ignore stop */
22
- )
23
- : (path, stat) => !(
24
- /* c8 ignore start */
25
- ((opt.mtimeCache?.get(path) ?? stat.mtime ?? 0) >
26
- (stat.mtime ?? 0))
27
- /* c8 ignore stop */
28
- );
1
+ import { replace, replaceSync } from './replace.js';
2
+ // Add a filter that refuses a path that is not newer than the entry
3
+ // of the same path in the archive. The filter accepts each directory
4
+ // of the file system: a file in a directory can be newer than the
5
+ // directory, and the pack reads a directory only if it adds it.
6
+ // A ustar header has the time in whole seconds. A file is not newer
7
+ // than such an entry if only the part below one second differs.
8
+ const isNewer = (file, archived) => {
9
+ const a = archived.getTime();
10
+ const f = file.getTime();
11
+ return (a % 1000 === 0 ? f - (f % 1000) : f) > a;
29
12
  };
13
+ const newer = (opt) => {
14
+ const { filter } = opt;
15
+ const mtimeCache = opt.mtimeCache ?? new Map();
16
+ return {
17
+ ...opt,
18
+ mtimeCache,
19
+ filter: (path, entry) => {
20
+ if (filter && !filter(path, entry))
21
+ return false;
22
+ if ('isDirectory' in entry && entry.isDirectory())
23
+ return true;
24
+ const archived = mtimeCache.get(path);
25
+ return !archived || !entry.mtime || isNewer(entry.mtime, archived);
26
+ },
27
+ };
28
+ };
29
+ /**
30
+ * The same as `replace`, but a file is added only if it is newer than
31
+ * the last entry of the archive that has its path. A directory is
32
+ * always added, and each path in it is checked.
33
+ */
34
+ export const update = (opt, files) => replace(newer(opt), files);
35
+ /** The sync form of `update`. */
36
+ export const updateSync = (opt, files) => replaceSync(newer(opt), files);
30
37
  //# sourceMappingURL=update.js.map
@@ -0,0 +1,27 @@
1
+ /** Data that a warning or an error of this package carries. */
2
+ export type WarnData = {
3
+ file?: string;
4
+ code?: string;
5
+ tarCode?: string;
6
+ recoverable?: boolean;
7
+ [k: string]: unknown;
8
+ };
9
+ /** An error with the data of the warning that caused it. */
10
+ export type TarError = Error & WarnData;
11
+ /** The options that `warn` reads. */
12
+ export type WarnOptions = {
13
+ /** Throw each warning as an error. */
14
+ strict?: boolean;
15
+ /** Called for each warning when `strict` is not set. */
16
+ onwarn?: (code: string, message: string, data: WarnData) => unknown;
17
+ /** The archive file. Each warning has it as `data.file`. */
18
+ file?: string;
19
+ };
20
+ /** Make the error for a problem that is not recoverable. */
21
+ export declare const tarError: (opt: WarnOptions, code: string, message: string | Error, data?: WarnData) => TarError;
22
+ /**
23
+ * Report a problem. Call `opt.onwarn(code, message, data)`, or throw
24
+ * the error if `opt.strict` is set or `data.recoverable` is false.
25
+ */
26
+ export declare const warn: (opt: WarnOptions, code: string, message: string | Error, data?: WarnData) => void;
27
+ //# sourceMappingURL=warn.d.ts.map
@@ -0,0 +1,31 @@
1
+ // A message that is not a string is an error. The test is not
2
+ // `instanceof Error`, which is false for an error of a different
3
+ // realm, such as an error of `node:fs` in a `node:vm` context.
4
+ const fill = (opt, code, message, data) => {
5
+ if (opt.file)
6
+ data.file = opt.file;
7
+ data.code =
8
+ (typeof message === 'object' && message.code) || code;
9
+ data.tarCode = code;
10
+ return data;
11
+ };
12
+ /** Make the error for a problem that is not recoverable. */
13
+ export const tarError = (opt, code, message, data = {}) => Object.assign(typeof message === 'object' ? message : (new Error(`${code}: ${message}`)), fill(opt, code, message, data));
14
+ /**
15
+ * Report a problem. Call `opt.onwarn(code, message, data)`, or throw
16
+ * the error if `opt.strict` is set or `data.recoverable` is false.
17
+ */
18
+ export const warn = (opt, code, message, data = {}) => {
19
+ // The value of a changed `Object.prototype` does not count.
20
+ const fatal = Object.hasOwn(data, 'recoverable') && data.recoverable === false;
21
+ if (opt.strict || fatal) {
22
+ throw tarError(opt, code, message, data);
23
+ }
24
+ fill(opt, code, message, data);
25
+ if (typeof message === 'object') {
26
+ data = Object.assign(message, data);
27
+ message = message.message;
28
+ }
29
+ opt.onwarn?.(code, message, data);
30
+ };
31
+ //# sourceMappingURL=warn.js.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The root of a path: a slash, a drive such as `c:` or `c:/`, or a
3
+ * UNC root such as `//host/share/`. The same result as the `root` of
4
+ * `path.win32.parse`.
5
+ */
6
+ export declare const win32Root: (path: string) => string;
7
+ /** True for a path with a root that is not relative to a drive. */
8
+ export declare const win32IsAbsolute: (path: string) => boolean;
9
+ /**
10
+ * Resolve `path` from the absolute path `base`. Both have `/`
11
+ * separators.
12
+ */
13
+ export declare const win32Resolve: (base: string, path: string) => string;
14
+ /** The parent directory of an absolute path with `/` separators. */
15
+ export declare const win32Dirname: (path: string) => string;
16
+ //# sourceMappingURL=win32-path.d.ts.map
@@ -0,0 +1,60 @@
1
+ // The path rules of Windows that the extraction needs. Each function
2
+ // takes a path with `/` or `\` separators.
3
+ import { dirname, resolve } from './path.js';
4
+ const isSep = (code) => code === 47 || code === 92;
5
+ const isDrive = (code) => (code >= 65 && code <= 90) || (code >= 97 && code <= 122);
6
+ /**
7
+ * The root of a path: a slash, a drive such as `c:` or `c:/`, or a
8
+ * UNC root such as `//host/share/`. The same result as the `root` of
9
+ * `path.win32.parse`.
10
+ */
11
+ export const win32Root = (path) => {
12
+ const len = path.length;
13
+ let end = 0;
14
+ if (isSep(path.charCodeAt(0))) {
15
+ end = 1;
16
+ if (isSep(path.charCodeAt(1))) {
17
+ // `//host/share` and what follows it
18
+ let j = 2;
19
+ let last = j;
20
+ while (j < len && !isSep(path.charCodeAt(j)))
21
+ j++;
22
+ if (j < len && j !== last) {
23
+ last = j;
24
+ while (j < len && isSep(path.charCodeAt(j)))
25
+ j++;
26
+ if (j < len && j !== last) {
27
+ last = j;
28
+ while (j < len && !isSep(path.charCodeAt(j)))
29
+ j++;
30
+ if (j === len)
31
+ end = j;
32
+ else if (j !== last)
33
+ end = j + 1;
34
+ }
35
+ }
36
+ }
37
+ }
38
+ else if (isDrive(path.charCodeAt(0)) && path.charCodeAt(1) === 58) {
39
+ end = isSep(path.charCodeAt(2)) ? 3 : 2;
40
+ }
41
+ return path.slice(0, end);
42
+ };
43
+ /** True for a path with a root that is not relative to a drive. */
44
+ export const win32IsAbsolute = (path) => isSep(path.charCodeAt(0)) || win32Root(path).length === 3;
45
+ /**
46
+ * Resolve `path` from the absolute path `base`. Both have `/`
47
+ * separators.
48
+ */
49
+ export const win32Resolve = (base, path) => {
50
+ const full = win32IsAbsolute(path) ? path : base + '/' + path;
51
+ const root = win32Root(full);
52
+ return root + resolve('/', full.slice(root.length)).slice(1);
53
+ };
54
+ /** The parent directory of an absolute path with `/` separators. */
55
+ export const win32Dirname = (path) => {
56
+ const root = win32Root(path);
57
+ const dir = dirname(path.slice(root.length));
58
+ return dir === '.' ? root : root + dir;
59
+ };
60
+ //# sourceMappingURL=win32-path.js.map
@@ -1,129 +1,82 @@
1
- import { type Stats } from 'fs';
2
- import { Minipass } from 'minipass';
3
1
  import { Header } from './header.js';
4
- import type { TarOptions, TarOptionsWithAliases } from './options.js';
5
- import type { ReadEntry } from './read-entry.js';
6
2
  import type { EntryTypeName } from './types.js';
7
- import type { WarnData, Warner, WarnEvent } from './warn-method.js';
8
- declare const PROCESS: unique symbol;
9
- declare const FILE: unique symbol;
10
- declare const DIRECTORY: unique symbol;
11
- declare const SYMLINK: unique symbol;
12
- declare const HARDLINK: unique symbol;
13
- declare const HEADER: unique symbol;
14
- declare const READ: unique symbol;
15
- declare const LSTAT: unique symbol;
16
- declare const ONLSTAT: unique symbol;
17
- declare const ONREAD: unique symbol;
18
- declare const ONREADLINK: unique symbol;
19
- declare const OPENFILE: unique symbol;
20
- declare const ONOPENFILE: unique symbol;
21
- declare const CLOSE: unique symbol;
22
- declare const MODE: unique symbol;
23
- declare const AWAITDRAIN: unique symbol;
24
- declare const ONDRAIN: unique symbol;
25
- declare const PREFIX: unique symbol;
26
- export declare class WriteEntry extends Minipass<Buffer, Minipass.ContiguousData, WarnEvent> implements Warner {
27
- #private;
3
+ /**
4
+ * The content of a `WriteEntry`. `PackSync` takes only a string, a
5
+ * `Uint8Array`, or a sync iterable.
6
+ */
7
+ export type WriteBody = string | Uint8Array | Blob | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Iterable<Uint8Array>;
8
+ /** The metadata of a `WriteEntry`. A `ReadEntry` fits this type. */
9
+ export type WriteEntryData = {
28
10
  path: string;
29
- portable: boolean;
30
- myuid: number;
31
- myuser: string;
32
- maxReadSize: number;
33
- linkCache: Exclude<TarOptions['linkCache'], undefined>;
34
- statCache: Exclude<TarOptions['statCache'], undefined>;
35
- preservePaths: boolean;
36
- cwd: string;
37
- strict: boolean;
11
+ /** Default `'File'`. */
12
+ type?: EntryTypeName;
13
+ mode?: number;
14
+ uid?: number;
15
+ gid?: number;
16
+ uname?: string;
17
+ gname?: string;
18
+ /**
19
+ * The number of bytes in the body. Default: the length of a body
20
+ * that is a string, a `Uint8Array`, or a `Blob`.
21
+ */
22
+ size?: number;
38
23
  mtime?: Date;
39
- noPax: boolean;
40
- noMtime: boolean;
41
- prefix?: string;
42
- fd?: number;
43
- blockLen: number;
44
- blockRemain: number;
45
- buf?: Buffer;
46
- pos: number;
47
- remain: number;
48
- length: number;
49
- offset: number;
50
- win32: boolean;
51
- absolute: string;
52
- header?: Header;
53
- type?: EntryTypeName | 'Unsupported';
24
+ atime?: Date;
25
+ ctime?: Date;
54
26
  linkpath?: string;
55
- stat?: Stats;
56
- onWriteEntry?: (entry: WriteEntry) => unknown;
57
- constructor(p: string, opt_?: TarOptionsWithAliases);
58
- warn(code: string, message: string | Error, data?: WarnData): void;
59
- emit(ev: keyof WarnEvent, ...data: unknown[]): boolean;
60
- [LSTAT](): void;
61
- [ONLSTAT](stat: Stats): void;
62
- [PROCESS](): void | this;
63
- [MODE](mode: number): number;
64
- [PREFIX](path: string): string;
65
- [HEADER](): void;
66
- [DIRECTORY](): void;
67
- [SYMLINK](): void;
68
- [ONREADLINK](linkpath: string): void;
69
- [HARDLINK](linkpath: string): void;
70
- [FILE](): void | this;
71
- [OPENFILE](): void;
72
- [ONOPENFILE](fd: number): void;
73
- [READ](): void;
74
- [CLOSE](cb?: (er?: null | Error | NodeJS.ErrnoException) => unknown): void;
75
- [ONREAD](bytesRead: number): void;
76
- [AWAITDRAIN](cb: () => unknown): void;
77
- write(buffer: Buffer | string, cb?: () => void): boolean;
78
- write(str: Buffer | string, encoding?: BufferEncoding | null, cb?: () => void): boolean;
79
- [ONDRAIN](): void;
80
- }
81
- export declare class WriteEntrySync extends WriteEntry implements Warner {
82
- sync: true;
83
- [LSTAT](): void;
84
- [SYMLINK](): void;
85
- [OPENFILE](): void;
86
- [READ](): void;
87
- [AWAITDRAIN](cb: () => unknown): void;
88
- [CLOSE](cb?: (er?: null | Error | NodeJS.ErrnoException) => unknown): void;
89
- }
90
- export declare class WriteEntryTar extends Minipass<Buffer, Buffer | string, WarnEvent> implements Warner {
91
- blockLen: number;
92
- blockRemain: number;
93
- buf: number;
94
- pos: number;
95
- remain: number;
96
- length: number;
97
- preservePaths: boolean;
98
- portable: boolean;
99
- strict: boolean;
100
- noPax: boolean;
101
- noMtime: boolean;
102
- readEntry: ReadEntry;
103
- type: EntryTypeName;
27
+ dev?: number;
28
+ ino?: number;
29
+ nlink?: number;
30
+ };
31
+ /** The options of `WriteEntry.encode`. */
32
+ export type EncodeOptions = {
33
+ /** A directory to put before the path, and before a hard link target. */
104
34
  prefix?: string;
35
+ /** Write no PAX header for a field that does not fit the header. */
36
+ noPax?: boolean;
37
+ };
38
+ /**
39
+ * An entry to write to an archive, in the shape of a `Request`: the
40
+ * metadata is in the fields, and the content is `body`.
41
+ *
42
+ * A pack makes one for each path that it reads from the file system
43
+ * and for each entry that it copies from another archive. Make one
44
+ * with content from memory, and give it to `Pack.add()`.
45
+ *
46
+ * `onWriteEntry` gets the entry before its header is written, and can
47
+ * change each field.
48
+ */
49
+ export declare class WriteEntry {
105
50
  path: string;
51
+ type: EntryTypeName;
52
+ /** The permission bits only. */
106
53
  mode?: number;
107
54
  uid?: number;
108
55
  gid?: number;
109
56
  uname?: string;
110
57
  gname?: string;
111
- header?: Header;
58
+ /** The number of bytes in the body. The body must have this many. */
59
+ size: number;
112
60
  mtime?: Date;
113
61
  atime?: Date;
114
62
  ctime?: Date;
115
63
  linkpath?: string;
116
- size: number;
117
- onWriteEntry?: (entry: WriteEntry) => unknown;
118
- warn(code: string, message: string | Error, data?: WarnData): void;
119
- constructor(readEntry: ReadEntry, opt_?: TarOptionsWithAliases);
120
- [PREFIX](path: string): string;
121
- [MODE](mode: number): number;
122
- write(buffer: Buffer | string, cb?: () => void): boolean;
123
- write(str: Buffer | string, encoding?: BufferEncoding | null, cb?: () => void): boolean;
124
- end(cb?: () => void): this;
125
- end(chunk: Buffer | string, cb?: () => void): this;
126
- end(chunk: Buffer | string, encoding?: BufferEncoding, cb?: () => void): this;
64
+ dev?: number;
65
+ ino?: number;
66
+ nlink?: number;
67
+ /** The content. A string is kept as its UTF-8 bytes. */
68
+ body?: Exclude<WriteBody, string>;
69
+ /** The path of the file, for an entry that a pack read from a path. */
70
+ absolute?: string;
71
+ /** The header block, after `encode()`. */
72
+ header?: Header;
73
+ constructor(data: WriteEntryData, body?: WriteBody);
74
+ /**
75
+ * Make the header from the fields, and write it to the first 512
76
+ * bytes of `block`, which must be zeros. Returns the blocks to
77
+ * write before the body: `block`, and before it a PAX header entry
78
+ * if a field does not fit the header.
79
+ */
80
+ encode(opt?: EncodeOptions, block?: Uint8Array): Uint8Array[];
127
81
  }
128
- export {};
129
82
  //# sourceMappingURL=write-entry.d.ts.map