@poe-platform/safe-bash 0.1.726 → 0.1.727

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/safe-bash/chunks/{chunk-6VZX7ESE.js → chunk-26N7BLXE.js} +3 -3
  2. package/dist/safe-bash/chunks/{chunk-ZZ7JQBPX.js → chunk-4A2OLEML.js} +2 -2
  3. package/dist/safe-bash/chunks/{chunk-LTREB3HX.js → chunk-54MC6XF5.js} +4 -4
  4. package/dist/safe-bash/chunks/{chunk-Z3CCN6Y2.js → chunk-6J5FUESH.js} +2 -2
  5. package/dist/safe-bash/chunks/{chunk-YR5RZBWS.js → chunk-6TBFZ5JE.js} +2 -2
  6. package/dist/safe-bash/chunks/{chunk-6HJNJ625.js → chunk-7MMYQG3P.js} +2 -2
  7. package/dist/safe-bash/chunks/{chunk-WTZZX4LV.js → chunk-A4MB2KXV.js} +2 -2
  8. package/dist/safe-bash/chunks/{chunk-EM2JW7ZH.js → chunk-ATYJKRBZ.js} +2 -2
  9. package/dist/safe-bash/chunks/{chunk-VV24PRPB.js → chunk-AZQOEGP3.js} +1050 -101
  10. package/dist/safe-bash/chunks/chunk-AZQOEGP3.js.map +7 -0
  11. package/dist/safe-bash/chunks/{chunk-EFMXWUYE.js → chunk-B6JEJ6AT.js} +2 -2
  12. package/dist/safe-bash/chunks/{chunk-JFGGQUYP.js → chunk-BFXGHT3R.js} +2 -2
  13. package/dist/safe-bash/chunks/{chunk-RP5IZOOR.js → chunk-BJYV5J65.js} +1050 -101
  14. package/dist/safe-bash/chunks/chunk-BJYV5J65.js.map +7 -0
  15. package/dist/safe-bash/chunks/{chunk-HNHOPD3P.js → chunk-DIEFWGXO.js} +46 -26
  16. package/dist/safe-bash/chunks/{chunk-HNHOPD3P.js.map → chunk-DIEFWGXO.js.map} +2 -2
  17. package/dist/safe-bash/chunks/{chunk-SME47P4B.js → chunk-DV6EZOKM.js} +46 -26
  18. package/dist/safe-bash/chunks/{chunk-SME47P4B.js.map → chunk-DV6EZOKM.js.map} +2 -2
  19. package/dist/safe-bash/chunks/{chunk-646RTREQ.js → chunk-EEDOYIPC.js} +2 -2
  20. package/dist/safe-bash/chunks/{chunk-OFAAHWL5.js → chunk-GCQ5A2T2.js} +2 -2
  21. package/dist/safe-bash/chunks/{chunk-MJW4KSKV.js → chunk-GLPJEDLY.js} +2 -2
  22. package/dist/safe-bash/chunks/{chunk-FOOJWH7J.js → chunk-GO5OKPBO.js} +4 -4
  23. package/dist/safe-bash/chunks/{chunk-5JANWFJ3.js → chunk-GWYXCCGO.js} +4 -4
  24. package/dist/safe-bash/chunks/{chunk-DPHRNHPT.js → chunk-H6KJ4L22.js} +2 -2
  25. package/dist/safe-bash/chunks/{chunk-FLX2BZBF.js → chunk-HGBYIDAK.js} +4 -4
  26. package/dist/safe-bash/chunks/{chunk-VGJIDLZM.js → chunk-KS5VSJYM.js} +15 -8
  27. package/dist/safe-bash/chunks/chunk-KS5VSJYM.js.map +7 -0
  28. package/dist/safe-bash/chunks/{chunk-PO3Z7W3A.js → chunk-MUHYGUFD.js} +4 -4
  29. package/dist/safe-bash/chunks/{chunk-5DLGYPGJ.js → chunk-PDSTXORC.js} +126 -58
  30. package/dist/safe-bash/chunks/chunk-PDSTXORC.js.map +7 -0
  31. package/dist/safe-bash/chunks/{chunk-TIHMU25L.js → chunk-PQ37GDJF.js} +3 -3
  32. package/dist/safe-bash/chunks/{chunk-OTM5RCWZ.js → chunk-QNEDWYC2.js} +15 -8
  33. package/dist/safe-bash/chunks/chunk-QNEDWYC2.js.map +7 -0
  34. package/dist/safe-bash/chunks/{chunk-LZ7FUN6K.js → chunk-RHHDOA67.js} +5 -5
  35. package/dist/safe-bash/chunks/{chunk-DSCL3VA2.js → chunk-SJ3B26XV.js} +4 -4
  36. package/dist/safe-bash/chunks/{chunk-6JBTVWHH.js → chunk-SWACYEIT.js} +5 -5
  37. package/dist/safe-bash/chunks/{chunk-7UJW7TYR.js → chunk-TD6NWAUK.js} +126 -58
  38. package/dist/safe-bash/chunks/chunk-TD6NWAUK.js.map +7 -0
  39. package/dist/safe-bash/chunks/{chunk-Q4I754TV.js → chunk-THOBFD5C.js} +2 -2
  40. package/dist/safe-bash/chunks/{chunk-XELW5O3R.js → chunk-U2STHT7S.js} +2 -2
  41. package/dist/safe-bash/chunks/{chunk-5X4SOSTT.js → chunk-UJHE5PTK.js} +2 -2
  42. package/dist/safe-bash/chunks/{chunk-B6YFFKYG.js → chunk-X4I3RHTC.js} +5 -1
  43. package/dist/safe-bash/chunks/chunk-X4I3RHTC.js.map +7 -0
  44. package/dist/safe-bash/chunks/{chunk-YOK5UHA7.js → chunk-XKXFX3RH.js} +5 -1
  45. package/dist/safe-bash/chunks/chunk-XKXFX3RH.js.map +7 -0
  46. package/dist/safe-bash/chunks/{chunk-PLCYP2E5.js → chunk-XV4K3UUF.js} +2 -2
  47. package/dist/safe-bash/commands/csplit/index.browser.js +2 -2
  48. package/dist/safe-bash/commands/factor/index.browser.js +2 -2
  49. package/dist/safe-bash/commands/getopt/index.browser.js +2 -2
  50. package/dist/safe-bash/commands/hexdump/index.browser.js +2 -2
  51. package/dist/safe-bash/commands/iconv/index.browser.js +2 -2
  52. package/dist/safe-bash/commands/internal.d.ts.map +1 -1
  53. package/dist/safe-bash/commands/internal.js +4 -3
  54. package/dist/safe-bash/commands/internal.js.map +1 -1
  55. package/dist/safe-bash/commands/line-endings/index.browser.js +2 -2
  56. package/dist/safe-bash/commands/llm/index.browser.js +4 -4
  57. package/dist/safe-bash/commands/network/index.browser.js +4 -4
  58. package/dist/safe-bash/commands/node/index.browser.js +4 -4
  59. package/dist/safe-bash/commands/pandoc/index.js.map +1 -1
  60. package/dist/safe-bash/commands/pr/index.browser.js +3 -3
  61. package/dist/safe-bash/commands/python/index.browser.js +2 -2
  62. package/dist/safe-bash/commands/record-buffer.d.ts.map +1 -1
  63. package/dist/safe-bash/commands/record-buffer.js +12 -4
  64. package/dist/safe-bash/commands/record-buffer.js.map +1 -1
  65. package/dist/safe-bash/commands/regex-execution/bounded-provider.d.ts.map +1 -1
  66. package/dist/safe-bash/commands/regex-execution/bounded-provider.js +75 -8
  67. package/dist/safe-bash/commands/regex-execution/bounded-provider.js.map +1 -1
  68. package/dist/safe-bash/commands/regex-execution/ere/limits.d.ts +1 -1
  69. package/dist/safe-bash/commands/regex-execution/ere/limits.d.ts.map +1 -1
  70. package/dist/safe-bash/commands/regex-execution/ere/limits.js +6 -4
  71. package/dist/safe-bash/commands/regex-execution/ere/limits.js.map +1 -1
  72. package/dist/safe-bash/commands/regex-execution/portable.d.ts.map +1 -1
  73. package/dist/safe-bash/commands/regex-execution/portable.js +7 -2
  74. package/dist/safe-bash/commands/regex-execution/portable.js.map +1 -1
  75. package/dist/safe-bash/commands/regex-execution/protocol.d.ts +2 -0
  76. package/dist/safe-bash/commands/regex-execution/protocol.d.ts.map +1 -1
  77. package/dist/safe-bash/commands/regex-execution/protocol.js +26 -0
  78. package/dist/safe-bash/commands/regex-execution/protocol.js.map +1 -1
  79. package/dist/safe-bash/commands/regex-execution/utf8.d.ts +1 -1
  80. package/dist/safe-bash/commands/regex-execution/utf8.d.ts.map +1 -1
  81. package/dist/safe-bash/commands/regex-execution/utf8.js +26 -2
  82. package/dist/safe-bash/commands/regex-execution/utf8.js.map +1 -1
  83. package/dist/safe-bash/commands/search/grep.d.ts.map +1 -1
  84. package/dist/safe-bash/commands/search/grep.js +109 -15
  85. package/dist/safe-bash/commands/search/grep.js.map +1 -1
  86. package/dist/safe-bash/commands/search/matcher.d.ts +1 -1
  87. package/dist/safe-bash/commands/search/matcher.d.ts.map +1 -1
  88. package/dist/safe-bash/commands/search/matcher.js +2 -0
  89. package/dist/safe-bash/commands/search/matcher.js.map +1 -1
  90. package/dist/safe-bash/commands/search/shared.d.ts.map +1 -1
  91. package/dist/safe-bash/commands/search/shared.js +23 -12
  92. package/dist/safe-bash/commands/search/shared.js.map +1 -1
  93. package/dist/safe-bash/commands/standard.d.ts.map +1 -1
  94. package/dist/safe-bash/commands/standard.js +22 -0
  95. package/dist/safe-bash/commands/standard.js.map +1 -1
  96. package/dist/safe-bash/commands/streams.d.ts.map +1 -1
  97. package/dist/safe-bash/commands/streams.js +54 -10
  98. package/dist/safe-bash/commands/streams.js.map +1 -1
  99. package/dist/safe-bash/commands/structured/input.d.ts.map +1 -1
  100. package/dist/safe-bash/commands/structured/input.js +484 -55
  101. package/dist/safe-bash/commands/structured/input.js.map +1 -1
  102. package/dist/safe-bash/commands/structured/interpreter.d.ts +3 -0
  103. package/dist/safe-bash/commands/structured/interpreter.d.ts.map +1 -1
  104. package/dist/safe-bash/commands/structured/interpreter.js +157 -1
  105. package/dist/safe-bash/commands/structured/interpreter.js.map +1 -1
  106. package/dist/safe-bash/commands/structured/jq.d.ts.map +1 -1
  107. package/dist/safe-bash/commands/structured/jq.js +50 -24
  108. package/dist/safe-bash/commands/structured/jq.js.map +1 -1
  109. package/dist/safe-bash/commands/structured/limits.d.ts +5 -0
  110. package/dist/safe-bash/commands/structured/limits.d.ts.map +1 -1
  111. package/dist/safe-bash/commands/structured/limits.js +51 -36
  112. package/dist/safe-bash/commands/structured/limits.js.map +1 -1
  113. package/dist/safe-bash/commands/structured/numbers.d.ts +1 -0
  114. package/dist/safe-bash/commands/structured/numbers.d.ts.map +1 -1
  115. package/dist/safe-bash/commands/structured/numbers.js +32 -0
  116. package/dist/safe-bash/commands/structured/numbers.js.map +1 -1
  117. package/dist/safe-bash/commands/text-programs/awk-reader.d.ts +1 -0
  118. package/dist/safe-bash/commands/text-programs/awk-reader.d.ts.map +1 -1
  119. package/dist/safe-bash/commands/text-programs/awk-reader.js +41 -5
  120. package/dist/safe-bash/commands/text-programs/awk-reader.js.map +1 -1
  121. package/dist/safe-bash/commands/text-programs/awk-retention.d.ts +1 -0
  122. package/dist/safe-bash/commands/text-programs/awk-retention.d.ts.map +1 -1
  123. package/dist/safe-bash/commands/text-programs/awk-retention.js +9 -0
  124. package/dist/safe-bash/commands/text-programs/awk-retention.js.map +1 -1
  125. package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts +13 -0
  126. package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts.map +1 -1
  127. package/dist/safe-bash/commands/text-programs/awk-runtime.js +421 -83
  128. package/dist/safe-bash/commands/text-programs/awk-runtime.js.map +1 -1
  129. package/dist/safe-bash/commands/text-programs/awk-values.d.ts.map +1 -1
  130. package/dist/safe-bash/commands/text-programs/awk-values.js +21 -0
  131. package/dist/safe-bash/commands/text-programs/awk-values.js.map +1 -1
  132. package/dist/safe-bash/commands/text-programs/regex.d.ts +15 -2
  133. package/dist/safe-bash/commands/text-programs/regex.d.ts.map +1 -1
  134. package/dist/safe-bash/commands/text-programs/regex.js +501 -13
  135. package/dist/safe-bash/commands/text-programs/regex.js.map +1 -1
  136. package/dist/safe-bash/commands/text-programs/sed.d.ts.map +1 -1
  137. package/dist/safe-bash/commands/text-programs/sed.js +242 -102
  138. package/dist/safe-bash/commands/text-programs/sed.js.map +1 -1
  139. package/dist/safe-bash/commands/text-programs/shared.d.ts +2 -0
  140. package/dist/safe-bash/commands/text-programs/shared.d.ts.map +1 -1
  141. package/dist/safe-bash/commands/text-programs/shared.js +36 -0
  142. package/dist/safe-bash/commands/text-programs/shared.js.map +1 -1
  143. package/dist/safe-bash/commands/text.d.ts.map +1 -1
  144. package/dist/safe-bash/commands/text.js +136 -19
  145. package/dist/safe-bash/commands/text.js.map +1 -1
  146. package/dist/safe-bash/commands/tsort/index.browser.js +2 -2
  147. package/dist/safe-bash/commands/xml/index.browser.js +5 -5
  148. package/dist/safe-bash/commands/yq/index.browser.js +5 -5
  149. package/dist/safe-bash/contracts/yield.d.ts +1 -0
  150. package/dist/safe-bash/contracts/yield.d.ts.map +1 -1
  151. package/dist/safe-bash/contracts/yield.js +3 -0
  152. package/dist/safe-bash/contracts/yield.js.map +1 -1
  153. package/dist/safe-bash/core.browser.js +1052 -256
  154. package/dist/safe-bash/core.browser.js.map +3 -3
  155. package/dist/safe-bash/plugins/composition.d.ts +1 -0
  156. package/dist/safe-bash/plugins/composition.d.ts.map +1 -1
  157. package/dist/safe-bash/plugins/composition.js +80 -2
  158. package/dist/safe-bash/plugins/composition.js.map +1 -1
  159. package/dist/safe-bash/plugins/index.d.ts.map +1 -1
  160. package/dist/safe-bash/plugins/index.js +2 -2
  161. package/dist/safe-bash/plugins/index.js.map +1 -1
  162. package/dist/safe-bash-command-fold/arguments.d.ts +1 -1
  163. package/dist/safe-bash-command-fold/contracts.d.ts +2 -1
  164. package/dist/safe-bash-command-fold/engine.d.ts +1 -1
  165. package/dist/safe-bash-command-fold/index.js +10 -8
  166. package/dist/safe-bash-command-fold/index.js.map +2 -2
  167. package/dist/safe-bash-command-sips/index.js +231 -67
  168. package/dist/safe-bash-command-sips/index.js.map +2 -2
  169. package/dist/safe-bash-command-unrtf/contracts.d.ts +5 -2
  170. package/dist/safe-bash-command-unrtf/index.js +6 -5
  171. package/dist/safe-bash-command-unrtf/index.js.map +2 -2
  172. package/dist/safe-playwright-cloudflare/browser-run-code.js +22 -6
  173. package/package.json +2 -2
  174. package/dist/safe-bash/chunks/chunk-5DLGYPGJ.js.map +0 -7
  175. package/dist/safe-bash/chunks/chunk-7UJW7TYR.js.map +0 -7
  176. package/dist/safe-bash/chunks/chunk-B6YFFKYG.js.map +0 -7
  177. package/dist/safe-bash/chunks/chunk-OTM5RCWZ.js.map +0 -7
  178. package/dist/safe-bash/chunks/chunk-RP5IZOOR.js.map +0 -7
  179. package/dist/safe-bash/chunks/chunk-VGJIDLZM.js.map +0 -7
  180. package/dist/safe-bash/chunks/chunk-VV24PRPB.js.map +0 -7
  181. package/dist/safe-bash/chunks/chunk-YOK5UHA7.js.map +0 -7
  182. /package/dist/safe-bash/chunks/{chunk-6VZX7ESE.js.map → chunk-26N7BLXE.js.map} +0 -0
  183. /package/dist/safe-bash/chunks/{chunk-ZZ7JQBPX.js.map → chunk-4A2OLEML.js.map} +0 -0
  184. /package/dist/safe-bash/chunks/{chunk-LTREB3HX.js.map → chunk-54MC6XF5.js.map} +0 -0
  185. /package/dist/safe-bash/chunks/{chunk-Z3CCN6Y2.js.map → chunk-6J5FUESH.js.map} +0 -0
  186. /package/dist/safe-bash/chunks/{chunk-YR5RZBWS.js.map → chunk-6TBFZ5JE.js.map} +0 -0
  187. /package/dist/safe-bash/chunks/{chunk-6HJNJ625.js.map → chunk-7MMYQG3P.js.map} +0 -0
  188. /package/dist/safe-bash/chunks/{chunk-WTZZX4LV.js.map → chunk-A4MB2KXV.js.map} +0 -0
  189. /package/dist/safe-bash/chunks/{chunk-EM2JW7ZH.js.map → chunk-ATYJKRBZ.js.map} +0 -0
  190. /package/dist/safe-bash/chunks/{chunk-EFMXWUYE.js.map → chunk-B6JEJ6AT.js.map} +0 -0
  191. /package/dist/safe-bash/chunks/{chunk-JFGGQUYP.js.map → chunk-BFXGHT3R.js.map} +0 -0
  192. /package/dist/safe-bash/chunks/{chunk-646RTREQ.js.map → chunk-EEDOYIPC.js.map} +0 -0
  193. /package/dist/safe-bash/chunks/{chunk-OFAAHWL5.js.map → chunk-GCQ5A2T2.js.map} +0 -0
  194. /package/dist/safe-bash/chunks/{chunk-MJW4KSKV.js.map → chunk-GLPJEDLY.js.map} +0 -0
  195. /package/dist/safe-bash/chunks/{chunk-FOOJWH7J.js.map → chunk-GO5OKPBO.js.map} +0 -0
  196. /package/dist/safe-bash/chunks/{chunk-5JANWFJ3.js.map → chunk-GWYXCCGO.js.map} +0 -0
  197. /package/dist/safe-bash/chunks/{chunk-DPHRNHPT.js.map → chunk-H6KJ4L22.js.map} +0 -0
  198. /package/dist/safe-bash/chunks/{chunk-FLX2BZBF.js.map → chunk-HGBYIDAK.js.map} +0 -0
  199. /package/dist/safe-bash/chunks/{chunk-PO3Z7W3A.js.map → chunk-MUHYGUFD.js.map} +0 -0
  200. /package/dist/safe-bash/chunks/{chunk-TIHMU25L.js.map → chunk-PQ37GDJF.js.map} +0 -0
  201. /package/dist/safe-bash/chunks/{chunk-LZ7FUN6K.js.map → chunk-RHHDOA67.js.map} +0 -0
  202. /package/dist/safe-bash/chunks/{chunk-DSCL3VA2.js.map → chunk-SJ3B26XV.js.map} +0 -0
  203. /package/dist/safe-bash/chunks/{chunk-6JBTVWHH.js.map → chunk-SWACYEIT.js.map} +0 -0
  204. /package/dist/safe-bash/chunks/{chunk-Q4I754TV.js.map → chunk-THOBFD5C.js.map} +0 -0
  205. /package/dist/safe-bash/chunks/{chunk-XELW5O3R.js.map → chunk-U2STHT7S.js.map} +0 -0
  206. /package/dist/safe-bash/chunks/{chunk-5X4SOSTT.js.map → chunk-UJHE5PTK.js.map} +0 -0
  207. /package/dist/safe-bash/chunks/{chunk-PLCYP2E5.js.map → chunk-XV4K3UUF.js.map} +0 -0
