@poe-platform/safe-bash 0.1.789 → 0.1.790

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 (207) hide show
  1. package/dist/image-ast/index.browser.js +147 -80
  2. package/dist/image-ast/index.js +147 -80
  3. package/dist/mp4-ast/mp4.d.ts +2 -0
  4. package/dist/pdf-ast/cos/parser.d.ts +1 -0
  5. package/dist/pdf-ast/cos/security.d.ts +2 -0
  6. package/dist/pdf-ast/cos/writer.d.ts +1 -0
  7. package/dist/pdf-ast/document.d.ts +3 -0
  8. package/dist/pdf-ast/edit/forms.d.ts +1 -0
  9. package/dist/pdf-ast/index.js +171 -82
  10. package/dist/safe-bash/chunks/{chunk-L5QQLNTO.js → chunk-22PI65AH.js} +2 -2
  11. package/dist/safe-bash/chunks/{chunk-KHJGUF2W.js → chunk-2TAGYMPK.js} +43 -42
  12. package/dist/safe-bash/chunks/{chunk-D4PHJK4T.js → chunk-2W4HTMEK.js} +52 -48
  13. package/dist/safe-bash/chunks/{chunk-FFZXP6ZC.js → chunk-3M7L7XU2.js} +2 -2
  14. package/dist/safe-bash/chunks/{chunk-XNODZRVD.js → chunk-3QAO6UYS.js} +2 -2
  15. package/dist/safe-bash/chunks/{chunk-YPETOVQU.js → chunk-3VKFK3NF.js} +2 -2
  16. package/dist/safe-bash/chunks/chunk-5OST7NOX.js +42 -0
  17. package/dist/safe-bash/chunks/{chunk-KEBSX2AX.js → chunk-6HLURHVU.js} +2 -2
  18. package/dist/safe-bash/chunks/chunk-DYEUZE6Z.js +19 -0
  19. package/dist/safe-bash/chunks/{chunk-T2TGCHKE.js → chunk-FM3WBSZT.js} +2 -2
  20. package/dist/safe-bash/chunks/chunk-GAYRKQM6.js +22 -0
  21. package/dist/safe-bash/chunks/{chunk-Q45QCA4J.js → chunk-I3KSESCR.js} +0 -7
  22. package/dist/safe-bash/chunks/{chunk-OSKDIBQS.js → chunk-JLIMK5TD.js} +1 -1
  23. package/dist/safe-bash/chunks/{chunk-2AYZCT5X.js → chunk-JQ2FAJJT.js} +27 -23
  24. package/dist/safe-bash/chunks/{chunk-QA3NVP43.js → chunk-JRE6Z3T7.js} +2 -2
  25. package/dist/safe-bash/chunks/{chunk-DC5EHLKS.js → chunk-NDIL6T7Y.js} +5 -5
  26. package/dist/safe-bash/chunks/{chunk-747G42FY.js → chunk-OPR4UAIT.js} +2 -2
  27. package/dist/safe-bash/chunks/chunk-OSMQCYSP.js +19 -0
  28. package/dist/safe-bash/chunks/chunk-OYB332PQ.js +17 -0
  29. package/dist/safe-bash/chunks/{chunk-X5ZCECM6.js → chunk-QTIH2AFE.js} +77 -69
  30. package/dist/safe-bash/chunks/{chunk-CTUHLNJM.js → chunk-SBESXWT2.js} +43 -44
  31. package/dist/safe-bash/chunks/{chunk-4FDQJUFW.js → chunk-SDEPGTOF.js} +1 -1
  32. package/dist/safe-bash/chunks/chunk-UZU5BIJI.js +32 -0
  33. package/dist/safe-bash/chunks/{chunk-BI6JV62X.js → chunk-VCCMROTL.js} +7 -10
  34. package/dist/safe-bash/chunks/chunk-W47GHRRF.js +13 -0
  35. package/dist/safe-bash/chunks/{chunk-NPMQWZUZ.js → chunk-WS7KZIUM.js} +2 -2
  36. package/dist/safe-bash/chunks/{chunk-3PZYHMGM.js → chunk-YYAERCWS.js} +7 -7
  37. package/dist/safe-bash/chunks/{chunk-5U7JECDB.js → chunk-ZPGVEUKF.js} +8 -7
  38. package/dist/safe-bash/chunks/{csvkit-K55OYAQC.js → csvkit-USUJG62I.js} +65 -11
  39. package/dist/safe-bash/chunks/{ffmpeg-BEFTQ6DZ.js → ffmpeg-KRGG5DLH.js} +21 -10
  40. package/dist/safe-bash/chunks/{gh-HQWOWLWE.js → gh-UCFDUZCX.js} +16 -8
  41. package/dist/safe-bash/chunks/{git-HO7WDPHZ.js → git-LPAF6KDG.js} +7 -9
  42. package/dist/safe-bash/chunks/{imagemagick-53BMHH6D.js → imagemagick-KGREKK4G.js} +38 -7
  43. package/dist/safe-bash/chunks/{implementation-QUTAAYMT.js → implementation-FXDRYS5A.js} +34 -8
  44. package/dist/safe-bash/chunks/{pdfimages-4OYI6FLG.js → pdfimages-UADCF4G4.js} +12 -8
  45. package/dist/safe-bash/chunks/{pdfinfo-I7U6TQPP.js → pdfinfo-O7UWPF4W.js} +38 -13
  46. package/dist/safe-bash/chunks/{pdftk-SUA6FMHI.js → pdftk-AERXIJTN.js} +13 -8
  47. package/dist/safe-bash/chunks/{pdftoppm-4C5DGEWX.js → pdftoppm-L466JQKI.js} +17 -10
  48. package/dist/safe-bash/chunks/{pdftotext-Y4WI225Y.js → pdftotext-SUSI4WXS.js} +19 -9
  49. package/dist/safe-bash/chunks/{qpdf-IORB4RV5.js → qpdf-YL24KVRH.js} +14 -8
  50. package/dist/safe-bash/chunks/{sips-WHAMJFEU.js → sips-QXEQZERX.js} +14 -7
  51. package/dist/safe-bash/chunks/{soffice-SYEK6WJS.js → soffice-TBITRML3.js} +16 -8
  52. package/dist/safe-bash/chunks/{wkhtmltopdf-ZIICWJLF.js → wkhtmltopdf-NJA2THRC.js} +27 -7
  53. package/dist/safe-bash/command-chunks/chunk-2C5BEBPY.js +1388 -0
  54. package/dist/safe-bash/command-chunks/{chunk-2VTMZTV3.js → chunk-2EXV2ZLV.js} +2 -2
  55. package/dist/safe-bash/command-chunks/{chunk-UJOO6DKY.js → chunk-6EASC5EC.js} +1 -1
  56. package/dist/safe-bash/command-chunks/{chunk-ZF3ZVGQC.js → chunk-7JRITHKW.js} +150 -80
  57. package/dist/safe-bash/{chunks/chunk-LD76P7AG.js → command-chunks/chunk-AKDMCNX4.js} +74 -39
  58. package/dist/safe-bash/command-chunks/{chunk-6F7QJMJ3.js → chunk-CBDVLMJB.js} +1 -1
  59. package/dist/safe-bash/command-chunks/chunk-H4LWTITX.js +169 -0
  60. package/dist/safe-bash/command-chunks/chunk-I2MQNBGR.js +145 -0
  61. package/dist/safe-bash/command-chunks/{chunk-5GRLAARV.js → chunk-IOXI5ZAJ.js} +1 -1
  62. package/dist/safe-bash/command-chunks/{chunk-XNHSCU6I.js → chunk-MDPIOQUD.js} +6 -6
  63. package/dist/safe-bash/command-chunks/chunk-QI4MGIN6.js +6 -0
  64. package/dist/safe-bash/command-chunks/chunk-QTYZAWSB.js +91 -0
  65. package/dist/safe-bash/command-chunks/chunk-SNK7K3XW.js +90 -0
  66. package/dist/safe-bash/command-chunks/chunk-T5OLGM43.js +314 -0
  67. package/dist/safe-bash/command-chunks/chunk-TB7IFMUZ.js +802 -0
  68. package/dist/safe-bash/command-chunks/{chunk-AT6ZSOE6.js → chunk-TPPBPIWL.js} +1 -1
  69. package/dist/safe-bash/command-chunks/chunk-VMK4XVKO.js +82 -0
  70. package/dist/safe-bash/command-chunks/chunk-VNSJKXDU.js +130 -0
  71. package/dist/safe-bash/command-chunks/chunk-YFNTMH6Z.js +6 -0
  72. package/dist/safe-bash/commands/csplit/index.browser.js +2 -2
  73. package/dist/safe-bash/commands/docx/index.browser.js +2 -2
  74. package/dist/safe-bash/commands/factor/index.browser.js +2 -2
  75. package/dist/safe-bash/commands/getopt/index.browser.js +2 -2
  76. package/dist/safe-bash/commands/hexdump/index.browser.js +2 -2
  77. package/dist/safe-bash/commands/iconv/index.browser.js +2 -2
  78. package/dist/safe-bash/commands/line-endings/index.browser.js +2 -2
  79. package/dist/safe-bash/commands/llm/command.d.ts +1 -4
  80. package/dist/safe-bash/commands/llm/command.js +1 -248
  81. package/dist/safe-bash/commands/llm/elevenlabs-stream.d.ts +1 -2
  82. package/dist/safe-bash/commands/llm/elevenlabs-stream.js +1 -117
  83. package/dist/safe-bash/commands/llm/elevenlabs.d.ts +1 -15
  84. package/dist/safe-bash/commands/llm/elevenlabs.js +1 -123
  85. package/dist/safe-bash/commands/llm/index.browser.js +20 -15
  86. package/dist/safe-bash/commands/llm/index.d.ts +1 -6
  87. package/dist/safe-bash/commands/llm/index.js +1 -4
  88. package/dist/safe-bash/commands/llm/mime.d.ts +1 -2
  89. package/dist/safe-bash/commands/llm/mime.js +1 -136
  90. package/dist/safe-bash/commands/llm/openai-http.d.ts +1 -8
  91. package/dist/safe-bash/commands/llm/openai-http.js +1 -143
  92. package/dist/safe-bash/commands/llm/openai-sse.d.ts +1 -3
  93. package/dist/safe-bash/commands/llm/openai-sse.js +1 -78
  94. package/dist/safe-bash/commands/llm/openai.d.ts +1 -14
  95. package/dist/safe-bash/commands/llm/openai.js +1 -288
  96. package/dist/safe-bash/commands/llm/providers/elevenlabs.d.ts +1 -1
  97. package/dist/safe-bash/commands/llm/providers/elevenlabs.js +1 -1
  98. package/dist/safe-bash/commands/llm/providers/index.browser.js +6 -6
  99. package/dist/safe-bash/commands/llm/providers/index.d.ts +1 -3
  100. package/dist/safe-bash/commands/llm/providers/index.js +1 -2
  101. package/dist/safe-bash/commands/llm/providers/openai.d.ts +1 -1
  102. package/dist/safe-bash/commands/llm/providers/openai.js +1 -1
  103. package/dist/safe-bash/commands/llm/providers/shared.d.ts +1 -23
  104. package/dist/safe-bash/commands/llm/providers/shared.js +1 -65
  105. package/dist/safe-bash/commands/llm/service.d.ts +1 -37
  106. package/dist/safe-bash/commands/llm/service.js +1 -151
  107. package/dist/safe-bash/commands/llm/types.d.ts +1 -52
  108. package/dist/safe-bash/commands/llm/types.js +1 -1
  109. package/dist/safe-bash/commands/mdq/index.browser.js +3 -3
  110. package/dist/safe-bash/commands/media/index.browser.js +1 -1
  111. package/dist/safe-bash/commands/network/index.browser.js +9 -9
  112. package/dist/safe-bash/commands/network/types.d.ts +2 -40
  113. package/dist/safe-bash/commands/node/index.browser.js +6 -8
  114. package/dist/safe-bash/commands/op/index.browser.js +3 -3
  115. package/dist/safe-bash/commands/op/index.js +12 -28
  116. package/dist/safe-bash/commands/pr/index.browser.js +2 -2
  117. package/dist/safe-bash/commands/python/index.browser.js +8 -8
  118. package/dist/safe-bash/commands/python/worker.browser.js +2 -2
  119. package/dist/safe-bash/commands/tsort/index.browser.js +2 -2
  120. package/dist/safe-bash/commands/xml/index.browser.js +2 -2
  121. package/dist/safe-bash/commands/yq/index.browser.js +3 -3
  122. package/dist/safe-bash/core.browser.js +9775 -10975
  123. package/dist/safe-bash/core.d.ts +0 -1
  124. package/dist/safe-bash/core.js +0 -1
  125. package/dist/safe-bash/jobs.browser.js +5 -4
  126. package/dist/safe-bash/optional-host.browser.js +61 -88
  127. package/dist/safe-bash/shell/runtime.js +34 -12
  128. package/dist/safe-bash/yq-browser/index.js +1 -1
  129. package/dist/safe-bash-command-ffmpeg/index.js +8130 -8011
  130. package/dist/safe-bash-command-git/git_rust.wasm +0 -0
  131. package/dist/safe-bash-command-git/wasm.generated.js +1 -1
  132. package/dist/safe-bash-command-imagemagick/index.js +2 -2
  133. package/dist/safe-bash-command-llm/LICENSE +21 -0
  134. package/dist/safe-bash-command-llm/command.d.ts +5 -0
  135. package/dist/safe-bash-command-llm/command.js +14 -0
  136. package/dist/safe-bash-command-llm/configuration.d.ts +18 -0
  137. package/dist/safe-bash-command-llm/elevenlabs-stream.d.ts +2 -0
  138. package/dist/safe-bash-command-llm/elevenlabs-stream.js +7 -0
  139. package/dist/safe-bash-command-llm/elevenlabs.d.ts +15 -0
  140. package/dist/safe-bash-command-llm/elevenlabs.js +10 -0
  141. package/dist/safe-bash-command-llm/index.d.ts +10 -0
  142. package/dist/safe-bash-command-llm/index.js +46 -0
  143. package/dist/safe-bash-command-llm/mime.d.ts +2 -0
  144. package/dist/safe-bash-command-llm/mime.js +9 -0
  145. package/dist/safe-bash-command-llm/model-options.d.ts +3 -0
  146. package/dist/safe-bash-command-llm/openai-http.d.ts +8 -0
  147. package/dist/safe-bash-command-llm/openai-http.js +17 -0
  148. package/dist/safe-bash-command-llm/openai-sse.d.ts +3 -0
  149. package/dist/safe-bash-command-llm/openai-sse.js +8 -0
  150. package/dist/safe-bash-command-llm/openai.d.ts +14 -0
  151. package/dist/safe-bash-command-llm/openai.js +12 -0
  152. package/dist/safe-bash-command-llm/providers/elevenlabs.d.ts +1 -0
  153. package/dist/safe-bash-command-llm/providers/elevenlabs.js +11 -0
  154. package/dist/safe-bash-command-llm/providers/index.d.ts +3 -0
  155. package/dist/safe-bash-command-llm/providers/index.js +24 -0
  156. package/dist/safe-bash-command-llm/providers/openai.d.ts +1 -0
  157. package/dist/safe-bash-command-llm/providers/openai.js +13 -0
  158. package/dist/safe-bash-command-llm/providers/shared.d.ts +23 -0
  159. package/dist/safe-bash-command-llm/providers/shared.js +13 -0
  160. package/dist/safe-bash-command-llm/schemas.d.ts +2 -0
  161. package/dist/safe-bash-command-llm/service.d.ts +42 -0
  162. package/dist/safe-bash-command-llm/service.js +9 -0
  163. package/dist/safe-bash-command-llm/templates.d.ts +27 -0
  164. package/dist/safe-bash-command-llm/types.d.ts +87 -0
  165. package/dist/safe-bash-command-llm/types.js +6 -0
  166. package/dist/safe-bash-command-mmdc/command.d.ts +4 -0
  167. package/dist/safe-bash-command-mmdc/index.d.ts +1 -1
  168. package/dist/safe-bash-command-mmdc/index.js +7084 -6687
  169. package/dist/safe-bash-command-mmdc/layout.d.ts +1 -0
  170. package/dist/safe-bash-command-mmdc/parser.d.ts +1 -0
  171. package/dist/safe-bash-command-mmdc/png.d.ts +3 -0
  172. package/dist/safe-bash-command-mmdc/raster.d.ts +1 -0
  173. package/dist/safe-bash-command-pandoc/command.js +3 -3
  174. package/dist/safe-bash-command-pandoc/index.js +3 -3
  175. package/dist/safe-bash-command-pdfimages/index.js +147 -80
  176. package/dist/safe-bash-command-pdfinfo/index.js +147 -80
  177. package/dist/safe-bash-command-pdftk/index.js +147 -80
  178. package/dist/safe-bash-command-pdftoppm/index.js +147 -80
  179. package/dist/safe-bash-command-pdftotext/index.js +147 -80
  180. package/dist/safe-bash-command-qpdf/index.js +174 -101
  181. package/dist/safe-bash-command-sips/index.js +2 -2
  182. package/dist/safe-bash-command-soffice/index.js +1 -1
  183. package/dist/safe-bash-command-ssconvert/index.js +147 -80
  184. package/dist/safe-bash-command-wkhtmltopdf/index.js +147 -80
  185. package/dist/safe-bash-contracts/default-executor.d.ts +5 -0
  186. package/dist/safe-bash-contracts/default-executor.js +37 -0
  187. package/dist/safe-bash-contracts/http.d.ts +41 -0
  188. package/dist/safe-bash-contracts/http.js +6 -0
  189. package/dist/safe-bash-io-engine/commands/search/requirements.js +3 -3
  190. package/dist/safe-bash-io-engine/commands/text-programs/shared.js +3 -3
  191. package/dist/safe-bash-io-engine/gnu-information.d.ts +1 -1
  192. package/dist/safe-bash-io-engine/gnu-information.js +1 -1
  193. package/dist/safe-bash-io-engine/internal.js +2 -2
  194. package/dist/safe-bash-query-engine/index.js +3 -3
  195. package/dist/safe-bash-query-engine/interpreter.js +2 -2
  196. package/dist/safe-bash-query-engine/query-core.js +3 -3
  197. package/package.json +2 -2
  198. package/dist/safe-bash/chunks/chunk-2G2T5MEM.js +0 -14
  199. package/dist/safe-bash/chunks/chunk-2MUJ7RLZ.js +0 -409
  200. package/dist/safe-bash/chunks/chunk-GJWUEOT6.js +0 -14
  201. package/dist/safe-bash/chunks/chunk-H7MMJS26.js +0 -37
  202. package/dist/safe-bash/chunks/chunk-LAPF2XE6.js +0 -14
  203. package/dist/safe-bash/chunks/chunk-S2LSZFZ6.js +0 -758
  204. package/dist/safe-bash/chunks/chunk-T3VDYWKZ.js +0 -21
  205. package/dist/safe-bash/chunks/chunk-VUVKC6HV.js +0 -81
  206. package/dist/safe-bash/chunks/chunk-VYW4Q6KF.js +0 -12
  207. package/dist/safe-bash/command-chunks/{chunk-BJ6DGYJA.js → chunk-KNI4GRXF.js} +3 -3
