@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,420 +0,0 @@
1
- import EE from 'events';
2
- import fs from 'fs';
3
- import { Minipass } from 'minipass';
4
- const writev = fs.writev;
5
- const _autoClose = Symbol('_autoClose');
6
- const _close = Symbol('_close');
7
- const _ended = Symbol('_ended');
8
- const _fd = Symbol('_fd');
9
- const _finished = Symbol('_finished');
10
- const _flags = Symbol('_flags');
11
- const _flush = Symbol('_flush');
12
- const _handleChunk = Symbol('_handleChunk');
13
- const _makeBuf = Symbol('_makeBuf');
14
- const _mode = Symbol('_mode');
15
- const _needDrain = Symbol('_needDrain');
16
- const _onerror = Symbol('_onerror');
17
- const _onopen = Symbol('_onopen');
18
- const _onread = Symbol('_onread');
19
- const _onwrite = Symbol('_onwrite');
20
- const _open = Symbol('_open');
21
- const _path = Symbol('_path');
22
- const _pos = Symbol('_pos');
23
- const _queue = Symbol('_queue');
24
- const _read = Symbol('_read');
25
- const _readSize = Symbol('_readSize');
26
- const _reading = Symbol('_reading');
27
- const _remain = Symbol('_remain');
28
- const _size = Symbol('_size');
29
- const _write = Symbol('_write');
30
- const _writing = Symbol('_writing');
31
- const _defaultFlag = Symbol('_defaultFlag');
32
- const _errored = Symbol('_errored');
33
- export class ReadStream extends Minipass {
34
- [_errored] = false;
35
- [_fd];
36
- [_path];
37
- [_readSize];
38
- [_reading] = false;
39
- [_size];
40
- [_remain];
41
- [_autoClose];
42
- constructor(path, opt) {
43
- opt = opt || {};
44
- super(opt);
45
- this.readable = true;
46
- this.writable = false;
47
- if (typeof path !== 'string') {
48
- throw new TypeError('path must be a string');
49
- }
50
- this[_errored] = false;
51
- this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined;
52
- this[_path] = path;
53
- this[_readSize] = opt.readSize || 16 * 1024 * 1024;
54
- this[_reading] = false;
55
- this[_size] = typeof opt.size === 'number' ? opt.size : Infinity;
56
- this[_remain] = this[_size];
57
- this[_autoClose] =
58
- typeof opt.autoClose === 'boolean' ? opt.autoClose : true;
59
- if (typeof this[_fd] === 'number') {
60
- this[_read]();
61
- }
62
- else {
63
- this[_open]();
64
- }
65
- }
66
- get fd() {
67
- return this[_fd];
68
- }
69
- get path() {
70
- return this[_path];
71
- }
72
- //@ts-ignore
73
- write() {
74
- throw new TypeError('this is a readable stream');
75
- }
76
- //@ts-ignore
77
- end() {
78
- throw new TypeError('this is a readable stream');
79
- }
80
- [_open]() {
81
- fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd));
82
- }
83
- [_onopen](er, fd) {
84
- if (er) {
85
- this[_onerror](er);
86
- }
87
- else {
88
- this[_fd] = fd;
89
- this.emit('open', fd);
90
- this[_read]();
91
- }
92
- }
93
- [_makeBuf]() {
94
- return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]));
95
- }
96
- [_read]() {
97
- if (!this[_reading]) {
98
- this[_reading] = true;
99
- const buf = this[_makeBuf]();
100
- /* c8 ignore start */
101
- if (buf.length === 0) {
102
- return process.nextTick(() => this[_onread](null, 0, buf));
103
- }
104
- /* c8 ignore stop */
105
- fs.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b));
106
- }
107
- }
108
- [_onread](er, br, buf) {
109
- this[_reading] = false;
110
- if (er) {
111
- this[_onerror](er);
112
- }
113
- else if (this[_handleChunk](br, buf)) {
114
- this[_read]();
115
- }
116
- }
117
- [_close]() {
118
- if (this[_autoClose] && typeof this[_fd] === 'number') {
119
- const fd = this[_fd];
120
- this[_fd] = undefined;
121
- fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'));
122
- }
123
- }
124
- [_onerror](er) {
125
- this[_reading] = true;
126
- this[_close]();
127
- this.emit('error', er);
128
- }
129
- [_handleChunk](br, buf) {
130
- let ret = false;
131
- // no effect if infinite
132
- this[_remain] -= br;
133
- if (br > 0) {
134
- ret = super.write(br < buf.length ? buf.subarray(0, br) : buf);
135
- }
136
- if (br === 0 || this[_remain] <= 0) {
137
- ret = false;
138
- this[_close]();
139
- super.end();
140
- }
141
- return ret;
142
- }
143
- emit(ev, ...args) {
144
- switch (ev) {
145
- case 'prefinish':
146
- case 'finish':
147
- return false;
148
- case 'drain':
149
- if (typeof this[_fd] === 'number') {
150
- this[_read]();
151
- }
152
- return false;
153
- case 'error':
154
- if (this[_errored]) {
155
- return false;
156
- }
157
- this[_errored] = true;
158
- return super.emit(ev, ...args);
159
- default:
160
- return super.emit(ev, ...args);
161
- }
162
- }
163
- }
164
- export class ReadStreamSync extends ReadStream {
165
- [_open]() {
166
- let threw = true;
167
- try {
168
- this[_onopen](null, fs.openSync(this[_path], 'r'));
169
- threw = false;
170
- }
171
- finally {
172
- if (threw) {
173
- this[_close]();
174
- }
175
- }
176
- }
177
- [_read]() {
178
- let threw = true;
179
- try {
180
- if (!this[_reading]) {
181
- this[_reading] = true;
182
- do {
183
- const buf = this[_makeBuf]();
184
- /* c8 ignore start */
185
- const br = buf.length === 0
186
- ? 0
187
- : fs.readSync(this[_fd], buf, 0, buf.length, null);
188
- /* c8 ignore stop */
189
- if (!this[_handleChunk](br, buf)) {
190
- break;
191
- }
192
- } while (true);
193
- this[_reading] = false;
194
- }
195
- threw = false;
196
- }
197
- finally {
198
- if (threw) {
199
- this[_close]();
200
- }
201
- }
202
- }
203
- [_close]() {
204
- if (this[_autoClose] && typeof this[_fd] === 'number') {
205
- const fd = this[_fd];
206
- this[_fd] = undefined;
207
- fs.closeSync(fd);
208
- this.emit('close');
209
- }
210
- }
211
- }
212
- export class WriteStream extends EE {
213
- readable = false;
214
- writable = true;
215
- [_errored] = false;
216
- [_writing] = false;
217
- [_ended] = false;
218
- [_queue] = [];
219
- [_needDrain] = false;
220
- [_path];
221
- [_mode];
222
- [_autoClose];
223
- [_fd];
224
- [_defaultFlag];
225
- [_flags];
226
- [_finished] = false;
227
- [_pos];
228
- constructor(path, opt) {
229
- opt = opt || {};
230
- super(opt);
231
- this[_path] = path;
232
- this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined;
233
- this[_mode] = opt.mode === undefined ? 0o666 : opt.mode;
234
- this[_pos] = typeof opt.start === 'number' ? opt.start : undefined;
235
- this[_autoClose] =
236
- typeof opt.autoClose === 'boolean' ? opt.autoClose : true;
237
- // truncating makes no sense when writing into the middle
238
- const defaultFlag = this[_pos] !== undefined ? 'r+' : 'w';
239
- this[_defaultFlag] = opt.flags === undefined;
240
- this[_flags] = opt.flags === undefined ? defaultFlag : opt.flags;
241
- if (this[_fd] === undefined) {
242
- this[_open]();
243
- }
244
- }
245
- emit(ev, ...args) {
246
- if (ev === 'error') {
247
- if (this[_errored]) {
248
- return false;
249
- }
250
- this[_errored] = true;
251
- }
252
- return super.emit(ev, ...args);
253
- }
254
- get fd() {
255
- return this[_fd];
256
- }
257
- get path() {
258
- return this[_path];
259
- }
260
- [_onerror](er) {
261
- this[_close]();
262
- this[_writing] = true;
263
- this.emit('error', er);
264
- }
265
- [_open]() {
266
- fs.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd));
267
- }
268
- [_onopen](er, fd) {
269
- if (this[_defaultFlag] &&
270
- this[_flags] === 'r+' &&
271
- er &&
272
- er.code === 'ENOENT') {
273
- this[_flags] = 'w';
274
- this[_open]();
275
- }
276
- else if (er) {
277
- this[_onerror](er);
278
- }
279
- else {
280
- this[_fd] = fd;
281
- this.emit('open', fd);
282
- if (!this[_writing]) {
283
- this[_flush]();
284
- }
285
- }
286
- }
287
- end(buf, enc) {
288
- if (buf) {
289
- //@ts-ignore
290
- this.write(buf, enc);
291
- }
292
- this[_ended] = true;
293
- // synthetic after-write logic, where drain/finish live
294
- if (!this[_writing] &&
295
- !this[_queue].length &&
296
- typeof this[_fd] === 'number') {
297
- this[_onwrite](null, 0);
298
- }
299
- return this;
300
- }
301
- write(buf, enc) {
302
- if (typeof buf === 'string') {
303
- buf = Buffer.from(buf, enc);
304
- }
305
- if (this[_ended]) {
306
- this.emit('error', new Error('write() after end()'));
307
- return false;
308
- }
309
- if (this[_fd] === undefined || this[_writing] || this[_queue].length) {
310
- this[_queue].push(buf);
311
- this[_needDrain] = true;
312
- return false;
313
- }
314
- this[_writing] = true;
315
- this[_write](buf);
316
- return true;
317
- }
318
- [_write](buf) {
319
- fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw));
320
- }
321
- [_onwrite](er, bw) {
322
- if (er) {
323
- this[_onerror](er);
324
- }
325
- else {
326
- if (this[_pos] !== undefined && typeof bw === 'number') {
327
- this[_pos] += bw;
328
- }
329
- if (this[_queue].length) {
330
- this[_flush]();
331
- }
332
- else {
333
- this[_writing] = false;
334
- if (this[_ended] && !this[_finished]) {
335
- this[_finished] = true;
336
- this[_close]();
337
- this.emit('finish');
338
- }
339
- else if (this[_needDrain]) {
340
- this[_needDrain] = false;
341
- this.emit('drain');
342
- }
343
- }
344
- }
345
- }
346
- [_flush]() {
347
- if (this[_queue].length === 0) {
348
- if (this[_ended]) {
349
- this[_onwrite](null, 0);
350
- }
351
- }
352
- else if (this[_queue].length === 1) {
353
- this[_write](this[_queue].pop());
354
- }
355
- else {
356
- const iovec = this[_queue];
357
- this[_queue] = [];
358
- writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw));
359
- }
360
- }
361
- [_close]() {
362
- if (this[_autoClose] && typeof this[_fd] === 'number') {
363
- const fd = this[_fd];
364
- this[_fd] = undefined;
365
- fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'));
366
- }
367
- }
368
- }
369
- export class WriteStreamSync extends WriteStream {
370
- [_open]() {
371
- let fd;
372
- // only wrap in a try{} block if we know we'll retry, to avoid
373
- // the rethrow obscuring the error's source frame in most cases.
374
- if (this[_defaultFlag] && this[_flags] === 'r+') {
375
- try {
376
- fd = fs.openSync(this[_path], this[_flags], this[_mode]);
377
- }
378
- catch (er) {
379
- if (er?.code === 'ENOENT') {
380
- this[_flags] = 'w';
381
- return this[_open]();
382
- }
383
- else {
384
- throw er;
385
- }
386
- }
387
- }
388
- else {
389
- fd = fs.openSync(this[_path], this[_flags], this[_mode]);
390
- }
391
- this[_onopen](null, fd);
392
- }
393
- [_close]() {
394
- if (this[_autoClose] && typeof this[_fd] === 'number') {
395
- const fd = this[_fd];
396
- this[_fd] = undefined;
397
- fs.closeSync(fd);
398
- this.emit('close');
399
- }
400
- }
401
- [_write](buf) {
402
- // throw the original, but try to close if it fails
403
- let threw = true;
404
- try {
405
- this[_onwrite](null, fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos]));
406
- threw = false;
407
- }
408
- finally {
409
- if (threw) {
410
- try {
411
- this[_close]();
412
- }
413
- catch {
414
- // ok error
415
- }
416
- }
417
- }
418
- }
419
- }
420
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,72 +0,0 @@
1
- {
2
- "name": "@isaacs/fs-minipass",
3
- "version": "4.0.1",
4
- "main": "./dist/commonjs/index.js",
5
- "scripts": {
6
- "prepare": "tshy",
7
- "pretest": "npm run prepare",
8
- "test": "tap",
9
- "preversion": "npm test",
10
- "postversion": "npm publish",
11
- "prepublishOnly": "git push origin --follow-tags",
12
- "format": "prettier --write . --loglevel warn",
13
- "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
14
- },
15
- "keywords": [],
16
- "author": "Isaac Z. Schlueter",
17
- "license": "ISC",
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/npm/fs-minipass.git"
21
- },
22
- "description": "fs read and write streams based on minipass",
23
- "dependencies": {
24
- "minipass": "^7.0.4"
25
- },
26
- "devDependencies": {
27
- "@types/node": "^20.11.30",
28
- "mutate-fs": "^2.1.1",
29
- "prettier": "^3.2.5",
30
- "tap": "^18.7.1",
31
- "tshy": "^1.12.0",
32
- "typedoc": "^0.25.12"
33
- },
34
- "files": [
35
- "dist"
36
- ],
37
- "engines": {
38
- "node": ">=18.0.0"
39
- },
40
- "tshy": {
41
- "exports": {
42
- "./package.json": "./package.json",
43
- ".": "./src/index.ts"
44
- }
45
- },
46
- "exports": {
47
- "./package.json": "./package.json",
48
- ".": {
49
- "import": {
50
- "types": "./dist/esm/index.d.ts",
51
- "default": "./dist/esm/index.js"
52
- },
53
- "require": {
54
- "types": "./dist/commonjs/index.d.ts",
55
- "default": "./dist/commonjs/index.js"
56
- }
57
- }
58
- },
59
- "types": "./dist/commonjs/index.d.ts",
60
- "type": "module",
61
- "prettier": {
62
- "semi": false,
63
- "printWidth": 75,
64
- "tabWidth": 2,
65
- "useTabs": false,
66
- "singleQuote": true,
67
- "jsxSingleQuote": false,
68
- "bracketSameLine": true,
69
- "arrowParens": "avoid",
70
- "endOfLine": "lf"
71
- }
72
- }
@@ -1,63 +0,0 @@
1
- All packages under `src/` are licensed according to the terms in
2
- their respective `LICENSE` or `LICENSE.md` files.
3
-
4
- The remainder of this project is licensed under the Blue Oak
5
- Model License, as follows:
6
-
7
- -----
8
-
9
- # Blue Oak Model License
10
-
11
- Version 1.0.0
12
-
13
- ## Purpose
14
-
15
- This license gives everyone as much permission to work with
16
- this software as possible, while protecting contributors
17
- from liability.
18
-
19
- ## Acceptance
20
-
21
- In order to receive this license, you must agree to its
22
- rules. The rules of this license are both obligations
23
- under that agreement and conditions to your license.
24
- You must not do anything with this software that triggers
25
- a rule that you cannot or will not follow.
26
-
27
- ## Copyright
28
-
29
- Each contributor licenses you to do everything with this
30
- software that would otherwise infringe that contributor's
31
- copyright in it.
32
-
33
- ## Notices
34
-
35
- You must ensure that everyone who gets a copy of
36
- any part of this software from you, with or without
37
- changes, also gets the text of this license or a link to
38
- <https://blueoakcouncil.org/license/1.0.0>.
39
-
40
- ## Excuse
41
-
42
- If anyone notifies you in writing that you have not
43
- complied with [Notices](#notices), you can keep your
44
- license by taking all practical steps to comply within 30
45
- days after the notice. If you do not do so, your license
46
- ends immediately.
47
-
48
- ## Patent
49
-
50
- Each contributor licenses you to do everything with this
51
- software that would otherwise infringe any patent claims
52
- they can license or become able to license.
53
-
54
- ## Reliability
55
-
56
- No contributor can revoke this license.
57
-
58
- ## No Liability
59
-
60
- ***As far as the law allows, this software comes as is,
61
- without any warranty or condition, and no contributor
62
- will be liable to anyone for any damages related to this
63
- software or this license, under any kind of legal claim.***
@@ -1,3 +0,0 @@
1
- Like `chown -R`.
2
-
3
- Takes the same arguments as `fs.chown()`
@@ -1,3 +0,0 @@
1
- export declare const chownr: (p: string, uid: number, gid: number, cb: (er?: unknown) => any) => void;
2
- export declare const chownrSync: (p: string, uid: number, gid: number) => void;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,93 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.chownrSync = exports.chownr = void 0;
7
- const node_fs_1 = __importDefault(require("node:fs"));
8
- const node_path_1 = __importDefault(require("node:path"));
9
- const lchownSync = (path, uid, gid) => {
10
- try {
11
- return node_fs_1.default.lchownSync(path, uid, gid);
12
- }
13
- catch (er) {
14
- if (er?.code !== 'ENOENT')
15
- throw er;
16
- }
17
- };
18
- const chown = (cpath, uid, gid, cb) => {
19
- node_fs_1.default.lchown(cpath, uid, gid, er => {
20
- // Skip ENOENT error
21
- cb(er && er?.code !== 'ENOENT' ? er : null);
22
- });
23
- };
24
- const chownrKid = (p, child, uid, gid, cb) => {
25
- if (child.isDirectory()) {
26
- (0, exports.chownr)(node_path_1.default.resolve(p, child.name), uid, gid, (er) => {
27
- if (er)
28
- return cb(er);
29
- const cpath = node_path_1.default.resolve(p, child.name);
30
- chown(cpath, uid, gid, cb);
31
- });
32
- }
33
- else {
34
- const cpath = node_path_1.default.resolve(p, child.name);
35
- chown(cpath, uid, gid, cb);
36
- }
37
- };
38
- const chownr = (p, uid, gid, cb) => {
39
- node_fs_1.default.readdir(p, { withFileTypes: true }, (er, children) => {
40
- // any error other than ENOTDIR or ENOTSUP means it's not readable,
41
- // or doesn't exist. give up.
42
- if (er) {
43
- if (er.code === 'ENOENT')
44
- return cb();
45
- else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
46
- return cb(er);
47
- }
48
- if (er || !children.length)
49
- return chown(p, uid, gid, cb);
50
- let len = children.length;
51
- let errState = null;
52
- const then = (er) => {
53
- /* c8 ignore start */
54
- if (errState)
55
- return;
56
- /* c8 ignore stop */
57
- if (er)
58
- return cb((errState = er));
59
- if (--len === 0)
60
- return chown(p, uid, gid, cb);
61
- };
62
- for (const child of children) {
63
- chownrKid(p, child, uid, gid, then);
64
- }
65
- });
66
- };
67
- exports.chownr = chownr;
68
- const chownrKidSync = (p, child, uid, gid) => {
69
- if (child.isDirectory())
70
- (0, exports.chownrSync)(node_path_1.default.resolve(p, child.name), uid, gid);
71
- lchownSync(node_path_1.default.resolve(p, child.name), uid, gid);
72
- };
73
- const chownrSync = (p, uid, gid) => {
74
- let children;
75
- try {
76
- children = node_fs_1.default.readdirSync(p, { withFileTypes: true });
77
- }
78
- catch (er) {
79
- const e = er;
80
- if (e?.code === 'ENOENT')
81
- return;
82
- else if (e?.code === 'ENOTDIR' || e?.code === 'ENOTSUP')
83
- return lchownSync(p, uid, gid);
84
- else
85
- throw e;
86
- }
87
- for (const child of children) {
88
- chownrKidSync(p, child, uid, gid);
89
- }
90
- return lchownSync(p, uid, gid);
91
- };
92
- exports.chownrSync = chownrSync;
93
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,3 +0,0 @@
1
- export declare const chownr: (p: string, uid: number, gid: number, cb: (er?: unknown) => any) => void;
2
- export declare const chownrSync: (p: string, uid: number, gid: number) => void;
3
- //# sourceMappingURL=index.d.ts.map