@@ -18,20 +18,20 @@ import {
18
18
  stringify,
19
19
  truth,
20
20
  wellFormed
21
- } from "./chunk-RP5IZOOR.js";
21
+ } from "./chunk-BJYV5J65.js";
22
22
  import {
23
23
  shellValueByteLength
24
24
  } from "./chunk-RA4KWAKW.js";
25
25
  import {
26
26
  pathOf
27
- } from "./chunk-VGJIDLZM.js";
27
+ } from "./chunk-KS5VSJYM.js";
28
28
  import {
29
29
  escapeText,
30
30
  writeDiagnostic
31
- } from "./chunk-WTZZX4LV.js";
31
+ } from "./chunk-A4MB2KXV.js";
32
32
  import {
33
33
  yieldTurn
34
- } from "./chunk-B6YFFKYG.js";
34
+ } from "./chunk-X4I3RHTC.js";
35
35
  import {
36
36
  getCommandArguments
37
37
  } from "./chunk-P7NFUYPJ.js";
@@ -954,6 +954,7 @@ async function executeJq(context, limits, convert) {
954
954
  let diagnosticWriteFailed = false;
955
955
  let stdoutWriteFailed = false;
956
956
  const flush = async (force = false) => {
957
+ if (!diagnostics.length) return;
957
958
  let written = 0;
958
959
  try {
959
960
  while (written < diagnostics.length && (force || diagnostics[written].location.complete)) {
@@ -976,10 +977,47 @@ async function executeJq(context, limits, convert) {
976
977
  const interpreter = new Interpreter(budget, options.variables);
977
978
  let last;
978
979
  let status = 0;
980
+ const suffix = options.rawOutput0 ? "\0" : options.joinOutput ? "" : "\n";
981
+ const publishResult = async (result) => {
982
+ const pt = budget.tickSync();
983
+ if (pt) await pt;
984
+ budget.value(result);
985
+ if (++budget.results > limits.maxResults) throw new JqLimitError("maxResults");
986
+ const remaining = limits.maxOutputBytes - budget.outputBytes;
987
+ const prefix = options.sequence && !(options.raw && typeof result === "string") ? "" : "";
988
+ const output = options.sortKeys ? await sortObjectKeys(result, budget) : result;
989
+ const rawString = options.raw && typeof output === "string";
990
+ const format = rawString ? { ...options.format, color: false } : options.format;
991
+ const text = rawString && !format.ascii ? output : await stringify(output, budget, format, Math.max(0, remaining - suffix.length - prefix.length), "maxOutputBytes");
992
+ const chunkText = `${prefix}${text}${suffix}`;
993
+ const byteLen = import_buffer.Buffer.byteLength(chunkText);
994
+ if (byteLen > remaining) throw new JqLimitError("maxOutputBytes");
995
+ budget.outputBytes += byteLen;
996
+ try {
997
+ await writeBytes(context.stdout, import_buffer.Buffer.from(chunkText), context.signal);
998
+ } catch (error) {
999
+ stdoutWriteFailed = true;
1000
+ throw error;
1001
+ }
1002
+ };
979
1003
  const emit = async (input2) => {
980
- await flush();
1004
+ if (diagnostics.length) await flush();
981
1005
  status = options.exitStatus ? last === void 0 ? 4 : truth(last) ? 0 : 1 : 0;
982
1006
  let invocationLast;
1007
+ if (!options.rawOutput0) {
1008
+ const syncResults = interpreter.tryRunSync(ast, input2);
1009
+ if (syncResults !== void 0) {
1010
+ for (let i = 0; i < syncResults.length; i++) {
1011
+ const result = syncResults[i];
1012
+ await publishResult(result);
1013
+ invocationLast = result;
1014
+ status = options.exitStatus ? truth(result) ? 0 : 1 : 0;
1015
+ }
1016
+ if (status < 2 && invocationLast !== void 0) last = invocationLast;
1017
+ if (diagnostics.length) await flush();
1018
+ return;
1019
+ }
1020
+ }
983
1021
  const iterator = interpreter.run(ast, input2);
984
1022
  try {
985
1023
  while (true) {
@@ -1002,25 +1040,7 @@ async function executeJq(context, limits, convert) {
1002
1040
  }
1003
1041
  if (next.done) break;
1004
1042
  const result = next.value;
1005
- await budget.tick();
1006
- budget.value(result);
1007
- if (++budget.results > limits.maxResults) throw new JqLimitError("maxResults");
1008
- const remaining = limits.maxOutputBytes - budget.outputBytes;
1009
- const suffix = options.rawOutput0 ? "\0" : options.joinOutput ? "" : "\n";
1010
- const prefix = options.sequence && !(options.raw && typeof result === "string") ? "" : "";
1011
- const output = options.sortKeys ? await sortObjectKeys(result, budget) : result;
1012
- const rawString = options.raw && typeof output === "string";
1013
- const format = rawString ? { ...options.format, color: false } : options.format;
1014
- const text = rawString && !format.ascii ? output : await stringify(output, budget, format, Math.max(0, remaining - suffix.length - prefix.length), "maxOutputBytes");
1015
- if (prefix.length + import_buffer.Buffer.byteLength(text) + suffix.length > remaining) throw new JqLimitError("maxOutputBytes");
1016
- const bytes = import_buffer.Buffer.from(`${prefix}${text}${suffix}`);
1017
- budget.outputBytes += bytes.byteLength;
1018
- try {
1019
- await writeBytes(context.stdout, bytes, context.signal);
1020
- } catch (error) {
1021
- stdoutWriteFailed = true;
1022
- throw error;
1023
- }
1043
+ await publishResult(result);
1024
1044
  invocationLast = result;
1025
1045
  status = options.exitStatus ? truth(result) ? 0 : 1 : 0;
1026
1046
  }
@@ -1028,7 +1048,7 @@ async function executeJq(context, limits, convert) {
1028
1048
  await iterator.return(void 0);
1029
1049
  }
1030
1050
  if (status < 2 && invocationLast !== void 0) last = invocationLast;
1031
- await flush();
1051
+ if (diagnostics.length) await flush();
1032
1052
  };
1033
1053
  if (options.nullInput) {
1034
1054
  await emit(null);
@@ -1336,4 +1356,4 @@ export {
1336
1356
  createXmlCommands,
1337
1357
  xmlCommands
1338
1358
  };
1339
- //# sourceMappingURL=chunk-HNHOPD3P.js.map
1359
+ //# sourceMappingURL=chunk-DIEFWGXO.js.map