@@ -22,7 +22,6 @@ export * from "./commands/python/index.js";
22
22
  export * from "./commands/node/browser.js";
23
23
  export * from "./commands/network/public.js";
24
24
  export * from "./commands/llm/index.js";
25
- export * from "./commands/llm/providers/index.js";
26
25
  export * from "./commands/metadata/index.js";
27
26
  export * from "./commands/archive/index.js";
28
27
  export * from "./commands/table-text/index.js";
@@ -22,7 +22,6 @@ export * from "./commands/python/index.js";
22
22
  export * from "./commands/node/browser.js";
23
23
  export * from "./commands/network/public.js";
24
24
  export * from "./commands/llm/index.js";
25
- export * from "./commands/llm/providers/index.js";
26
25
  export * from "./commands/metadata/index.js";
27
26
  export * from "./commands/archive/index.js";
28
27
  export * from "./commands/table-text/index.js";
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  jobsExtension
3
- } from "./chunks/chunk-2AYZCT5X.js";
4
- import "./chunks/chunk-BI6JV62X.js";
5
- import "./chunks/chunk-T3VDYWKZ.js";
3
+ } from "./chunks/chunk-JQ2FAJJT.js";
4
+ import "./chunks/chunk-VCCMROTL.js";
5
+ import "./chunks/chunk-DYEUZE6Z.js";
6
+ import "./chunks/chunk-OSMQCYSP.js";
6
7
  import {
7
8
  init_platform
8
- } from "./chunks/chunk-Q45QCA4J.js";
9
+ } from "./chunks/chunk-I3KSESCR.js";
9
10
 
