@poe-platform/safe-bash 0.1.673 → 0.1.675

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 (94) hide show
  1. package/dist/safe-bash/chunks/{bz2-IHIZQMGV.js → bz2-GFOVKOE2.js} +2 -2
  2. package/dist/safe-bash/chunks/{chunk-EQQUSBQL.js → chunk-3CSVGCNG.js} +8 -8
  3. package/dist/safe-bash/chunks/{chunk-J3KNDY7M.js → chunk-3G3EZZ63.js} +2 -2
  4. package/dist/safe-bash/chunks/{chunk-JN25474T.js → chunk-6N3NP45C.js} +2 -2
  5. package/dist/safe-bash/chunks/{chunk-QYWBN35Y.js → chunk-6R7IR2MV.js} +9 -9
  6. package/dist/safe-bash/chunks/{chunk-FBDSXZ2K.js → chunk-7KY55OSN.js} +6 -6
  7. package/dist/safe-bash/chunks/{chunk-CMXB2KEU.js → chunk-ADKIY2N6.js} +8 -8
  8. package/dist/safe-bash/chunks/{chunk-3Y7MJXHG.js → chunk-AJMYOERL.js} +8 -8
  9. package/dist/safe-bash/chunks/{chunk-4FOLIMDG.js → chunk-AMEBMTDV.js} +2 -2
  10. package/dist/safe-bash/chunks/{chunk-JFAGVXK4.js → chunk-CXOGU5FI.js} +2 -2
  11. package/dist/safe-bash/chunks/{chunk-JAZIACHR.js → chunk-CYHOHFST.js} +2 -2
  12. package/dist/safe-bash/chunks/{chunk-BRSXHYVB.js → chunk-FAPYXUJX.js} +2 -2
  13. package/dist/safe-bash/chunks/{chunk-HHA6W63G.js → chunk-FZ4N3GXF.js} +8 -8
  14. package/dist/safe-bash/chunks/{chunk-V62VGSQE.js → chunk-GXY5T7FE.js} +9 -9
  15. package/dist/safe-bash/chunks/{chunk-W4HGKCDM.js → chunk-IVMNRAZQ.js} +9 -9
  16. package/dist/safe-bash/chunks/{chunk-B62IHTWU.js → chunk-JDH27I5L.js} +7 -7
  17. package/dist/safe-bash/chunks/{chunk-ENWBYBE5.js → chunk-JFQCOS4H.js} +3 -3
  18. package/dist/safe-bash/chunks/{chunk-G6NUMAWB.js → chunk-MH7USUFB.js} +6 -6
  19. package/dist/safe-bash/chunks/{chunk-CBI5DWCN.js → chunk-O4SKIJ5J.js} +1 -1
  20. package/dist/safe-bash/chunks/{chunk-CBI5DWCN.js.map → chunk-O4SKIJ5J.js.map} +1 -1
  21. package/dist/safe-bash/chunks/{chunk-AYSSIJJN.js → chunk-Q6FBCQOS.js} +5 -5
  22. package/dist/safe-bash/chunks/{chunk-PU6UAMLP.js → chunk-REGMDUIG.js} +7 -7
  23. package/dist/safe-bash/chunks/{chunk-FMPZXGZX.js → chunk-RPZQ4UUC.js} +6 -6
  24. package/dist/safe-bash/chunks/{chunk-Q3BPIW36.js → chunk-RZXOHP7M.js} +8 -8
  25. package/dist/safe-bash/chunks/{chunk-HUF6AIWZ.js → chunk-TJJ3M2PO.js} +4 -4
  26. package/dist/safe-bash/chunks/{chunk-4GS3VKVN.js → chunk-URHHMYD3.js} +2 -2
  27. package/dist/safe-bash/chunks/{chunk-CL3DDB37.js → chunk-YSWBQWQ4.js} +8 -8
  28. package/dist/safe-bash/chunks/{chunk-EW3TYPG2.js → chunk-ZAH7KZHM.js} +8 -8
  29. package/dist/safe-bash/chunks/{chunk-5LGU452F.js → chunk-ZBJOE26D.js} +3 -3
  30. package/dist/safe-bash/chunks/{chunk-E72YNOKL.js → chunk-ZDYA3SLF.js} +3 -3
  31. package/dist/safe-bash/chunks/{xz-ZQAJM52W.js → xz-JNAU6ET3.js} +2 -2
  32. package/dist/safe-bash/chunks/{zstd-2EW5DYSH.js → zstd-ATGZPMKA.js} +2 -2
  33. package/dist/safe-bash/commands/archive/zip/help.d.ts +1 -1
  34. package/dist/safe-bash/commands/archive/zip/help.d.ts.map +1 -1
  35. package/dist/safe-bash/commands/archive/zip/help.js +2 -1
  36. package/dist/safe-bash/commands/archive/zip/help.js.map +1 -1
  37. package/dist/safe-bash/commands/archive/zip/safety.d.ts +3 -0
  38. package/dist/safe-bash/commands/archive/zip/safety.d.ts.map +1 -1
  39. package/dist/safe-bash/commands/archive/zip/safety.js +63 -1
  40. package/dist/safe-bash/commands/archive/zip/safety.js.map +1 -1
  41. package/dist/safe-bash/commands/archive/zip.d.ts.map +1 -1
  42. package/dist/safe-bash/commands/archive/zip.js +8 -7
  43. package/dist/safe-bash/commands/archive/zip.js.map +1 -1
  44. package/dist/safe-bash/commands/csplit/index.browser.js +10 -10
  45. package/dist/safe-bash/commands/docx/index.browser.js +2 -2
  46. package/dist/safe-bash/commands/factor/index.browser.js +7 -7
  47. package/dist/safe-bash/commands/getopt/index.browser.js +7 -7
  48. package/dist/safe-bash/commands/hexdump/index.browser.js +8 -8
  49. package/dist/safe-bash/commands/iconv/index.browser.js +8 -8
  50. package/dist/safe-bash/commands/line-endings/index.browser.js +10 -10
  51. package/dist/safe-bash/commands/llm/index.browser.js +10 -10
  52. package/dist/safe-bash/commands/llm/providers/index.browser.js +3 -3
  53. package/dist/safe-bash/commands/network/index.browser.js +11 -11
  54. package/dist/safe-bash/commands/node/index.browser.js +8 -8
  55. package/dist/safe-bash/commands/op/index.browser.js +3 -3
  56. package/dist/safe-bash/commands/pr/index.browser.js +8 -8
  57. package/dist/safe-bash/commands/python/index.browser.js +9 -9
  58. package/dist/safe-bash/commands/python/worker.browser.js +2 -2
  59. package/dist/safe-bash/commands/tsort/index.browser.js +8 -8
  60. package/dist/safe-bash/commands/xml/index.browser.js +9 -9
  61. package/dist/safe-bash/commands/yq/index.browser.js +10 -10
  62. package/dist/safe-bash/core.browser.js +98 -42
  63. package/dist/safe-bash/core.browser.js.map +3 -3
  64. package/package.json +2 -2
  65. /package/dist/safe-bash/chunks/{bz2-IHIZQMGV.js.map → bz2-GFOVKOE2.js.map} +0 -0
  66. /package/dist/safe-bash/chunks/{chunk-EQQUSBQL.js.map → chunk-3CSVGCNG.js.map} +0 -0
  67. /package/dist/safe-bash/chunks/{chunk-J3KNDY7M.js.map → chunk-3G3EZZ63.js.map} +0 -0
  68. /package/dist/safe-bash/chunks/{chunk-JN25474T.js.map → chunk-6N3NP45C.js.map} +0 -0
  69. /package/dist/safe-bash/chunks/{chunk-QYWBN35Y.js.map → chunk-6R7IR2MV.js.map} +0 -0
  70. /package/dist/safe-bash/chunks/{chunk-FBDSXZ2K.js.map → chunk-7KY55OSN.js.map} +0 -0
  71. /package/dist/safe-bash/chunks/{chunk-CMXB2KEU.js.map → chunk-ADKIY2N6.js.map} +0 -0
  72. /package/dist/safe-bash/chunks/{chunk-3Y7MJXHG.js.map → chunk-AJMYOERL.js.map} +0 -0
  73. /package/dist/safe-bash/chunks/{chunk-4FOLIMDG.js.map → chunk-AMEBMTDV.js.map} +0 -0
  74. /package/dist/safe-bash/chunks/{chunk-JFAGVXK4.js.map → chunk-CXOGU5FI.js.map} +0 -0
  75. /package/dist/safe-bash/chunks/{chunk-JAZIACHR.js.map → chunk-CYHOHFST.js.map} +0 -0
  76. /package/dist/safe-bash/chunks/{chunk-BRSXHYVB.js.map → chunk-FAPYXUJX.js.map} +0 -0
  77. /package/dist/safe-bash/chunks/{chunk-HHA6W63G.js.map → chunk-FZ4N3GXF.js.map} +0 -0
  78. /package/dist/safe-bash/chunks/{chunk-V62VGSQE.js.map → chunk-GXY5T7FE.js.map} +0 -0
  79. /package/dist/safe-bash/chunks/{chunk-W4HGKCDM.js.map → chunk-IVMNRAZQ.js.map} +0 -0
  80. /package/dist/safe-bash/chunks/{chunk-B62IHTWU.js.map → chunk-JDH27I5L.js.map} +0 -0
  81. /package/dist/safe-bash/chunks/{chunk-ENWBYBE5.js.map → chunk-JFQCOS4H.js.map} +0 -0
  82. /package/dist/safe-bash/chunks/{chunk-G6NUMAWB.js.map → chunk-MH7USUFB.js.map} +0 -0
  83. /package/dist/safe-bash/chunks/{chunk-AYSSIJJN.js.map → chunk-Q6FBCQOS.js.map} +0 -0
  84. /package/dist/safe-bash/chunks/{chunk-PU6UAMLP.js.map → chunk-REGMDUIG.js.map} +0 -0
  85. /package/dist/safe-bash/chunks/{chunk-FMPZXGZX.js.map → chunk-RPZQ4UUC.js.map} +0 -0
  86. /package/dist/safe-bash/chunks/{chunk-Q3BPIW36.js.map → chunk-RZXOHP7M.js.map} +0 -0
  87. /package/dist/safe-bash/chunks/{chunk-HUF6AIWZ.js.map → chunk-TJJ3M2PO.js.map} +0 -0
  88. /package/dist/safe-bash/chunks/{chunk-4GS3VKVN.js.map → chunk-URHHMYD3.js.map} +0 -0
  89. /package/dist/safe-bash/chunks/{chunk-CL3DDB37.js.map → chunk-YSWBQWQ4.js.map} +0 -0
  90. /package/dist/safe-bash/chunks/{chunk-EW3TYPG2.js.map → chunk-ZAH7KZHM.js.map} +0 -0
  91. /package/dist/safe-bash/chunks/{chunk-5LGU452F.js.map → chunk-ZBJOE26D.js.map} +0 -0
  92. /package/dist/safe-bash/chunks/{chunk-E72YNOKL.js.map → chunk-ZDYA3SLF.js.map} +0 -0
  93. /package/dist/safe-bash/chunks/{xz-ZQAJM52W.js.map → xz-JNAU6ET3.js.map} +0 -0
  94. /package/dist/safe-bash/chunks/{zstd-2EW5DYSH.js.map → zstd-ATGZPMKA.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_platform
3
- } from "./chunk-CBI5DWCN.js";
3
+ } from "./chunk-O4SKIJ5J.js";
4
4
 
