@poe-platform/safe-bash 0.1.826 → 0.1.828

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 (174) hide show
  1. package/dist/image-ast/index.js +39 -18
  2. package/dist/pdf-ast/image.js +1 -1
  3. package/dist/pdf-ast/index.js +1 -1
  4. package/dist/pdf-ast/vendor/pdfjs-fonts.mjs +9 -3
  5. package/dist/safe-bash/chunks/{chunk-VWLQDZFF.js → chunk-C7RBTLYX.js} +12 -5
  6. package/dist/safe-bash/chunks/{chunk-TZRVK3NU.js → chunk-HWYINF6Y.js} +1 -1
  7. package/dist/safe-bash/chunks/{chunk-AGHV53VF.js → chunk-M6XFU6LQ.js} +3 -1
  8. package/dist/safe-bash/chunks/{chunk-ZJAXMB5M.js → chunk-SGHFQIZB.js} +1 -1
  9. package/dist/safe-bash/chunks/{chunk-363QOIDR.js → chunk-T6FHWSHM.js} +3 -1
  10. package/dist/safe-bash/chunks/{chunk-RAFD5ZAH.js → chunk-Y67A2DE4.js} +1 -1
  11. package/dist/safe-bash/command-chunks/{chunk-VKTM2SOL.js → chunk-2EEIB5O3.js} +192 -489
  12. package/dist/safe-bash/command-chunks/{chunk-FMGNXOMV.js → chunk-2L3NMRLG.js} +7 -3
  13. package/dist/safe-bash/command-chunks/{chunk-DAQO64WC.js → chunk-2YKOJPIW.js} +1 -1
  14. package/dist/safe-bash/command-chunks/{chunk-EPYJSPOY.js → chunk-3QCW4VQF.js} +12 -8
  15. package/dist/safe-bash/command-chunks/{chunk-YRBFNT5B.js → chunk-3YL2TMLA.js} +10 -1
  16. package/dist/safe-bash/command-chunks/{chunk-UWIDPTOB.js → chunk-3ZCABR5P.js} +1 -1
  17. package/dist/safe-bash/command-chunks/{chunk-5H7ZHP7F.js → chunk-43NDRBKY.js} +1 -1
  18. package/dist/safe-bash/command-chunks/{chunk-BBOYR6LV.js → chunk-46GA576V.js} +3 -3
  19. package/dist/safe-bash/command-chunks/{chunk-WPT2FCHH.js → chunk-4SLPM2WM.js} +1 -1
  20. package/dist/safe-bash/command-chunks/{chunk-7ZQVMPSB.js → chunk-5CAXR62E.js} +1 -1
  21. package/dist/safe-bash/command-chunks/{chunk-3DTHX5UU.js → chunk-66653AEZ.js} +40 -14
  22. package/dist/safe-bash/command-chunks/{chunk-ETFJ4L7F.js → chunk-6OLE6CLV.js} +1 -1
  23. package/dist/safe-bash/command-chunks/{chunk-2KMNVJB7.js → chunk-A7PKUIJT.js} +1 -1
  24. package/dist/safe-bash/command-chunks/{chunk-O3FTKLWR.js → chunk-BXOBM4HJ.js} +26 -17
  25. package/dist/safe-bash/command-chunks/{chunk-P66Q5F6K.js → chunk-DEQ47SBQ.js} +3 -3
  26. package/dist/safe-bash/command-chunks/{chunk-ZPBL7TYJ.js → chunk-EF3RAQ7M.js} +1 -1
  27. package/dist/safe-bash/command-chunks/{chunk-RQTFK7AV.js → chunk-EOO3NLD5.js} +1 -1
  28. package/dist/safe-bash/command-chunks/{chunk-EV7A5FNN.js → chunk-FFFRLPXU.js} +2 -2
  29. package/dist/safe-bash/command-chunks/{chunk-MQCLG2CT.js → chunk-FMXBLKWO.js} +1 -1
  30. package/dist/safe-bash/command-chunks/{chunk-4MVQE6CT.js → chunk-FYTBEGSY.js} +1 -1
  31. package/dist/safe-bash/command-chunks/chunk-HS2L7I4N.js +219 -0
  32. package/dist/safe-bash/command-chunks/{chunk-NXZJJM4J.js → chunk-IGXH5W5Z.js} +1 -1
  33. package/dist/safe-bash/command-chunks/{chunk-CMJBRGU2.js → chunk-IHQZKUBS.js} +1 -1
  34. package/dist/safe-bash/command-chunks/chunk-JADJ4BMN.js +1519 -0
  35. package/dist/safe-bash/command-chunks/{chunk-5AQAWIYK.js → chunk-JEZC5V3B.js} +4 -0
  36. package/dist/safe-bash/command-chunks/{chunk-YB5TNDY6.js → chunk-K5VJ4NNL.js} +39 -5
  37. package/dist/safe-bash/command-chunks/{chunk-7RQGRFHJ.js → chunk-KHWDEAE4.js} +2 -2
  38. package/dist/safe-bash/command-chunks/chunk-KSCVKF7I.js +604 -0
  39. package/dist/safe-bash/command-chunks/{chunk-3NJETNC2.js → chunk-MBXNG6C3.js} +2 -2
  40. package/dist/safe-bash/command-chunks/{chunk-WKS2PAZL.js → chunk-N63IGO5F.js} +10 -1
  41. package/dist/safe-bash/command-chunks/{chunk-3DID6MQY.js → chunk-OWTQYLID.js} +2 -2
  42. package/dist/safe-bash/command-chunks/{chunk-4EA7WI3L.js → chunk-QOOQD6BD.js} +42 -33
  43. package/dist/safe-bash/command-chunks/{chunk-R3SLT3ZX.js → chunk-R6GON4H3.js} +11 -1
  44. package/dist/safe-bash/command-chunks/{chunk-2GILUQJY.js → chunk-R7ZGDHME.js} +3 -3
  45. package/dist/safe-bash/command-chunks/{chunk-LKAFLJ5L.js → chunk-RWQKX44L.js} +1 -1
  46. package/dist/safe-bash/command-chunks/{chunk-PKH57OIC.js → chunk-SG2KOOD4.js} +2 -2
  47. package/dist/safe-bash/command-chunks/{chunk-HCPEYQKT.js → chunk-SIAN5LI3.js} +286 -307
  48. package/dist/safe-bash/command-chunks/chunk-T4TGJYFV.js +60 -0
  49. package/dist/safe-bash/command-chunks/{chunk-T7RT2BNL.js → chunk-U5TQVW64.js} +191 -146
  50. package/dist/safe-bash/command-chunks/{chunk-NXCJNPL3.js → chunk-UCE77LYV.js} +2 -1
  51. package/dist/safe-bash/command-chunks/{chunk-OT75C5YS.js → chunk-UGDQSGUZ.js} +1 -1
  52. package/dist/safe-bash/command-chunks/{chunk-EWECMOQ5.js → chunk-UIHPHIKI.js} +1 -1
  53. package/dist/safe-bash/command-chunks/{chunk-4XYGJB24.js → chunk-VJXPNNBD.js} +3 -3
  54. package/dist/safe-bash/command-chunks/{chunk-E5CDHXFA.js → chunk-VOR6YDZC.js} +26 -1
  55. package/dist/safe-bash/command-chunks/{chunk-ZIDESNHW.js → chunk-VQINIBCZ.js} +1 -1
  56. package/dist/safe-bash/command-chunks/chunk-VSNVYOK2.js +30 -0
  57. package/dist/safe-bash/command-chunks/{chunk-Q2ACHUTY.js → chunk-WRO3PB2M.js} +1 -1
  58. package/dist/safe-bash/command-chunks/{chunk-RUAGHZNF.js → chunk-X5ODTF3E.js} +7 -5
  59. package/dist/safe-bash/command-chunks/{chunk-LH4VBNF6.js → chunk-XGTSP2CP.js} +84 -16
  60. package/dist/safe-bash/command-chunks/{chunk-J3VS55K4.js → chunk-YHRESVJ7.js} +9 -3
  61. package/dist/safe-bash/command-chunks/{chunk-K576GZED.js → chunk-YK6ZVCA2.js} +2 -2
  62. package/dist/safe-bash/command-chunks/{chunk-W5LH7D23.js → chunk-YR2A2L4J.js} +8 -8
  63. package/dist/safe-bash/command-chunks/{chunk-UYNJF5QN.js → chunk-ZALAWNOE.js} +76 -122
  64. package/dist/safe-bash/command-chunks/{pdf-renderer-346WYKSZ.js → pdf-renderer-5QWOVFA4.js} +1 -1
  65. package/dist/safe-bash/command-chunks/{prompt-tool-debug-3POFNRYP.js → prompt-tool-debug-G7ATE7D5.js} +6 -4
  66. package/dist/safe-bash/commands/bc/index.browser.js +1 -1
  67. package/dist/safe-bash/commands/llm/index.browser.js +5 -1
  68. package/dist/safe-bash/commands/llm/index.js +1 -1
  69. package/dist/safe-bash/commands/python/executor.browser.js +3 -1
  70. package/dist/safe-bash/commands/python/executor.js +1 -1
  71. package/dist/safe-bash/commands/python/index.browser.js +5 -1
  72. package/dist/safe-bash/commands/python/index.js +1 -1
  73. package/dist/safe-bash/core.browser.js +2 -2
  74. package/dist/safe-bash/full-core.browser.js +14 -6
  75. package/dist/safe-bash/plugins/index.browser.js +3 -3
  76. package/dist/safe-bash/registry-entry.browser.js +2 -2
  77. package/dist/safe-bash/search.browser.js +1 -1
  78. package/dist/safe-bash/shell/runtime.js +18 -7
  79. package/dist/safe-bash/shell/sync-extra-evaluators.js +2 -0
  80. package/dist/safe-bash/shell-entry.browser.js +2 -2
  81. package/dist/safe-bash-command-awk/awk-runtime.js +2 -2
  82. package/dist/safe-bash-command-awk/awk-syntax.js +1 -1
  83. package/dist/safe-bash-command-awk/awk.js +3 -3
  84. package/dist/safe-bash-command-awk/index.js +3 -3
  85. package/dist/safe-bash-command-ffmpeg/index.js +15 -12
  86. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  87. package/dist/safe-bash-command-ffprobe/media.js +2 -2
  88. package/dist/safe-bash-command-git/git_rust.wasm +0 -0
  89. package/dist/safe-bash-command-gpg/index.js +11 -3
  90. package/dist/safe-bash-command-imagemagick/index.js +45 -12
  91. package/dist/safe-bash-command-llm/collections.js +6 -4
  92. package/dist/safe-bash-command-llm/command.js +4 -4
  93. package/dist/safe-bash-command-llm/import-json-document.d.ts +9 -2
  94. package/dist/safe-bash-command-llm/index.d.ts +2 -1
  95. package/dist/safe-bash-command-llm/index.js +10 -4
  96. package/dist/safe-bash-command-llm/loader-provider.d.ts +5 -0
  97. package/dist/safe-bash-command-mcp/index.js +10 -13
  98. package/dist/safe-bash-command-pdftoppm/index.js +2 -2
  99. package/dist/safe-bash-command-playwright-cli/index.js +2 -2
  100. package/dist/safe-bash-command-playwright-cli/playwright/ability-execution.d.ts +1 -0
  101. package/dist/safe-bash-command-playwright-cli/playwright/ability-execution.js +1 -1
  102. package/dist/safe-bash-command-playwright-cli/playwright/controller.d.ts +2 -0
  103. package/dist/safe-bash-command-playwright-cli/playwright/controller.js +2 -2
  104. package/dist/safe-bash-command-playwright-cli/playwright/index.js +2 -2
  105. package/dist/safe-bash-command-python/build-backend.d.ts +2 -0
  106. package/dist/safe-bash-command-python/cache.d.ts +1 -1
  107. package/dist/safe-bash-command-python/executor.d.ts +5 -2
  108. package/dist/safe-bash-command-python/executor.js +11 -6
  109. package/dist/safe-bash-command-python/host-capabilities.js +1 -1
  110. package/dist/safe-bash-command-python/index.js +11 -6
  111. package/dist/safe-bash-command-python/jspi.js +5 -3
  112. package/dist/safe-bash-command-python/manifest-file.d.ts +44 -0
  113. package/dist/safe-bash-command-python/manifest.d.ts +45 -0
  114. package/dist/safe-bash-command-python/provisioning.d.ts +20 -1
  115. package/dist/safe-bash-command-python/provisioning.js +3 -2
  116. package/dist/safe-bash-command-python/reply.js +7 -11
  117. package/dist/safe-bash-command-python/source-archive.js +2 -2
  118. package/dist/safe-bash-command-python/source-zip.js +2 -2
  119. package/dist/safe-bash-command-python/worker.js +34 -21
  120. package/dist/safe-bash-command-sqlite3/engine.d.ts +4 -0
  121. package/dist/safe-bash-command-sqlite3/index.js +174 -18
  122. package/dist/safe-bash-command-svgo/index.js +1 -1
  123. package/dist/safe-bash-command-tar/create.js +3 -3
  124. package/dist/safe-bash-command-tar/extract.js +3 -3
  125. package/dist/safe-bash-command-tar/index.js +5 -5
  126. package/dist/safe-bash-command-tar/modes.js +5 -5
  127. package/dist/safe-bash-command-tar/options.d.ts +1 -1
  128. package/dist/safe-bash-command-tar/options.js +1 -1
  129. package/dist/safe-bash-command-tar/stream.js +1 -1
  130. package/dist/safe-bash-command-wkhtmltopdf/index.js +1 -1
  131. package/dist/safe-bash-command-xan/argv.js +1 -1
  132. package/dist/safe-bash-command-xan/commands.js +3 -3
  133. package/dist/safe-bash-command-xan/index.js +3 -3
  134. package/dist/safe-bash-command-xan/io.js +2 -2
  135. package/dist/safe-bash-compression-engine/bounded-codec.js +3 -3
  136. package/dist/safe-bash-compression-engine/codec-loader.js +2 -2
  137. package/dist/safe-bash-compression-engine/files.js +6 -6
  138. package/dist/safe-bash-compression-engine/index.js +5 -5
  139. package/dist/safe-bash-compression-engine/operand.js +6 -6
  140. package/dist/safe-bash-compression-engine/options.js +1 -1
  141. package/dist/safe-bash-compression-engine/stream.js +5 -5
  142. package/dist/safe-bash-compression-engine/zstd-decode.js +4 -4
  143. package/dist/safe-bash-contracts/filesystem-descriptor.js +1 -1
  144. package/dist/safe-bash-contracts/filesystem-output.js +1 -1
  145. package/dist/safe-bash-csv-engine/index.js +4 -4
  146. package/dist/safe-bash-csv-engine/python-codec-aliases.js +1 -1
  147. package/dist/safe-bash-csv-engine/python-codepages.js +2 -2
  148. package/dist/safe-bash-csv-engine/python-utf16.js +3 -3
  149. package/dist/safe-bash-csv-engine/text-decoder.js +4 -4
  150. package/dist/safe-bash-graphviz-engine/index.js +1 -1
  151. package/dist/safe-bash-pager-engine/index.js +2 -2
  152. package/dist/safe-bash-query-engine/capture.js +3 -3
  153. package/dist/safe-bash-query-engine/delpaths.js +3 -3
  154. package/dist/safe-bash-query-engine/formats.js +2 -2
  155. package/dist/safe-bash-query-engine/index.js +10 -10
  156. package/dist/safe-bash-query-engine/indices.js +3 -3
  157. package/dist/safe-bash-query-engine/input.d.ts +3 -3
  158. package/dist/safe-bash-query-engine/input.js +1 -1
  159. package/dist/safe-bash-query-engine/interpreter.js +9 -9
  160. package/dist/safe-bash-query-engine/query-core.js +10 -10
  161. package/dist/safe-bash-query-engine/regex.js +4 -4
  162. package/dist/safe-bash-query-engine/splits.js +5 -5
  163. package/dist/safe-bash-query-engine/values.js +2 -2
  164. package/dist/safe-playwright-cloudflare/browser-code-executor.js +2 -2
  165. package/dist/safe-playwright-cloudflare/browser-guest-source.d.ts +2 -0
  166. package/dist/safe-playwright-cloudflare/browser-guest-source.js +36 -0
  167. package/dist/safe-playwright-cloudflare/browser-run-code-contract.d.ts +1 -1
  168. package/dist/safe-playwright-cloudflare/browser-run-code-guest.generated.d.ts +1 -2
  169. package/dist/safe-playwright-cloudflare/browser-run-code-guest.generated.js +2 -2
  170. package/dist/safe-playwright-cloudflare/browser-run-code.js +4 -1
  171. package/package.json +4 -3
  172. package/dist/safe-bash/command-chunks/chunk-BKQWFABY.js +0 -960
  173. package/dist/safe-bash/command-chunks/chunk-DV7TCGJR.js +0 -691
  174. package/dist/safe-bash/command-chunks/chunk-ZERCTWUI.js +0 -467