10
11
  // packages/safe-bash/src/jobs.ts
11
12
  init_platform();
@@ -1,118 +1,91 @@
1
1
  import {
2
- byte_encoding_exports,
2
+ ByteInputBudget,
3
+ EreLedger,
4
+ EreProfileLimitError,
5
+ EreSyntaxError,
6
+ EreUnsupportedError,
3
7
  compareCopyIdentity,
4
8
  compareObservedEntries,
5
- errors_exports,
6
- input_budget_exports,
7
- limits_exports,
8
- matcher_exports,
9
+ compileEre,
10
+ inputRequirements,
11
+ latin1Text,
9
12
  portableTrapExtension,
10
- portable_requirements_exports,
11
- syntax_exports,
12
- timeout_exports
13
- } from "./chunks/chunk-KHJGUF2W.js";
13
+ prepareUtf8EreSubject,
14
+ signalName
15
+ } from "./chunks/chunk-2TAGYMPK.js";
14
16
  import {
15
17
  jobsExtension
16
- } from "./chunks/chunk-2AYZCT5X.js";
17
- import "./chunks/chunk-BI6JV62X.js";
18
- import "./chunks/chunk-T3VDYWKZ.js";
18
+ } from "./chunks/chunk-JQ2FAJJT.js";
19
+ import "./chunks/chunk-VCCMROTL.js";
20
+ import "./chunks/chunk-DYEUZE6Z.js";
21
+ import "./chunks/chunk-OSMQCYSP.js";
19
22
  import {
20
- internal_exports
21
- } from "./chunks/chunk-GJWUEOT6.js";
23
+ UsageError,
24
+ builtInDirectContextExecutors,
25
+ codeOf,
26
+ decoder,
27
+ isDefaultCommandOptions,
28
+ output,
29
+ pathOf,
30
+ registerDefaultExecutor,
31
+ registerDefaultExecutors,
32
+ syncCommandEvaluators
33
+ } from "./chunks/chunk-5OST7NOX.js";
22
34
  import {
23
- __reExport,
24
35
  init_platform
25
- } from "./chunks/chunk-Q45QCA4J.js";
36
+ } from "./chunks/chunk-I3KSESCR.js";
26
37
 