5
5
  // packages/safe-bash/src/contracts/errors.ts
6
6
  init_platform();
@@ -440,4 +440,4 @@ export {
440
440
  readBytes2 as readBytes,
441
441
  toByteSource
442
442
  };
443
- //# sourceMappingURL=chunk-4GS3VKVN.js.map
443
+ //# sourceMappingURL=chunk-URHHMYD3.js.map
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  createOutputOperation
3
- } from "./chunk-E72YNOKL.js";
3
+ } from "./chunk-ZDYA3SLF.js";
4
4
  import {
5
5
  PublicDiagnostic
6
- } from "./chunk-HUF6AIWZ.js";
6
+ } from "./chunk-TJJ3M2PO.js";
7
7
  import {
8
8
  yieldTurn
9
- } from "./chunk-JN25474T.js";
9
+ } from "./chunk-6N3NP45C.js";
10
10
  import {
11
11
  getCommandArguments,
12
12
  shellValueByteLength,
13
13
  shellValueBytes
14
- } from "./chunk-JAZIACHR.js";
14
+ } from "./chunk-CYHOHFST.js";
15
15
  import {
16
16
  resolvePath
17
- } from "./chunk-4FOLIMDG.js";
17
+ } from "./chunk-AMEBMTDV.js";
18
18
  import {
19
19
  FsError,
20
20
  outputFailure
21
- } from "./chunk-4GS3VKVN.js";
21
+ } from "./chunk-URHHMYD3.js";
22
22
  import {
23
23
  init_platform
24
- } from "./chunk-CBI5DWCN.js";
24
+ } from "./chunk-O4SKIJ5J.js";
25
25
 