@@ -3791,6 +3791,21 @@ var EntropyWindow = class {
3791
3791
  let page = await this.cache.page(this, offset);
3792
3792
  page.bytes[offset % 4096] = value, page.dirty = !0;
3793
3793
  }
3794
+ /** Own bounded spans; never retain a borrowed backing page across cache I/O. */
3795
+ async read(offset, length) {
3796
+ let bytes = new Uint8Array(Number.isInteger(offset) && offset >= 0 ? Math.max(0, Math.min(length, this.length - offset)) : 0);
3797
+ for (let used = 0; used < bytes.length; ) {
3798
+ let page = await this.cache.page(this, offset + used), local = (offset + used) % 4096, count = Math.min(bytes.length - used, page.bytes.length - local);
3799
+ bytes.set(page.bytes.subarray(local, local + count), used), used += count;
3800
+ }
3801
+ return bytes;
3802
+ }
3803
+ async write(offset, bytes) {
3804
+ for (let used = 0; used < bytes.length; ) {
3805
+ let page = await this.cache.page(this, offset + used), local = (offset + used) % 4096, count = Math.min(bytes.length - used, page.bytes.length - local);
3806
+ page.bytes.set(bytes.subarray(used, used + count), local), page.dirty = !0, used += count;
3807
+ }
3808
+ }
3794
3809
  async coefficients(offset) {
3795
3810
  let block = new Int16Array(Math.max(0, Math.min(64, (this.length - offset) / 2)));
3796
3811
  for (let i = 0; i < block.length; i++)
@@ -3942,8 +3957,7 @@ async function decodeJpegToStorage(source, storage, signal, options) {
3942
3957
  let stride = comp.blocksX * blockStep, dst = useStripDecode ? comp.stripPixels : comp.pixels, baseRow = (useStripDecode ? stripVy : by) * blockStep, baseCol = bx * blockStep;
3943
3958
  for (let y = 0; y < blockStep; y++) {
3944
3959
  let dstOff = (baseRow + y) * stride + baseCol, srcOff = y * blockStep;
3945
- for (let x = 0; x < blockStep; x++)
3946
- await dst.set(dstOff + x, blockOut[srcOff + x]);
3960
+ await dst.write(dstOff, blockOut.subarray(srcOff, srcOff + blockStep));
3947
3961
  }
3948
3962
  }, mcuCounter = 0, restartCounter = 0, consumeRestart = async () => {
3949
3963
  let scanPos = scan.position;
@@ -3988,24 +4002,31 @@ async function decodeJpegToStorage(source, storage, signal, options) {
3988
4002
  mcuCounter++;
3989
4003
  }
3990
4004
  if (useStripDecode && outRgba) {
3991
- let yStart = my * mcuRowH, yEnd = Math.min(outHeight, yStart + mcuRowH), c0 = components[0], s0 = c0.blocksX * blockStep;
3992
- if (components.length === 1) {
3993
- let p0 = c0.stripPixels;
3994
- for (let y = yStart; y < yEnd; y++) {
3995
- let rowIn = (y - yStart) * s0, outIdx = y * outWidth * 4;
3996
- for (let x = 0; x < outWidth; x++) {
3997
- let g = await p0.at(rowIn + x);
3998
- await outRgba.set(outIdx, g), await outRgba.set(outIdx + 1, g), await outRgba.set(outIdx + 2, g), await outRgba.set(outIdx + 3, 255), outIdx += 4;
4005
+ let yStart = my * mcuRowH, yEnd = Math.min(outHeight, yStart + mcuRowH), row = new Uint8Array(4096), count = components.length === 1 ? 1 : components.length === 4 ? 4 : components.length >= 3 ? 3 : 0, work = 0;
4006
+ for (let y = yStart; y < yEnd; y++) {
4007
+ let ly = y - yStart;
4008
+ for (let xStart = 0; xStart < outWidth; xStart += 1024) {
4009
+ let xEnd = Math.min(outWidth, xStart + 1024), planes = [];
4010
+ for (let plane = 0; plane < count; plane++) {
4011
+ let comp = components[plane], start = comp.h === maxH ? xStart : Math.floor(xStart * comp.h / maxH), end = comp.h === maxH ? xEnd - 1 : Math.floor((xEnd - 1) * comp.h / maxH), rowIndex = comp.v === maxV ? ly : Math.floor(ly * comp.v / maxV);
4012
+ planes.push({ bytes: await comp.stripPixels.read(rowIndex * comp.blocksX * blockStep + start, end - start + 1), start, h: comp.h });
3999
4013
  }
4000
- }
4001
- } else if (components.length >= 3) {
4002
- let c1 = components[1], c2 = components[2], pY = c0.stripPixels, pCb = c1.stripPixels, pCr = c2.stripPixels, sY = s0, sCb = c1.blocksX * blockStep, sCr = c2.blocksX * blockStep, hY = c0.h, vY = c0.v, hCb = c1.h, vCb = c1.v, hCr = c2.h, vCr = c2.v, hasK = components.length === 4, c3 = hasK ? components[3] : void 0, pK = c3?.stripPixels, sK = c3 ? c3.blocksX * blockStep : 0;
4003
- for (let y = yStart; y < yEnd; y++) {
4004
- let ly = y - yStart, yRow = (vY === maxV ? ly : Math.floor(ly * vY / maxV)) * sY, cbRow = (vCb === maxV ? ly : Math.floor(ly * vCb / maxV)) * sCb, crRow = (vCr === maxV ? ly : Math.floor(ly * vCr / maxV)) * sCr, kRow = c3 ? (c3.v === maxV ? ly : Math.floor(ly * c3.v / maxV)) * sK : 0, outIdx = y * outWidth * 4;
4005
- for (let x = 0; x < outWidth; x++) {
4006
- let yVal = await pY.at(yRow + (hY === maxH ? x : Math.floor(x * hY / maxH))), cbVal = await pCb.at(cbRow + (hCb === maxH ? x : Math.floor(x * hCb / maxH))) - 128, crVal = await pCr.at(crRow + (hCr === maxH ? x : Math.floor(x * hCr / maxH))) - 128, kVal = hasK && pK && c3 ? await pK.at(kRow + (c3.h === maxH ? x : Math.floor(x * c3.h / maxH))) : void 0, rgb = jpegColor(yVal, cbVal, crVal, kVal, !0);
4007
- await outRgba.set(outIdx, rgb & 255), await outRgba.set(outIdx + 1, rgb >>> 8 & 255), await outRgba.set(outIdx + 2, rgb >>> 16), await outRgba.set(outIdx + 3, 255), outIdx += 4;
4014
+ let sample = (plane, x) => {
4015
+ let entry = planes[plane];
4016
+ return entry.bytes[(entry.h === maxH ? x : Math.floor(x * entry.h / maxH)) - entry.start] ?? NaN;
4017
+ };
4018
+ for (let x = xStart; x < xEnd; x++) {
4019
+ let at = (x - xStart) * 4;
4020
+ if (components.length === 1) {
4021
+ let g = sample(0, x);
4022
+ row[at] = g, row[at + 1] = g, row[at + 2] = g;
4023
+ } else if (components.length >= 3) {
4024
+ let rgb = jpegColor(sample(0, x), sample(1, x) - 128, sample(2, x) - 128, components.length === 4 ? sample(3, x) : void 0, !0);
4025
+ row[at] = rgb & 255, row[at + 1] = rgb >>> 8 & 255, row[at + 2] = rgb >>> 16;
4026
+ }
4027
+ row[at + 3] = 255;
4008
4028
  }
4029
+ (components.length === 1 || components.length >= 3) && await outRgba.write((y * outWidth + xStart) * 4, row.subarray(0, (xEnd - xStart) * 4)), work += xEnd - xStart, work >= 16384 && (await defaultRuntime.yieldTurn(signal), work = 0);
4009
4030
  }
4010
4031
  }
4011
4032
  }
@@ -5,7 +5,7 @@ import {
5
5
  PdfRetainedReader,
6
6
  renderPdfPageToPng,
7
7
  renderRetainedPagePixels
8
- } from "../safe-bash/command-chunks/chunk-J3VS55K4.js";
8
+ } from "../safe-bash/command-chunks/chunk-YHRESVJ7.js";
9
9
  import "../safe-bash/command-chunks/chunk-E6SK3OU2.js";
10
10
  import "../safe-bash/command-chunks/chunk-NUGQQDGE.js";
11
11
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
@@ -257,7 +257,7 @@ import {
257
257
  transformNodeStringsAndStreamsSteps,
258
258
  transformPathSegment,
259
259
  transformPoint
260
- } from "../safe-bash/command-chunks/chunk-J3VS55K4.js";
260
+ } from "../safe-bash/command-chunks/chunk-YHRESVJ7.js";
261
261
  import "../safe-bash/command-chunks/chunk-E6SK3OU2.js";
262
262
  import "../safe-bash/command-chunks/chunk-NUGQQDGE.js";
263
263
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
@@ -10733,11 +10733,13 @@ var Commands = class {
10733
10733
  this.onAllocation = onAllocation;
10734
10734
  }
10735
10735
  cmds = [];
10736
+ hasPoints = false;
10736
10737
  transformStack = [];
10737
10738
  currentTransform = [1, 0, 0, 1, 0, 0];
10738
10739
  add(cmd, args) {
10739
10740
  this.onAllocation?.(64 + (args?.length ?? 0) * 16);
10740
10741
  if (args) {
10742
+ this.hasPoints = true;
10741
10743
  const { currentTransform } = this;
10742
10744
  for (let i = 0, ii = args.length; i < ii; i += 2) {
10743
10745
  Util.applyTransform(args, currentTransform, i);
@@ -10822,7 +10824,9 @@ var CompiledFont = class _CompiledFont {
10822
10824
  const cmds = new Commands(onAllocation);
10823
10825
  cmds.transform(fontMatrix.slice());
10824
10826
  this.compileGlyphImpl(code, cmds, glyphId);
10825
- cmds.add(DrawOPS.closePath);
10827
+ if (cmds.hasPoints) {
10828
+ cmds.add(DrawOPS.closePath);
10829
+ }
10826
10830
  return cmds.getPath();
10827
10831
  }
10828
10832
  compileGlyphImpl() {
@@ -10862,8 +10866,10 @@ var Type2Compiled = class extends CompiledFont {
10862
10866
  cmds.onFrameAllocation = onAllocation;
10863
10867
  cmds.transform(matrix.slice());
10864
10868
  yield* compileCharString(code, cmds, this, glyphId);
10865
- cmds.add(DrawOPS.closePath);
10866
- yield cmds.getPath();
10869
+ if (cmds.hasPoints) {
10870
+ cmds.add(DrawOPS.closePath);
10871
+ yield cmds.getPath();
10872
+ }
10867
10873
  }
10868
10874
  compileGlyphImpl(code, cmds, glyphId) {
10869
10875
  for (const ignored of compileCharString(code, cmds, this, glyphId)) { /* synchronous collector */ }
@@ -16301,6 +16301,7 @@ var Runtime = class _Runtime {
16301
16301
  const binding = arrayStore(state)?.get(resolved);
16302
16302
  const selector = name2.slice(bracket + 1, -1);
16303
16303
  const entries = this.presenceArrayEntries(state, resolved);
16304
+ if (!binding?.associative && (selector === "@" || selector === "*")) return entries ? entries.length > 0 : binding ? binding.values.size > 0 : this.variable(state, base) !== void 0;
16304
16305
  const store = requireArrays(state);
16305
16306
  try {
16306
16307
  const index = binding?.associative && suppliedSubscript ? await binding.keyIndex(selector, store.owner, this.signal) : await this.arrayIndex(binding, { decimal: selector, source: selector }, state, io, store.owner, false, entries ? entries.length - 1 : binding?.maximum ?? (this.variable(state, base) === void 0 ? -1 : 0));
@@ -18619,7 +18620,8 @@ var Runtime = class _Runtime {
18619
18620
  } catch (error) {
18620
18621
  this.rethrowArithmeticControl(error);
18621
18622
  if (io.execution) io.execution.arithmeticDiagnostic = true;
18622
- throw new PublicDiagnostic(`((: ${message(error, this.budget.onInternalError)}`);
18623
+ await this.diagnostic(io, `((: ${message(error, this.budget.onInternalError)}`);
18624
+ status = 1;
18623
18625
  }
18624
18626
  } else if (command.kind === "subshell") {
18625
18627
  const child = tryCloneStateSync(state) ?? await cloneState(state, this.signal);
@@ -23856,13 +23858,17 @@ ${prefix} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
23856
23858
  }, references);
23857
23859
  captureIO.descriptors.set(1, { output: captureIO.stdout, lifetime });
23858
23860
  try {
23859
- state.substitutionStatus = fileShortcut ? await this.runCommandIsolated(command, child, captureIO, true) : await this.run(part.script, child, captureIO);
23861
+ state.substitutionStatus = fileShortcut ? await this.finishShell(child, captureIO, await this.runCommandIsolated(command, child, captureIO, true)) : await this.run(part.script, child, captureIO);
23860
23862
  } finally {
23861
23863
  try {
23862
- if (!references.closeSyncIfEmpty()) await references.close();
23863
- if (!lifetime.releaseSyncIfIdle()) await lifetime.release();
23864
+ if (!this.releaseExtensionsSyncIfEmpty(child)) await this.releaseExtensions(child);
23864
23865
  } finally {
23865
- stateMonitor(child)?.closeValues();
23866
+ try {
23867
+ if (!references.closeSyncIfEmpty()) await references.close();
23868
+ if (!lifetime.releaseSyncIfIdle()) await lifetime.release();
23869
+ } finally {
23870
+ stateMonitor(child)?.closeValues();
23871
+ }
23866
23872
  }
23867
23873
  }
23868
23874
  const pendingCapture = lifetime.settled();
@@ -33132,6 +33138,7 @@ var syncExtraRuntimeMethods = {
33132
33138
  const entries = this.presenceArrayEntries(state, resolved);
33133
33139
  if (bracket < 0) return entries ? entries[0] !== void 0 : this.variable(state, base) !== void 0;
33134
33140
  const selector = name2.slice(bracket + 1, -1);
33141
+ if (!binding?.associative && (selector === "@" || selector === "*")) return entries ? entries.length > 0 : binding ? binding.values.size > 0 : this.variable(state, base) !== void 0;
33135
33142
  if (binding?.associative) {
33136
33143
  if (!suppliedSubscript || selector.length > 4096) return void 0;
33137
33144
  if (selector.length === 0) return false;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GI7OALXO.js";
4
4
  import {
5
5
  yieldTurn
6
- } from "./chunk-VWLQDZFF.js";
6
+ } from "./chunk-C7RBTLYX.js";
7
7
  import {
8
8
  latin1Text
9
9
  } from "./chunk-N4CQ5E3G.js";
@@ -1,5 +1,5 @@
1
1
  // packages/safe-bash/src/commands/python/index.ts
2
- import { PythonFailure, PythonPackageConflictError, createPythonBuildBackend, createPythonBuildDependencies, createPythonBuildEnvironment, createPythonCommands, createPythonExecutorCommands, createPythonExecutorPool, createPythonHostBridge, createPythonJspiAssets, createPythonJspiExecutor, createPythonJspiNativeCall, createPythonJspiStatResult, createPythonJspiTrampoline, createPythonLlmCapability, createPythonLlmFragmentLoader, createPythonLlmLoaderDiscovery, createPythonLlmLoaderProvider, createPythonLlmPackageManager, createPythonLlmTemplateLoader, createPythonLlmToolLoader, createPythonPackageCache, createPythonPackageEnvironment, createPythonPackageManifestStore, createPythonShellCapability, createPythonSourcePackageEnvironment, createPythonSourceSnapshot, inspectPythonCapabilities, installPythonLlmDependencies, installPythonLlmPackages, publishPythonBuildWheel, pythonCommands, pythonDocumentPackages, pythonExecutorCommands, pythonHostFailureCode, pythonLlmDependencies, pythonLlmPackages } from "../../safe-bash-command-python/index.js";
2
+ import { PythonFailure, PythonPackageConflictError, createPythonBuildBackend, createPythonBuildDependencies, createPythonBuildEnvironment, createPythonCommands, createPythonExecutorCommands, createPythonExecutorPool, createPythonHostBridge, createPythonJspiAssets, createPythonJspiExecutor, createPythonJspiNativeCall, createPythonJspiStatResult, createPythonJspiTrampoline, createPythonLlmCapability, createPythonLlmFragmentLoader, createPythonLlmLoaderDiscovery, createPythonLlmLoaderProvider, createPythonLlmPackageManager, createPythonLlmTemplateLoader, createPythonLlmToolLoader, createPythonPackageCache, createPythonPackageEnvironment, createPythonPackageFileManifestStore, createPythonPackageManifestStore, createPythonPackageStreamingManifestStore, createPythonShellCapability, createPythonSourcePackageEnvironment, createPythonSourceSnapshot, inspectPythonCapabilities, installPythonLlmDependencies, installPythonLlmPackages, publishPythonBuildWheel, pythonCommands, pythonDocumentPackages, pythonExecutorCommands, pythonHostFailureCode, pythonLlmDependencies, pythonLlmPackages } from "../../safe-bash-command-python/index.js";
3
3
 
4
4
  export {
5
5
  PythonFailure,
@@ -25,7 +25,9 @@ export {
25
25
  createPythonLlmToolLoader,
26
26
  createPythonPackageCache,
27
27
  createPythonPackageEnvironment,
28
+ createPythonPackageFileManifestStore,
28
29
  createPythonPackageManifestStore,
30
+ createPythonPackageStreamingManifestStore,
29
31
  createPythonShellCapability,
30
32
  createPythonSourcePackageEnvironment,
31
33
  createPythonSourceSnapshot,
@@ -5,7 +5,7 @@ import {
5
5
  composeAgentCommands,
6
6
  createAgentCommandPlugin,
7
7
  createRegexExecutors
8
- } from "./chunk-RAFD5ZAH.js";
8
+ } from "./chunk-Y67A2DE4.js";
9
9
  import {
10
10
  createOpCommands
11
11
  } from "./chunk-UKMP6ZT5.js";
@@ -1,9 +1,10 @@
1
1
  // packages/safe-bash/src/commands/llm/index.ts
2
- import { LlmCancelToolCall, LlmLoaderLookupError, createElevenLabsProvider, createLlmCommand, createLlmCommands, createLlmConfiguration, createLlmFragmentLoaders, createLlmFragmentSource, createLlmInputBudget, createLlmService, createLlmSpool, createLlmTemplateStore, createLlmToolRegistry, createLlmUrlFragmentSource, createLlmUrlSource, createOpenAiProvider, encodeLlmBase64, evaluateLlmTemplate, executeLlmToolCalls, findExtractedRange, getLlmAttachmentUrlId, getLlmFragmentPrefix, getLlmModelAliases, llmCommands, llmReferenceVersion, llmTemplateUsesInput, loadLlmPluginFragments, openAiChatOptions, parseLlmSchemaDsl, resolveLlmSchemaInput, resolveLlmUrlAttachment, selectLlmModelByQuery, selectLlmTools, serializeLlmJsonString, serializeLlmJsonValue, serializeLlmTokenUsage, serializeOpenAiChatRequest, streamLlmToolChain, templateYaml, validateLlmTemplateParameters, validateModelOptions } from "../../safe-bash-command-llm/index.js";
2
+ import { LlmCancelToolCall, LlmLoaderLookupError, LlmPluginExit, createElevenLabsProvider, createLlmCommand, createLlmCommands, createLlmConfiguration, createLlmFragmentLoaders, createLlmFragmentSource, createLlmInputBudget, createLlmService, createLlmSpool, createLlmTemplateStore, createLlmToolRegistry, createLlmUrlFragmentSource, createLlmUrlSource, createOpenAiProvider, encodeLlmBase64, evaluateLlmTemplate, executeLlmToolCalls, findExtractedRange, getLlmAttachmentUrlId, getLlmFragmentPrefix, getLlmModelAliases, llmCommands, llmReferenceVersion, llmTemplateUsesInput, loadLlmPluginFragments, openAiChatOptions, openLlmJsonDocument, parseLlmSchemaDsl, resolveLlmSchemaInput, resolveLlmUrlAttachment, selectLlmModelByQuery, selectLlmTools, serializeLlmJsonString, serializeLlmJsonValue, serializeLlmTokenUsage, serializeOpenAiChatRequest, streamLlmToolChain, templateYaml, validateLlmTemplateParameters, validateModelOptions } from "../../safe-bash-command-llm/index.js";
3
3
 
4
4
  export {
5
5
  LlmCancelToolCall,
6
6
  LlmLoaderLookupError,
7
+ LlmPluginExit,
7
8
  createElevenLabsProvider,
8
9
  createLlmCommand,
9
10
  createLlmCommands,
@@ -30,6 +31,7 @@ export {
30
31
  llmTemplateUsesInput,
31
32
  loadLlmPluginFragments,
32
33
  openAiChatOptions,
34
+ openLlmJsonDocument,
33
35
  parseLlmSchemaDsl,
34
36
  resolveLlmSchemaInput,
35
37
  resolveLlmUrlAttachment,
@@ -80,7 +80,7 @@ import {
80
80
  wcDisplayWidth,
81
81
  writeFileOutput,
82
82
  yieldTurn
83
- } from "./chunk-VWLQDZFF.js";
83
+ } from "./chunk-C7RBTLYX.js";
84
84
  import {
85
85
  compareByteArrays,
86
86
  compareCopyIdentity,