27
38
  // packages/safe-bash/src/optional-host.ts
28
39
  init_platform();
29
40
 
30
41
  // packages/safe-bash/src/commands/yq/toml.ts
31
- var toml_exports = {};
32
42
  init_platform();
33
- __reExport(toml_exports, toml_star);
34
- import * as toml_star from "../safe-bash-command-yq/toml.js";
43
+ import { parseTomlDocument } from "../safe-bash-command-yq/toml.js";
35
44
 
36
45
  // packages/safe-bash/src/commands/yq/accounting.ts
37
- var accounting_exports = {};
38
46
  init_platform();
39
- __reExport(accounting_exports, accounting_star);
40
- import * as accounting_star from "../safe-bash-command-yq/accounting.js";
47
+ import { YqLedger, aliasFailure, copyAlias, estimateAlias, resolveYqLimits, yqCaps } from "../safe-bash-command-yq/accounting.js";
41
48
 
42
49
  // packages/safe-bash/src/commands/structured/numbers.ts
43
- var numbers_exports = {};
44
50
  init_platform();
45
- __reExport(numbers_exports, numbers_star);
46
- import * as numbers_star from "../safe-bash-query-engine/numbers.js";
51
+ import { Decimal, SMALL_DECIMALS, compareNumbers, decimalNumber, isNumber, numberText, numberValue, numericToken } from "../safe-bash-query-engine/numbers.js";
47
52
 