26
26
  // packages/safe-bash/src/commands/hexdump/index.ts
27
27
  init_platform();
@@ -701,4 +701,4 @@ export {
701
701
  createHexdumpCommands,
702
702
  hexdumpCommands
703
703
  };
704
- //# sourceMappingURL=chunk-CL3DDB37.js.map
704
+ //# sourceMappingURL=chunk-YSWBQWQ4.js.map
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  writeFileOutput
3
- } from "./chunk-AYSSIJJN.js";
3
+ } from "./chunk-Q6FBCQOS.js";
4
4
  import {
5
5
  PublicDiagnostic,
6
6
  publicDiagnosticMessage
7
- } from "./chunk-HUF6AIWZ.js";
7
+ } from "./chunk-TJJ3M2PO.js";
8
8
  import {
9
9
  yieldTurn
10
- } from "./chunk-JN25474T.js";
10
+ } from "./chunk-6N3NP45C.js";
11
11
  import {
12
12
  getCommandArguments,
13
13
  shellValueByteLength,
14
14
  shellValueBytes
15
- } from "./chunk-JAZIACHR.js";
15
+ } from "./chunk-CYHOHFST.js";
16
16
  import {
17
17
  dirname,
18
18
  resolvePath
19
- } from "./chunk-4FOLIMDG.js";
19
+ } from "./chunk-AMEBMTDV.js";
20
20
  import {
21
21
  FsError,
22
22
  writeBytes
23
- } from "./chunk-4GS3VKVN.js";
23
+ } from "./chunk-URHHMYD3.js";
24
24
  import {
25
25
  init_platform
26
- } from "./chunk-CBI5DWCN.js";
26
+ } from "./chunk-O4SKIJ5J.js";
27
27
 
28
28
  // packages/safe-bash/src/commands/csplit/index.ts
29
29
  init_platform();
@@ -12160,4 +12160,4 @@ export {
12160
12160
  createCsplitCommands,
12161
12161
  csplitCommands
12162
12162
  };
12163
- //# sourceMappingURL=chunk-EW3TYPG2.js.map
12163
+ //# sourceMappingURL=chunk-ZAH7KZHM.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  FsError
3
- } from "./chunk-4GS3VKVN.js";
3
+ } from "./chunk-URHHMYD3.js";
4
4
  import {
5
5
  init_platform
6
- } from "./chunk-CBI5DWCN.js";
6
+ } from "./chunk-O4SKIJ5J.js";
7
7
 
8
8
  // packages/safe-bash/src/contracts/filesystem-descriptor.ts
9
9
  init_platform();
@@ -236,4 +236,4 @@ export {
236
236
  bindFileOutputBudget,
237
237
  openCommandFile
238
238
  };
239
- //# sourceMappingURL=chunk-5LGU452F.js.map
239
+ //# sourceMappingURL=chunk-ZBJOE26D.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  outputFailure,
3
3
  writeBytes
4
- } from "./chunk-4GS3VKVN.js";
4
+ } from "./chunk-URHHMYD3.js";
5
5
  import {
6
6
  init_platform
7
- } from "./chunk-CBI5DWCN.js";
7
+ } from "./chunk-O4SKIJ5J.js";
8
8
 
9
9
  // packages/safe-bash/src/contracts/output.ts
10
10
  init_platform();
@@ -148,4 +148,4 @@ function createOutputOperation(context, destination) {
148
148
  export {
149
149
  createOutputOperation
150
150
  };
151
- //# sourceMappingURL=chunk-E72YNOKL.js.map
151
+ //# sourceMappingURL=chunk-ZDYA3SLF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_platform
3
- } from "./chunk-CBI5DWCN.js";
3
+ } from "./chunk-O4SKIJ5J.js";
4
4
 
5
5
  // packages/safe-bash/src/commands/bytes/compression/native/generated/xz.mjs
6
6
  init_platform();
@@ -6080,4 +6080,4 @@ export {
6080
6080
  E8 as default
6081
6081
  };
6082
6082
  /*! Native codec: xz v5.8.3. See ../LICENSES.txt and ../sources.json. */
6083
- //# sourceMappingURL=xz-ZQAJM52W.js.map
6083
+ //# sourceMappingURL=xz-JNAU6ET3.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_platform
3
- } from "./chunk-CBI5DWCN.js";
3
+ } from "./chunk-O4SKIJ5J.js";
4
4
 
5
5
  // packages/safe-bash/src/commands/bytes/compression/native/generated/zstd.mjs
6
6
  init_platform();
@@ -27107,4 +27107,4 @@ export {
27107
27107
  b4 as default
27108
27108
  };
27109
27109
  /*! Native codec: zstd v1.5.7. See ../LICENSES.txt and ../sources.json. */