48
53
  // packages/safe-bash/src/commands/structured/bytes.ts
49
- var bytes_exports = {};
50
54
  init_platform();
51
- __reExport(bytes_exports, bytes_star);
52
- import * as bytes_star from "../safe-bash-query-engine/bytes.js";
53
- var export_ByteInputBudget = input_budget_exports.ByteInputBudget;
54
- var export_Decimal = numbers_exports.Decimal;
55
- var export_EreLedger = limits_exports.EreLedger;
56
- var export_EreProfileLimitError = errors_exports.EreProfileLimitError;
57
- var export_EreSyntaxError = errors_exports.EreSyntaxError;
58
- var export_EreUnsupportedError = errors_exports.EreUnsupportedError;
59
- var export_UsageError = internal_exports.UsageError;
60
- var export_YqLedger = accounting_exports.YqLedger;
61
- var export_builtInDirectContextExecutors = internal_exports.builtInDirectContextExecutors;
62
- var export_codeOf = internal_exports.codeOf;
63
- var export_compareBytes = bytes_exports.compareBytes;
64
- var export_compileEre = syntax_exports.compileEre;
65
- var export_decodeBase64 = bytes_exports.decodeBase64;
66
- var export_decoder = internal_exports.decoder;
67
- var export_encodeBase64 = bytes_exports.encodeBase64;
68
- var export_inputRequirements = portable_requirements_exports.inputRequirements;
69
- var export_isDefaultCommandOptions = internal_exports.isDefaultCommandOptions;
70
- var export_latin1Text = byte_encoding_exports.latin1Text;
71
- var export_numberText = numbers_exports.numberText;
72
- var export_output = internal_exports.output;
73
- var export_parseTomlDocument = toml_exports.parseTomlDocument;
74
- var export_pathOf = internal_exports.pathOf;
75
- var export_prepareUtf8EreSubject = matcher_exports.prepareUtf8EreSubject;
76
- var export_registerDefaultExecutor = internal_exports.registerDefaultExecutor;
77
- var export_registerDefaultExecutors = internal_exports.registerDefaultExecutors;
78
- var export_signalName = timeout_exports.signalName;
79
- var export_syncCommandEvaluators = internal_exports.syncCommandEvaluators;
80
- var export_utf8ByteLength = bytes_exports.utf8ByteLength;
81
- var export_utf8Decoder = bytes_exports.utf8Decoder;
82
- var export_utf8Encoder = bytes_exports.utf8Encoder;
55
+ import { compareBytes, decodeBase64, decodeLatin1, encodeBase64, encodeLatin1, utf8ByteLength, utf8Decoder, utf8Encoder } from "../safe-bash-query-engine/bytes.js";
83
56
  export {
84
- export_ByteInputBudget as ByteInputBudget,
85
- export_Decimal as Decimal,
86
- export_EreLedger as EreLedger,
87
- export_EreProfileLimitError as EreProfileLimitError,
88
- export_EreSyntaxError as EreSyntaxError,
89
- export_EreUnsupportedError as EreUnsupportedError,
90
- export_UsageError as UsageError,
91
- export_YqLedger as YqLedger,
92
- export_builtInDirectContextExecutors as builtInDirectContextExecutors,
93
- export_codeOf as codeOf,
94
- export_compareBytes as compareBytes,
57
+ ByteInputBudget,
58
+ Decimal,
59
+ EreLedger,
60
+ EreProfileLimitError,
61
+ EreSyntaxError,
62
+ EreUnsupportedError,
63
+ UsageError,
64
+ YqLedger,
65
+ builtInDirectContextExecutors,
66
+ codeOf,
67
+ compareBytes,
95
68
  compareCopyIdentity,
96
69
  compareObservedEntries,
97
- export_compileEre as compileEre,
98
- export_decodeBase64 as decodeBase64,
99
- export_decoder as decoder,
100
- export_encodeBase64 as encodeBase64,
101
- export_inputRequirements as inputRequirements,
102
- export_isDefaultCommandOptions as isDefaultCommandOptions,
70
+ compileEre,
71
+ decodeBase64,
72
+ decoder,
73
+ encodeBase64,
74
+ inputRequirements,
75
+ isDefaultCommandOptions,
103
76
  jobsExtension,
104
- export_latin1Text as latin1Text,
105
- export_numberText as numberText,
106
- export_output as output,
107
- export_parseTomlDocument as parseTomlDocument,
108
- export_pathOf as pathOf,
77
+ latin1Text,
78
+ numberText,
79
+ output,
80
+ parseTomlDocument,
81
+ pathOf,
109
82
  portableTrapExtension,
110
- export_prepareUtf8EreSubject as prepareUtf8EreSubject,
111
- export_registerDefaultExecutor as registerDefaultExecutor,
112
- export_registerDefaultExecutors as registerDefaultExecutors,
113
- export_signalName as signalName,
114
- export_syncCommandEvaluators as syncCommandEvaluators,
115
- export_utf8ByteLength as utf8ByteLength,
116
- export_utf8Decoder as utf8Decoder,
117
- export_utf8Encoder as utf8Encoder
83
+ prepareUtf8EreSubject,
84
+ registerDefaultExecutor,
85
+ registerDefaultExecutors,
86
+ signalName,
87
+ syncCommandEvaluators,
88
+ utf8ByteLength,
89
+ utf8Decoder,
90
+ utf8Encoder
118
91
  };
@@ -3057,6 +3057,29 @@ function sameRedirectTargetWord(a, b) {
3057
3057
  }
3058
3058
  return true;
3059
3059
  }
3060
+ // Arbitrary writes to arithmetic references need the general evaluator.
3061
+ function syncStepsMayWriteName(steps, name) {
3062
+ return steps.some(step => step.name === name || step.arithStmt !== undefined || (step.printfVArgs !== undefined && step.cmd.words[1]?.plain === "-v") ||
3063
+ (step.readHereString && (step.readHereString.varNames.includes(name) || (step.readHereString.isBareReply && name === "REPLY"))) || step.unsetVars?.includes(name) ||
3064
+ step.ifBranches?.some(branch => branch.cond !== undefined || syncStepsMayWriteName(branch.steps, name)) ||
3065
+ (step.elseSteps && syncStepsMayWriteName(step.elseSteps, name)) ||
3066
+ step.caseClauses?.some(clause => syncStepsMayWriteName(clause.steps, name)) ||
3067
+ (step.fnCall && (step.fnCall.locals.some(local => local.name === name) || syncStepsMayWriteName(step.fnCall.steps, name))) ||
3068
+ (step.nestedLoop && (step.nestedLoop.loopCmd.kind !== "for" || step.nestedLoop.loopCmd.name === name || syncStepsMayWriteName(step.nestedLoop.steps, name))));
3069
+ }
3070
+ function arithmeticReadsOtherName(node, inductionName) {
3071
+ if (!node)
3072
+ return false;
3073
+ if (node.kind === "name")
3074
+ return node.name !== inductionName;
3075
+ if (node.kind === "unary")
3076
+ return arithmeticReadsOtherName(node.operand, inductionName);
3077
+ if (node.kind === "binary")
3078
+ return arithmeticReadsOtherName(node.left, inductionName) || arithmeticReadsOtherName(node.right, inductionName);
3079
+ if (node.kind === "conditional")
3080
+ return arithmeticReadsOtherName(node.condition, inductionName) || arithmeticReadsOtherName(node.yes, inductionName) || arithmeticReadsOtherName(node.no, inductionName);
3081
+ return false;
3082
+ }
3060
3083
  const intLoopStepCache = new WeakMap();