27110
- //# sourceMappingURL=zstd-2EW5DYSH.js.map
27110
+ //# sourceMappingURL=zstd-ATGZPMKA.js.map
@@ -1,5 +1,5 @@
1
1
  export declare const zipHelp = "safe-bash zip\nUsage: zip [options] archive [file ...]\n zip [options] - [file ...] write an archive to stdout\n zip [options] archive - read a member from stdin\n\n -r recurse into directories\n -j store basenames, discarding directory paths\n -q suppress progress messages\n -0 store without compression\n -1 .. -9 select compression effort\n -Z METHOD select store, deflate, bzip2, or lzma compression\n --encryption PROFILE select zipcrypto or aes-{128,192,256}-ae{1,2}\n -n SUFFIXES store matching suffixes (colon-separated)\n -u / -f update / freshen existing members\n -d / -U delete / copy selected archive members\n -FS synchronize selected members with filesystem sources\n -O FILE write to a separate output archive\n -A adjust validated SFX offsets, retaining the inert prefix\n -F / -FF repair from central / local records (requires -O FILE)\n -s SIZE split into .z01/.z02/.../.zip volumes (minimum 64k; 0 recombines)\n -sp approve volume transitions using an explicit host prompt\n -sv / -sb report split volumes / ring before a split-pause prompt\n -m remove archived sources after successful publication\n -D / -y omit directory entries / store symlinks\n -i / -x include / exclude matching names\n -RE enable bracket-list glob matching (already enabled on Unix)\n -k convert new source names to portable ASCII DOS 8.3 names\n -FI / -FI- enable / disable explicit VFS FIFO byte sources\n -@ read filenames from stdin\n -t / -tt select files from / before a date\n -T test archive integrity before replacement\n -P PASSWORD encrypt new members with a supplied password\n -e request and confirm a password through a no-echo host capability\n -z / -c read archive / entry comments from stdin\n -o set archive time to the latest member time\n -l convert text LF line endings to CRLF\n -ll convert text CRLF line endings to LF (--from-crlf)\n -X strip optional metadata\n -fz / -fz- force / disable ZIP64 output\n -fd force data descriptors\n -v verbose operation (a lone -v shows implementation information)\n --version show implementation information and exit\n -L show this implementation's license\n -sf / -sf- list selected files / totals only, without creating an archive\n -sc show processed arguments and exit with status 9\n -so show implemented options and exit\n -sd show virtual archive processing steps\n -db / -dc display byte / entry counters\n -du / -dv display entry size / single-volume numbers\n -dd / -dg display dots per entry / globally for output bytes\n -ds SIZE dot interval (kmgt units; default MB; 0 disables dots)\n -h show this help\n\nUse -- after the archive name to pass filenames beginning with '-'.\nLong option equivalents are accepted, for example --junk-paths and\n--compression-method=bzip2. All filesystem operations use the virtual filesystem.\n";
2
- export declare const zipExtendedHelp = "safe-bash zip\nUsage: zip [options] archive [file ...]\n zip [options] - [file ...] write an archive to stdout\n zip [options] archive - read a member from stdin\n\n -r recurse into directories\n -j store basenames, discarding directory paths\n -q suppress progress messages\n -0 store without compression\n -1 .. -9 select compression effort\n -Z METHOD select store, deflate, bzip2, or lzma compression\n --encryption PROFILE select zipcrypto or aes-{128,192,256}-ae{1,2}\n -n SUFFIXES store matching suffixes (colon-separated)\n -u / -f update / freshen existing members\n -d / -U delete / copy selected archive members\n -FS synchronize selected members with filesystem sources\n -O FILE write to a separate output archive\n -A adjust validated SFX offsets, retaining the inert prefix\n -F / -FF repair from central / local records (requires -O FILE)\n -s SIZE split into .z01/.z02/.../.zip volumes (minimum 64k; 0 recombines)\n -sp approve volume transitions using an explicit host prompt\n -sv / -sb report split volumes / ring before a split-pause prompt\n -m remove archived sources after successful publication\n -D / -y omit directory entries / store symlinks\n -i / -x include / exclude matching names\n -RE enable bracket-list glob matching (already enabled on Unix)\n -k convert new source names to portable ASCII DOS 8.3 names\n -FI / -FI- enable / disable explicit VFS FIFO byte sources\n -@ read filenames from stdin\n -t / -tt select files from / before a date\n -T test archive integrity before replacement\n -P PASSWORD encrypt new members with a supplied password\n -e request and confirm a password through a no-echo host capability\n -z / -c read archive / entry comments from stdin\n -o set archive time to the latest member time\n -l convert text LF line endings to CRLF\n -ll convert text CRLF line endings to LF (--from-crlf)\n -X strip optional metadata\n -fz / -fz- force / disable ZIP64 output\n -fd force data descriptors\n -v verbose operation (a lone -v shows implementation information)\n --version show implementation information and exit\n -L show this implementation's license\n -sf / -sf- list selected files / totals only, without creating an archive\n -sc show processed arguments and exit with status 9\n -so show implemented options and exit\n -sd show virtual archive processing steps\n -db / -dc display byte / entry counters\n -du / -dv display entry size / single-volume numbers\n -dd / -dg display dots per entry / globally for output bytes\n -ds SIZE dot interval (kmgt units; default MB; 0 disables dots)\n -h show this help\n\nUse -- after the archive name to pass filenames beginning with '-'.\nLong option equivalents are accepted, for example --junk-paths and\n--compression-method=bzip2. All filesystem operations use the virtual filesystem.\n\nSelection\n -RE / --regex means bracket lists, not general regular expressions.\n -k / --DOS-names converts components after selection and -j; collisions fail.\n DOS conversion is restricted to printable ASCII. Filters parsed after -k\n are DOS-converted before matching original case-sensitive source names.\n -FI / --fifo requires a VFS-reported FIFO and explicit streamingRead capability.\n FIFO payloads are bounded and cancellation-aware; producer failure aborts output.\n -r traverses listed directories; -R recursively searches matching names.\n Do not combine -r and -R. -D omits directory records without stopping traversal.\n -i patterns and -x patterns accept lists ending at another option or at @.\n Quote patterns to prevent the shell expanding them before zip receives them.\n Exclusions take precedence over inclusions. -j flattens selected source names;\n duplicate basenames fail before the archive is replaced.\n -nw disables wildcard interpretation; -ws prevents wildcards crossing '/'.\n -MM makes missing input matches fatal. -t includes files from a date; -tt\n selects files before a date. Dates accept mmddyyyy or yyyy-mm-dd.\n -y stores the symbolic link itself; otherwise its target is read.\n -p accepts the native paths compatibility flag and does not undo -j.\n\nArchive operations\n The default action adds new members and replaces selected existing members.\n -u updates changed/new sources; -f freshens existing members only.\n -d deletes matching archive members; -U copies matching archive members.\n -FS synchronizes selected existing members, including missing sources.\n -O output.zip preserves the input archive and publishes a separate output.\n -m removes sources only after successful publication or stdout completion.\n Removal needs atomic filesystem support; excluded/nonempty directories remain.\n -DF writes size/time differences and new members to required separate -O output.\n -g grows by retaining validated local records when only adding members;\n replacements/deletions rebuild. Publication always uses owned atomic staging.\n -b directory selects the VFS staging directory, also spooling stdout archives.\n Cross-provider publication must be supported by the filesystem; no host copy.\n -J removes a prefix only after validating the complete embedded ZIP and CRCs.\n -T checks integrity with registered virtual unzip before replacement.\n -TT \"command args {}\" selects a registered virtual test command; {} is the\n staged path, or the path is appended. Quotes/escapes form literal arguments;\n shell operators and substitutions are refused. No host process is spawned.\n With stdout output -T is ignored.\n -z reads an archive comment; -c reads selected member comments in archive order.\n -X strips optional metadata; -X- preserves available metadata.\n -o sets the archive timestamp to the newest resulting member timestamp.\n\nLogging\n -lf path writes a VFS log (a missing extension becomes .log).\n -la appends; -li includes progress in addition to warnings/errors.\n Logs require atomic conditional byte writes and cannot alias selected inputs.\n Logs are bounded by maxTextBytes; supplied password bytes are redacted.\n Completed log/publication effects remain if a later write fails.\n\nCompression and format\n -Z selects store, deflate, bzip2, or lzma; method names accept unique prefixes.\n -1 through -9 select effort. Store selection remains through later levels.\n -n .jpg:.png stores matching suffixes; -9 overrides suffix-based storage.\n Compression may fall back to STORE for regular files when it expands data.\n -l converts text LF to CRLF, leaving detected binary input unchanged.\n -fz forces ZIP64; -fz- disables it. -fd forces signed data descriptors.\n BZIP2 members use extraction version 4.6, including with ZIP64 records.\n LZMA is a ZIP format extension (not native Info-ZIP Zip 3.0).\n LZMA uses version 6.3, a bounded 1 MiB encoder dictionary, and EOS.\n Readers admit dictionaries up to 8 MiB and SDK 9.4 properties only.\n\nStreaming\n A '-' input filename reads one member from stdin, named '-'.\n A '-' archive name writes binary archive bytes to stdout and progress to stderr.\n With no archive or file operands, zip acts as a stdin-to-stdout filter.\n Streamed members retain compression even if it expands their data.\n -@ instead reads newline-separated input filenames; it cannot also read a '-'\n payload from the same stdin. Empty filename lines are ignored.\n Complete the output stream before using the resulting archive.\n\nArguments and ZIPOPT\n Long options accept unique abbreviations and --option=value where appropriate.\n Use -- after the archive name for literal filenames beginning with '-'.\n ZIPOPT supplies default arguments before the command arguments. Double quotes\n group words inside ZIPOPT; shell expansion is not performed on these defaults.\n -h and -h2 print basic and extended help as soon as they are encountered.\n --version and -L also exit immediately. Only a lone short -v shows information;\n --verbose and grouped -v perform an archive operation. Later -q or -v wins.\n -sc and -so validate all arguments before exiting; -sc returns status 9.\n\nDisplays\n -sf lists selected names and totals without reading source payloads or writing\n archives. -sf- and -q suppress names; totals remain visible. With no file\n operands, -sf lists the input archive. -sd reports only virtual processing steps.\n Command and diagnostic displays redact credential-shaped arguments and URLs.\n Display counters accept a trailing '-' to negate them. -ds accepts up to eight\n characters: digits with an optional k, m, g or t suffix (case-insensitive).\n Values below 1024 imply MB; nonzero intervals from 1 KB to below 32 KB fail.\n Empty -ds values restore 10 MB; 0 disables dots. Sizes must be safe integers.\n Dots use byte intervals, so counts can differ from native codec buffer dots.\n Per-entry progress appears after bounded preparation; global output dots stay\n visible with -q. Timed scanning dots and split-volume displays are unavailable.\n";
2
+ export declare const zipExtendedHelp = "safe-bash zip\nUsage: zip [options] archive [file ...]\n zip [options] - [file ...] write an archive to stdout\n zip [options] archive - read a member from stdin\n\n -r recurse into directories\n -j store basenames, discarding directory paths\n -q suppress progress messages\n -0 store without compression\n -1 .. -9 select compression effort\n -Z METHOD select store, deflate, bzip2, or lzma compression\n --encryption PROFILE select zipcrypto or aes-{128,192,256}-ae{1,2}\n -n SUFFIXES store matching suffixes (colon-separated)\n -u / -f update / freshen existing members\n -d / -U delete / copy selected archive members\n -FS synchronize selected members with filesystem sources\n -O FILE write to a separate output archive\n -A adjust validated SFX offsets, retaining the inert prefix\n -F / -FF repair from central / local records (requires -O FILE)\n -s SIZE split into .z01/.z02/.../.zip volumes (minimum 64k; 0 recombines)\n -sp approve volume transitions using an explicit host prompt\n -sv / -sb report split volumes / ring before a split-pause prompt\n -m remove archived sources after successful publication\n -D / -y omit directory entries / store symlinks\n -i / -x include / exclude matching names\n -RE enable bracket-list glob matching (already enabled on Unix)\n -k convert new source names to portable ASCII DOS 8.3 names\n -FI / -FI- enable / disable explicit VFS FIFO byte sources\n -@ read filenames from stdin\n -t / -tt select files from / before a date\n -T test archive integrity before replacement\n -P PASSWORD encrypt new members with a supplied password\n -e request and confirm a password through a no-echo host capability\n -z / -c read archive / entry comments from stdin\n -o set archive time to the latest member time\n -l convert text LF line endings to CRLF\n -ll convert text CRLF line endings to LF (--from-crlf)\n -X strip optional metadata\n -fz / -fz- force / disable ZIP64 output\n -fd force data descriptors\n -v verbose operation (a lone -v shows implementation information)\n --version show implementation information and exit\n -L show this implementation's license\n -sf / -sf- list selected files / totals only, without creating an archive\n -sc show processed arguments and exit with status 9\n -so show implemented options and exit\n -sd show virtual archive processing steps\n -db / -dc display byte / entry counters\n -du / -dv display entry size / single-volume numbers\n -dd / -dg display dots per entry / globally for output bytes\n -ds SIZE dot interval (kmgt units; default MB; 0 disables dots)\n -h show this help\n\nUse -- after the archive name to pass filenames beginning with '-'.\nLong option equivalents are accepted, for example --junk-paths and\n--compression-method=bzip2. All filesystem operations use the virtual filesystem.\n\nSelection\n -RE / --regex means bracket lists, not general regular expressions.\n -k / --DOS-names converts components after selection and -j; collisions fail.\n DOS conversion is restricted to printable ASCII. Filters parsed after -k\n are DOS-converted before matching original case-sensitive source names.\n -FI / --fifo requires a VFS-reported FIFO and explicit streamingRead capability.\n FIFO payloads are bounded and cancellation-aware; producer failure aborts output.\n -r traverses listed directories; -R recursively searches matching names.\n Do not combine -r and -R. -D omits directory records without stopping traversal.\n -i patterns and -x patterns accept lists ending at another option or at @.\n Quote patterns to prevent the shell expanding them before zip receives them.\n Exclusions take precedence over inclusions. -j flattens selected source names;\n duplicate basenames fail before the archive is replaced.\n -nw disables wildcard interpretation; -ws prevents wildcards crossing '/'.\n -MM makes missing input matches fatal. -t includes files from a date; -tt\n selects files before a date. Dates accept mmddyyyy or yyyy-mm-dd.\n -y stores the symbolic link itself; otherwise its target is read.\n -p accepts the native paths compatibility flag and does not undo -j.\n\nArchive operations\n The default action adds new members and replaces selected existing members.\n -u updates changed/new sources; -f freshens existing members only.\n -d deletes matching archive members; -U copies matching archive members.\n -FS synchronizes selected existing members, including missing sources.\n -O output.zip preserves the input archive and publishes a separate output.\n -m removes sources only after successful publication or stdout completion.\n Removal needs atomic filesystem support; excluded/nonempty directories remain.\n -DF writes size/time differences and new members to required separate -O output.\n -g grows by retaining validated local records when only adding members;\n replacements/deletions rebuild. Publication uses owned atomic staging or\n conditional byte publication with opaque host identities and versions.\n -b directory selects the VFS staging directory, also spooling stdout archives.\n Cross-provider publication must be supported by the filesystem; no host copy.\n -J removes a prefix only after validating the complete embedded ZIP and CRCs.\n -T checks integrity with registered virtual unzip before replacement.\n -TT \"command args {}\" selects a registered virtual test command; {} is the\n staged path, or the path is appended. Quotes/escapes form literal arguments;\n shell operators and substitutions are refused. No host process is spawned.\n With stdout output -T is ignored.\n -z reads an archive comment; -c reads selected member comments in archive order.\n -X strips optional metadata; -X- preserves available metadata.\n -o sets the archive timestamp to the newest resulting member timestamp.\n\nLogging\n -lf path writes a VFS log (a missing extension becomes .log).\n -la appends; -li includes progress in addition to warnings/errors.\n Logs require atomic conditional byte writes and cannot alias selected inputs.\n Logs are bounded by maxTextBytes; supplied password bytes are redacted.\n Completed log/publication effects remain if a later write fails.\n\nCompression and format\n -Z selects store, deflate, bzip2, or lzma; method names accept unique prefixes.\n -1 through -9 select effort. Store selection remains through later levels.\n -n .jpg:.png stores matching suffixes; -9 overrides suffix-based storage.\n Compression may fall back to STORE for regular files when it expands data.\n -l converts text LF to CRLF, leaving detected binary input unchanged.\n -fz forces ZIP64; -fz- disables it. -fd forces signed data descriptors.\n BZIP2 members use extraction version 4.6, including with ZIP64 records.\n LZMA is a ZIP format extension (not native Info-ZIP Zip 3.0).\n LZMA uses version 6.3, a bounded 1 MiB encoder dictionary, and EOS.\n Readers admit dictionaries up to 8 MiB and SDK 9.4 properties only.\n\nStreaming\n A '-' input filename reads one member from stdin, named '-'.\n A '-' archive name writes binary archive bytes to stdout and progress to stderr.\n With no archive or file operands, zip acts as a stdin-to-stdout filter.\n Streamed members retain compression even if it expands their data.\n -@ instead reads newline-separated input filenames; it cannot also read a '-'\n payload from the same stdin. Empty filename lines are ignored.\n Complete the output stream before using the resulting archive.\n\nArguments and ZIPOPT\n Long options accept unique abbreviations and --option=value where appropriate.\n Use -- after the archive name for literal filenames beginning with '-'.\n ZIPOPT supplies default arguments before the command arguments. Double quotes\n group words inside ZIPOPT; shell expansion is not performed on these defaults.\n -h and -h2 print basic and extended help as soon as they are encountered.\n --version and -L also exit immediately. Only a lone short -v shows information;\n --verbose and grouped -v perform an archive operation. Later -q or -v wins.\n -sc and -so validate all arguments before exiting; -sc returns status 9.\n\nDisplays\n -sf lists selected names and totals without reading source payloads or writing\n archives. -sf- and -q suppress names; totals remain visible. With no file\n operands, -sf lists the input archive. -sd reports only virtual processing steps.\n Command and diagnostic displays redact credential-shaped arguments and URLs.\n Display counters accept a trailing '-' to negate them. -ds accepts up to eight\n characters: digits with an optional k, m, g or t suffix (case-insensitive).\n Values below 1024 imply MB; nonzero intervals from 1 KB to below 32 KB fail.\n Empty -ds values restore 10 MB; 0 disables dots. Sizes must be safe integers.\n Dots use byte intervals, so counts can differ from native codec buffer dots.\n Per-entry progress appears after bounded preparation; global output dots stay\n visible with -q. Timed scanning dots and split-volume displays are unavailable.\n";
3
3
  export declare const zipVersion = "safe-bash zip (virtual-bash)\nBounded virtual ZIP implementation; not an Info-ZIP native build.\nCompression: store, deflate, bzip2, lzma (format extension). Single-volume ZIP and ZIP64 output.\nFilesystem, signals and byte limits are supplied by the host.\nNative compiler identity and ambient environment are not reported.\n";