3061
3084
  const sharedSyncLoopTouched = new Set();
3062
3085
  const sharedSyncLoopArithNames = new Set();
@@ -3933,7 +3956,9 @@ export class Runtime {
3933
3956
  !pat.text.includes("[.") &&
3934
3957
  !pat.text.includes("[=") &&
3935
3958
  !pat.text.includes("()") &&
3959
+ !pat.text.includes("(?") &&
3936
3960
  !pat.text.includes("[]") &&
3961
+ !pat.text.includes("[^]") &&
3937
3962
  !pat.text.includes("][") &&
3938
3963
  !/\([^)]*[*+?][^)]*\)[*+?]/.test(pat.text)) {
3939
3964
  try {
@@ -14498,6 +14523,8 @@ export class Runtime {
14498
14523
  const p0 = w.parts[0];
14499
14524
  if (!p0 || !this.isPureSyncValueWord(w, rawState))
14500
14525
  return false;
14526
+ if (w.parts.some(part => part.kind === "substitution" || (part.kind === "text" && !part.quoted && part.value.includes("~"))))
14527
+ return false;
14501
14528
  if (p0.kind === "text" && !p0.quoted && p0.value.startsWith("~"))
14502
14529
  return false;
14503
14530
  if (inOptions) {
@@ -14881,6 +14908,7 @@ export class Runtime {
14881
14908
  const nInd = ne0?.tree?.kind === "binary" && ne0.tree.operator === "=" && ne0.tree.left.kind === "name" ? ne0.tree.left.name : undefined;
14882
14909
  if (nInd &&
14883
14910
  ne0 && ne1 && ne2 &&
14911
+ ![ne0, ne1, ne2].some(expression => arithmeticReadsOtherName(expression.tree, nInd)) &&
14884
14912
  !ne0.error && !ne0.hasSubscript && isSafeSmiProgram(ne0) &&
14885
14913
  !ne1.error && !ne1.hasSubscript && isSafeSmiProgram(ne1) &&
14886
14914
  !ne2.error && !ne2.hasSubscript && isSafeSmiProgram(ne2) &&
@@ -15972,14 +16000,8 @@ export class Runtime {
15972
16000
  const initial = rawState.variables[refName];
15973
16001
  if (initial !== undefined && initial !== "" && !/^-?[0-9]+$/.test(initial))
15974
16002
  return undefined;
15975
- for (let b = 0; b < bodyAssignments.length; b++) {
15976
- const step = bodyAssignments[b];
15977
- if (step.name === refName && !intSteps[b] && (!step.value || !step.value.parts.some(p => p.kind === "arithmetic") || step.value.parts.some(p => p.kind !== "arithmetic" && (p.kind !== "text" || p.value !== "")))) {
15978
- const isArrDefaultZero = step.value?.parts.length === 1 && step.value.parts[0].kind === "variable" && getArraySelector(step.value.parts[0])?.kind === "element" && step.value.parts[0].operator === ":-" && step.value.parts[0].alternate?.plain === "0";
15979
- if (!isArrDefaultZero)
15980
- return undefined;
15981
- }
15982
- }
16003
+ if (syncStepsMayWriteName(bodyAssignments, refName))
16004
+ return undefined;
15983
16005
  }
15984
16006
  }
15985
16007
  monitor.chargeInternal(syncRestorationCharge, syncRestorationTickets);
@@ -36849,7 +36871,7 @@ export class Runtime {
36849
36871
  firstName === "head" || firstName === "tail" || firstName === "wc" || firstName === "cat" || firstName === "date" || firstName === "cal" || firstName === "ncal" || firstName === "getopt" || firstName === "pathchk" || firstName === "printenv" || firstName === "env" || firstName === "mktemp" || firstName === "tee" || firstName === "touch" || firstName === "cp" || firstName === "mv" || firstName === "rmdir" || firstName === "sleep" || firstName === "chmod" || firstName === "patch" || firstName === "mkdir" || firstName === "rm" || firstName === "ln" || ((stageArgs.includes("--help") || stageArgs.includes("--version")) && gnuInformationSync(firstName, stageArgs) !== undefined)) {
36850
36872
  const rawBytes = prevBuf.subarray(0, prevLen);
36851
36873
  const readFile = (p) => this.tryReadMemoryFileViewSync(resolvePath(rawState.cwd, p), true, true);
36852
- const outStr = ((stageArgs.includes("--help") || stageArgs.includes("--version")) ? gnuInformationSync(firstName, stageArgs) : undefined) ?? (firstName === "envsubst"
36874
+ const outStr = ((stageArgs.includes("--help") || stageArgs.includes("--version")) ? gnuInformationSync(firstName, stageArgs, false, (rawState.exported.has("POSIXLY_CORRECT") || rawState.allexport) && rawState.variables.POSIXLY_CORRECT !== undefined) : undefined) ?? (firstName === "envsubst"
36853
36875
  ? this.evalSyncEnvsubst(inStr, stageArgs, rawState)
36854
36876
  : firstName === "fmt"
36855
36877
  ? this.evalSyncFmt(rawBytes, stageArgs, readFile)
@@ -37567,7 +37589,7 @@ export class Runtime {
37567
37589
  return undefined;
37568
37590
  }
37569
37591
  if (cmd.words.length === 2 && cmd.redirects.length === 0 && (cmd.words[1]?.plain === "--help" || cmd.words[1]?.plain === "--version")) {
37570
- const gnuInfo = gnuInformationSync(w0Plain, [cmd.words[1].plain]);
37592
+ const gnuInfo = gnuInformationSync(w0Plain, [cmd.words[1].plain], false, (rawState.exported.has("POSIXLY_CORRECT") || rawState.allexport) && rawState.variables.POSIXLY_CORRECT !== undefined);
37571
37593
  if (gnuInfo !== undefined) {
37572
37594
  const extDef = this.getExternalCommand(w0Plain);
37573
37595
  if (!extDef || !builtInDirectContextExecutors.has(extDef.execute))
@@ -38357,8 +38379,8 @@ export class Runtime {
38357
38379
  catch {
38358
38380
  return false;
38359
38381
  } }, (s, d, sym) => this.tryLinkMemoryNodeSync(sym ? s : resolvePath(rawState.cwd, s), resolvePath(rawState.cwd, d), sym))
38360
- : (allArgs.includes("--help") || allArgs.includes("--version")) && gnuInformationSync(w0Plain, allArgs) !== undefined
38361
- ? gnuInformationSync(w0Plain, allArgs)
38382
+ : (allArgs.includes("--help") || allArgs.includes("--version")) && gnuInformationSync(w0Plain, allArgs, false, (rawState.exported.has("POSIXLY_CORRECT") || rawState.allexport) && rawState.variables.POSIXLY_CORRECT !== undefined) !== undefined
38383
+ ? gnuInformationSync(w0Plain, allArgs, false, (rawState.exported.has("POSIXLY_CORRECT") || rawState.allexport) && rawState.variables.POSIXLY_CORRECT !== undefined)
38362
38384
  : w0Plain === "mdq"
38363
38385
  ? evalSyncMdq(inBytes, allArgs, readFile)
38364
38386
  : w0Plain === "shuf"
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_platform
3
- } from "../chunks/chunk-Q45QCA4J.js";
3
+ } from "../chunks/chunk-I3KSESCR.js";
4
4
 
5
5
  // packages/safe-bash/src/yq.browser.ts
6
6
  init_platform();