4
4
  export declare const zipLicense = "safe-bash zip (virtual-bash)\nMIT License\nCopyright (c) 2026 Poe Platform\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nThis is the virtual implementation license, not the native Info-ZIP license.\n";
5
5
  //# sourceMappingURL=help.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../../src/commands/archive/zip/help.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,mkGAwDnB,CAAC;AAEF,eAAO,MAAM,eAAe,ukSA6F3B,CAAC;AAEF,eAAO,MAAM,UAAU,2UAKtB,CAAC;AAEF,eAAO,MAAM,UAAU,urCAuBtB,CAAC"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../../src/commands/archive/zip/help.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,mkGAwDnB,CAAC;AAEF,eAAO,MAAM,eAAe,4oSA8F3B,CAAC;AAEF,eAAO,MAAM,UAAU,2UAKtB,CAAC;AAEF,eAAO,MAAM,UAAU,urCAuBtB,CAAC"}
@@ -85,7 +85,8 @@ Archive operations
85
85
  Removal needs atomic filesystem support; excluded/nonempty directories remain.
86
86
  -DF writes size/time differences and new members to required separate -O output.
87
87
  -g grows by retaining validated local records when only adding members;
88
- replacements/deletions rebuild. Publication always uses owned atomic staging.
88
+ replacements/deletions rebuild. Publication uses owned atomic staging or
89
+ conditional byte publication with opaque host identities and versions.
89
90
  -b directory selects the VFS staging directory, also spooling stdout archives.
90
91
  Cross-provider publication must be supported by the filesystem; no host copy.
91
92
  -J removes a prefix only after validating the complete embedded ZIP and CRCs.
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../../../src/commands/archive/zip/help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDtB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FxC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;CAKzB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBzB,CAAC"}
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../../../src/commands/archive/zip/help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDtB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FxC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;CAKzB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBzB,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import { type ByteSource, type CommandContext, type FileStat, type FileStaging } from "../../../contracts/index.js";
2
2
  import { type ArchiveLimits } from "../internal.js";
3
+ export declare function hasZipIdentity(stat: FileStat): boolean;
4
+ export declare function sameZipIdentity(first: FileStat, second: FileStat): boolean;
5
+ export declare function safeZipFile(scope: ZipScope, path: string, stat: FileStat): Promise<boolean>;
3
6
  export declare class ZipScope {
4
7
  private readonly original;
5
8
  readonly limits: ArchiveLimits;
@@ -1 +1 @@
1
- {"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../../../src/commands/archive/zip/safety.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG/H,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAErE,qBAAa,QAAQ;IAUP,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAAkB,QAAQ,CAAC,MAAM,EAAE,aAAa;IATrF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAC1D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsC;IACnE,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,WAAW,CAAyB;gBACf,QAAQ,EAAE,cAAc,EAAW,MAAM,EAAE,aAAa;IAIrF,QAAQ,CAAC,KAAK,QAAO,OAAO,CAAC,IAAI,CAAC,CAShC;IACF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,SAAS,CAAC,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AAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qFAAqF;AACrF,wBAAsB,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDrI;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDzF"}
@@ -1,7 +1,27 @@
1
1
  import { readBytes } from "../../../contracts/index.js";
2
2
  import { retainFileSystemCleanup } from "@poe-platform/safe-fs/core";
3
3
  import { writeFileOutput } from "../../../contracts/filesystem-output.js";
4
- import { checkPath, fail } from "../internal.js";
4
+ import { checkPath, fail, hasIdentity as hasPosixIdentity, sameIdentity as samePosixIdentity } from "../internal.js";
5
+ export function hasZipIdentity(stat) {
6
+ return hasPosixIdentity(stat) || ((typeof stat.identityScope === "object" && stat.identityScope !== null || typeof stat.identityScope === "symbol")
7
+ && typeof stat.opaqueIdentity === "string" && stat.opaqueIdentity.length > 0 && stat.opaqueIdentity.length <= 4096
8
+ && hasZipVersion(stat));
9
+ }
10
+ function hasZipVersion(stat) {
11
+ return typeof stat.opaqueVersion === "string" && stat.opaqueVersion.length > 0 && stat.opaqueVersion.length <= 4096;
12
+ }
13
+ export function sameZipIdentity(first, second) {
14
+ return samePosixIdentity(first, second) || hasZipIdentity(first) && hasZipIdentity(second)
15
+ && first.opaqueIdentity !== undefined && first.identityScope === second.identityScope && first.opaqueIdentity === second.opaqueIdentity;
16
+ }
17
+ export async function safeZipFile(scope, path, stat) {
18
+ if (stat.type !== "file" || !hasZipIdentity(stat))
19
+ return false;
20
+ if (stat.nlink !== undefined)
21
+ return stat.nlink === 1;
22
+ const capabilities = await scope.operation(() => scope.context.fs.capabilitiesFor?.(path, { signal: scope.context.signal }) ?? scope.context.fs.capabilities);
23
+ return stat.opaqueIdentity !== undefined && capabilities.hardlinks === false;
24
+ }
5
25
  export class ZipScope {
6
26
  original;
7
27
  limits;
@@ -194,6 +214,48 @@ export async function stageZip(scope, prepared, consume) {
194
214
  export async function publishZip(scope, prepared) {
195
215
  const { fs, signal } = scope.context;
196
216
  const capabilities = await scope.operation(() => fs.capabilitiesFor?.(prepared.output, { signal, create: true }) ?? fs.capabilities);
217
+ if (capabilities.atomicFilePublication === true && fs.publishFileConditional && !prepared.validate && prepared.stagingName === undefined) {
218
+ if (capabilities.readOnly === true || capabilities.write === false)
219
+ fail("ZIP destination is not writable");
220
+ if (prepared.existing && (!hasZipIdentity(prepared.existing) || !hasZipVersion(prepared.existing)))
221
+ fail("ZIP conditional publication requires an observed opaque version");
222
+ const parent = await scope.operation(() => fs.realpath(prepared.parentName, { signal }));
223
+ if (parent !== prepared.parent)
224
+ fail("archive parent changed before publication");
225
+ let size = 0;
226
+ let completed = false;
227
+ let active = true;
228
+ const input = prepared.source ?? { async *[Symbol.asyncIterator]() { yield prepared.bytes ?? new Uint8Array(); } };
229
+ const source = scope.source((async function* () {
230
+ for await (const chunk of readBytes(input, signal)) {
231
+ if (!active)
232
+ fail("ZIP publication source is closed");
233
+ if (chunk.length > scope.limits.maxArchiveBytes - size)
234
+ fail("archive byte limit exceeded");
235
+ size += chunk.length;
236
+ let owned = chunk;
237
+ if (prepared.source)
238
+ await writeFileOutput(scope.context, chunk, async (bytes) => { owned = Uint8Array.from(bytes); });
239
+ yield owned;
240
+ }
241
+ completed = true;
242
+ })());
243
+ try {
244
+ const receipt = await scope.operation(() => fs.publishFileConditional(prepared.output, source, {
245
+ signal, parent: prepared.parentStat, expected: prepared.existing ?? null, maxBytes: scope.limits.maxArchiveBytes,
246
+ ...(prepared.existing && capabilities.permissions !== false ? { mode: prepared.existing.mode & 0o7777 } : {}),
247
+ ...(prepared.mtimeMs === undefined ? {} : { mtimeMs: prepared.mtimeMs }),
248
+ }));
249
+ if (!completed || receipt.type !== "file" || receipt.size !== size || !hasZipIdentity(receipt)
250
+ || !hasZipVersion(receipt) || prepared.existing?.opaqueVersion === receipt.opaqueVersion)
251
+ fail("Invalid ZIP conditional publication acknowledgement");
252
+ }
253
+ finally {
254
+ active = false;
255
+ await scope.closeInputs();
256
+ }
257
+ return;
258
+ }
197
259
  if (capabilities.atomicFileStaging !== true || !fs.publishStagedFile)
198
260
  fail("ZIP publication requires atomic owned file staging");
199
261
  await stageZip(scope, {
@@ -1 +1 @@
1
- {"version":3,"file":"safety.js","sourceRoot":"","sources":["../../../../src/commands/archive/zip/safety.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyE,MAAM,6BAA6B,CAAC;AAC/H,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,SAAS,E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CAAC,2CAA2C,CAAC,CAAC;QAClF,MAAM,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,iBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE;YAC1E,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,QAAQ,IAAI,IAAI;SAC5E,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../../src/commands/archive/zip.ts"],"names":[],"mappings":"AAaA,OAAO,EAA2E,KAAK,iBAAiB,EAAiB,MAAM,0BAA0B,CAAC;AAO1J,OAAO,EAAwF,KAAK,sBAAsB,EAAsB,MAAM,eAAe,CAAC;AAihCtK,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,sBAA2B,GAAG,iBAAiB,CAyJxF"}
1
+ {"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../../src/commands/archive/zip.ts"],"names":[],"mappings":"AAaA,OAAO,EAA2E,KAAK,iBAAiB,EAAiB,MAAM,0BAA0B,CAAC;AAO1J,OAAO,EAA6D,KAAK,sBAAsB,EAAsB,MAAM,eAAe,CAAC;AAkhC3I,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,sBAA2B,GAAG,iBAAiB,CAyJxF"}
@@ -18,10 +18,10 @@ import { createOutputOperation } from "../../contracts/output.js";
18
18
  import { yieldTurn } from "../../contracts/yield.js";
19
19
  import { publicDiagnosticMessage } from "../../diagnostics.js";
20
20
  import { escapeText } from "../../escaping.js";
21
- import { Budget, checkPath, display, fail, hasIdentity, sameIdentity, settings, text, vfsPath } from "./internal.js";
21
+ import { Budget, checkPath, display, fail, settings, text, vfsPath } from "./internal.js";
22
22
  import { decodeZipEntry, makeZipEntry, readZipArchive, writeZipArchive, streamZipArchive, updateZipExtras, setZipEntryComment } from "./zip-format.js";
23
23
  import { zipHelp, zipExtendedHelp, zipVersion, zipLicense } from "./zip/help.js";
24
- import { publishZip, stageZip, ZipScope } from "./zip/safety.js";
24
+ import { publishZip, stageZip, ZipScope, hasZipIdentity as hasIdentity, sameZipIdentity as sameIdentity, safeZipFile } from "./zip/safety.js";
25
25
  import { splitSize, splitZipVolumes, resolveZipVolumes, publishZipVolumes, volumeName } from "./zip/volumes.js";
26
26
  import { Selection } from "./unzip/arguments.js";
27
27
  import { normalizeZipOption, reservedZipShortOptions, ZipFailure, parseZipDotSize, zipLongOptions, zipNegatableOptions, zipDisplaySize, zipPublicText, zipPasswordArgument } from "./zip/options.js";
@@ -615,7 +615,8 @@ function memberName(path, limits) {
615
615
  function unchanged(before, after) {
616
616
  return before.type === after.type && before.size === after.size && before.mode === after.mode
617
617
  && before.mtimeMs === after.mtimeMs && before.ctimeMs === after.ctimeMs
618
- && before.nlink === after.nlink && (!hasIdentity(before) || sameIdentity(before, after));
618
+ && before.nlink === after.nlink && before.opaqueVersion === after.opaqueVersion && before.revision === after.revision
619
+ && (!hasIdentity(before) || sameIdentity(before, after));
619
620
  }
620
621
  async function inspectSource(scope, path, storeLinks) {
621
622
  const { fs, signal } = scope.context;
@@ -701,11 +702,11 @@ async function prepare(scope, parsed, budget, log, host) {
701
702
  }
702
703
  if ((parsed.action === "copy" || parsed.showFiles !== undefined && !parsed.operands.length || parsed.output !== undefined && parsed.archive !== "-") && !existing)
703
704
  throw new ZipFailure(18, "File not found or no read permission", parsed.archive);
704
- if (publication?.existing && (publication.existing.type !== "file" || !hasIdentity(publication.existing) || publication.existing.nlink !== 1))
705
+ if (publication?.existing && !await safeZipFile(scope, publication.output, publication.existing))
705
706
  fail("output archive requires a regular, single-link file with known backing identity");
706
707
  if (parsed.archive === "-" && parsed.test && !parsed.quiet)
707
708
  await budget.output("\tzip warning: can't use -T on stdout, -T ignored\n");
708
- if (existing && (existing.type !== "file" || !hasIdentity(existing) || existing.nlink !== 1))
709
+ if (existing && !await safeZipFile(scope, input, existing))
709
710
  fail("updating archive requires a regular, single-link file with known backing identity; archive aliases are unsupported");
710
711
  let archive = { entries: [], comment: new Uint8Array() };
711
712
  let originalBytes;
@@ -921,9 +922,9 @@ async function prepare(scope, parsed, budget, log, host) {
921
922
  await budget.output(`\tzip warning: ignoring special file: ${zipPublicText(source)}\n`);
922
923
  return;
923
924
  }
924
- if ((existing || publication?.existing) && !hasIdentity(stat))
925
- fail("cannot exclude archive aliases when source backing identity is unknown");
926
925
  const directory = stat.type === "directory";
926
+ if ((existing || publication?.existing) && !directory && !hasIdentity(stat))
927
+ fail("cannot exclude archive aliases when source backing identity is unknown");
927
928
  if (directory && name && !name.endsWith("/"))
928
929
  name += "/";
929
930
  const dateIncluded = zipDateMatches(new Date(stat.mtimeMs), parsed.fromDate, parsed.beforeDate);