@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
@@ -3467,6 +3467,8 @@ export class Runtime {
3467
3467
  const binding = arrayStore(state)?.get(resolved);
3468
3468
  const selector = name.slice(bracket + 1, -1);
3469
3469
  const entries = this.presenceArrayEntries(state, resolved);
3470
+ if (!binding?.associative && (selector === "@" || selector === "*"))
3471
+ return entries ? entries.length > 0 : binding ? binding.values.size > 0 : this.variable(state, base) !== undefined;
3470
3472
  const store = requireArrays(state);
3471
3473
  try {
3472
3474
  // Supplied associative selectors have already undergone word expansion.
@@ -6066,7 +6068,8 @@ export class Runtime {
6066
6068
  this.rethrowArithmeticControl(error);
6067
6069
  if (io.execution)
6068
6070
  io.execution.arithmeticDiagnostic = true;
6069
- throw new PublicDiagnostic(`((: ${message(error, this.budget.onInternalError)}`);
6071
+ await this.diagnostic(io, `((: ${message(error, this.budget.onInternalError)}`);
6072
+ status = 1;
6070
6073
  }
6071
6074
  }
6072
6075
  else if (command.kind === "subshell") {
@@ -11970,17 +11973,25 @@ export class Runtime {
11970
11973
  }, references);
11971
11974
  captureIO.descriptors.set(1, { output: captureIO.stdout, lifetime });
11972
11975
  try {
11973
- state.substitutionStatus = fileShortcut ? await this.runCommandIsolated(command, child, captureIO, true) : await this.run(part.script, child, captureIO);
11976
+ state.substitutionStatus = fileShortcut
11977
+ ? await this.finishShell(child, captureIO, await this.runCommandIsolated(command, child, captureIO, true))
11978
+ : await this.run(part.script, child, captureIO);
11974
11979
  }
11975
11980
  finally {
11976
11981
  try {
11977
- if (!references.closeSyncIfEmpty())
11978
- await references.close();
11979
- if (!lifetime.releaseSyncIfIdle())
11980
- await lifetime.release();
11982
+ if (!this.releaseExtensionsSyncIfEmpty(child))
11983
+ await this.releaseExtensions(child);
11981
11984
  }
11982
11985
  finally {
11983
- stateMonitor(child)?.closeValues();
11986
+ try {
11987
+ if (!references.closeSyncIfEmpty())
11988
+ await references.close();
11989
+ if (!lifetime.releaseSyncIfIdle())
11990
+ await lifetime.release();
11991
+ }
11992
+ finally {
11993
+ stateMonitor(child)?.closeValues();
11994
+ }
11984
11995
  }
11985
11996
  }
11986
11997
  const pendingCapture = lifetime.settled();
@@ -4762,6 +4762,8 @@ const syncExtraRuntimeMethods = {
4762
4762
  if (bracket < 0)
4763
4763
  return entries ? entries[0] !== undefined : this.variable(state, base) !== undefined;
4764
4764
  const selector = name.slice(bracket + 1, -1);
4765
+ if (!binding?.associative && (selector === "@" || selector === "*"))
4766
+ return entries ? entries.length > 0 : binding ? binding.values.size > 0 : this.variable(state, base) !== undefined;
4765
4767
  if (binding?.associative) {
4766
4768
  if (!suppliedSubscript || selector.length > 4096)
4767
4769
  return undefined;
@@ -2,14 +2,14 @@ import {
2
2
  cloudflareWorkerLimits,
3
3
  mapfileExtension,
4
4
  readExtension
5
- } from "./chunks/chunk-TZRVK3NU.js";
5
+ } from "./chunks/chunk-HWYINF6Y.js";
6
6
  import "./chunks/chunk-GI7OALXO.js";
7
7
  import {
8
8
  Shell,
9
9
  ShellLimitError,
10
10
  ShellSyntaxError,
11
11
  parseShell
12
- } from "./chunks/chunk-VWLQDZFF.js";
12
+ } from "./chunks/chunk-C7RBTLYX.js";
13
13
  import "./chunks/chunk-N4CQ5E3G.js";
14
14
  import "./chunks/chunk-EDJBO2HZ.js";
15
15
  import "./chunks/chunk-IMOFLK26.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AwkRuntime
3
- } from "../safe-bash/command-chunks/chunk-YB5TNDY6.js";
4
- import "../safe-bash/command-chunks/chunk-FMGNXOMV.js";
3
+ } from "../safe-bash/command-chunks/chunk-K5VJ4NNL.js";
4
+ import "../safe-bash/command-chunks/chunk-2L3NMRLG.js";
5
5
  import "../safe-bash/command-chunks/chunk-IM45EHCD.js";
6
6
  import "../safe-bash/command-chunks/chunk-HUYIW3BQ.js";
7
7
  import "../safe-bash/command-chunks/chunk-JA4LDLML.js";
@@ -3,7 +3,7 @@ import {
3
3
  builtinArities,
4
4
  decodeString,
5
5
  isLvalue
6
- } from "../safe-bash/command-chunks/chunk-FMGNXOMV.js";
6
+ } from "../safe-bash/command-chunks/chunk-2L3NMRLG.js";
7
7
  import "../safe-bash/command-chunks/chunk-HUYIW3BQ.js";
8
8
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
9
9
  export {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  awkCommand
3
- } from "../safe-bash/command-chunks/chunk-3DID6MQY.js";
3
+ } from "../safe-bash/command-chunks/chunk-OWTQYLID.js";
4
4
  import "../safe-bash/command-chunks/chunk-4D27OCWG.js";
5
- import "../safe-bash/command-chunks/chunk-YB5TNDY6.js";
6
- import "../safe-bash/command-chunks/chunk-FMGNXOMV.js";
5
+ import "../safe-bash/command-chunks/chunk-K5VJ4NNL.js";
6
+ import "../safe-bash/command-chunks/chunk-2L3NMRLG.js";
7
7
  import "../safe-bash/command-chunks/chunk-IM45EHCD.js";
8
8
  import "../safe-bash/command-chunks/chunk-DDYPQAXN.js";
9
9
  import "../safe-bash/command-chunks/chunk-HUYIW3BQ.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  awkCommand
3
- } from "../safe-bash/command-chunks/chunk-3DID6MQY.js";
3
+ } from "../safe-bash/command-chunks/chunk-OWTQYLID.js";
4
4
  import "../safe-bash/command-chunks/chunk-4D27OCWG.js";
5
- import "../safe-bash/command-chunks/chunk-YB5TNDY6.js";
6
- import "../safe-bash/command-chunks/chunk-FMGNXOMV.js";
5
+ import "../safe-bash/command-chunks/chunk-K5VJ4NNL.js";
6
+ import "../safe-bash/command-chunks/chunk-2L3NMRLG.js";
7
7
  import "../safe-bash/command-chunks/chunk-IM45EHCD.js";
8
8
  import "../safe-bash/command-chunks/chunk-DDYPQAXN.js";
9
9
  import "../safe-bash/command-chunks/chunk-HUYIW3BQ.js";
@@ -20,7 +20,7 @@ import {
20
20
  sliceMp4,
21
21
  srtAst,
22
22
  webvttAst
23
- } from "../safe-bash/command-chunks/chunk-O3FTKLWR.js";
23
+ } from "../safe-bash/command-chunks/chunk-BXOBM4HJ.js";
24
24
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
25
25
 
26
26
  // packages/safe-bash-command-ffmpeg/src/index.ts
@@ -652,7 +652,7 @@ async function applyVideoFilterChain(frames, filterChainStr, budget, subtitleCue
652
652
  } else if (name === "subtitles") {
653
653
  const cues = subtitleCues ?? [];
654
654
  current = await mapWork(current, async (f) => {
655
- const active = cues.filter((c) => f.ptsSeconds >= c.startSec && f.ptsSeconds <= c.endSec);
655
+ const active = cues.filter((c) => f.ptsSeconds >= c.startSec && f.ptsSeconds < c.endSec);
656
656
  if (active.length === 0) return f;
657
657
  const cueStr = active.map((c) => c.text).join("\n");
658
658
  return {
@@ -1727,15 +1727,25 @@ function createFfmpegCommand(options = {}) {
1727
1727
  ...workingDoc,
1728
1728
  tracks: await mapWork(workingDoc.tracks, async (t) => {
1729
1729
  if (t.type !== "video") return t;
1730
+ let presentationOffset = 0;
1731
+ for (const edit of t.editList ?? []) {
1732
+ if (edit.mediaTime < 0) presentationOffset -= edit.segmentDuration / workingDoc.timescale;
1733
+ else {
1734
+ presentationOffset += edit.mediaTime / t.timescale;
1735
+ break;
1736
+ }
1737
+ }
1738
+ const offsetTicks = Math.round(presentationOffset * t.timescale);
1730
1739
  const decoded = await ensureDecodedFrames(t, budget, context.signal);
1731
- const filtered = await applyVideoFilterChain(decoded, combinedChain, budget, loadedSubtitleCues, context.signal);
1740
+ const displayed = decoded.map((frame) => ({ ...frame, ptsSeconds: (Math.round(frame.ptsSeconds * t.timescale) - offsetTicks) / t.timescale }));
1741
+ const filtered = await applyVideoFilterChain(displayed, combinedChain, budget, loadedSubtitleCues, context.signal);
1732
1742
  const first = filtered[0];
1733
1743
  return {
1734
1744
  ...t,
1735
1745
  width: first?.width ?? t.width,
1736
1746
  height: first?.height ?? t.height,
1737
1747
  samples: [],
1738
- decodedVideoFrames: filtered
1748
+ decodedVideoFrames: filtered.map((frame) => ({ ...frame, ptsSeconds: (Math.round(frame.ptsSeconds * t.timescale) + offsetTicks) / t.timescale }))
1739
1749
  };
1740
1750
  }, context.signal)
1741
1751
  };
@@ -1771,6 +1781,7 @@ function createFfmpegCommand(options = {}) {
1771
1781
  tracks: await mapWork(workingDoc.tracks, async (t) => {
1772
1782
  let work = 0;
1773
1783
  if (t.type !== "audio") return t;
1784
+ if (!t.decodedAudio) throw new Error("Audio filtering requires decoded PCM audio");
1774
1785
  const origRate = t.decodedAudio?.sampleRate ?? t.codecDescriptions[0]?.sampleRate ?? t.timescale ?? 44100;
1775
1786
  const origCh = t.decodedAudio?.channels ?? t.codecDescriptions[0]?.channels ?? 2;
1776
1787
  const targetRate = audioRate ?? origRate;
@@ -1818,14 +1829,6 @@ function createFfmpegCommand(options = {}) {
1818
1829
  const srcIdx = Math.min(srcCh.length - 1, Math.floor(i / targetSamples * srcCh.length));
1819
1830
  dst[i] = Math.max(-1, Math.min(1, srcCh[srcIdx] * volFactor));
1820
1831
  }
1821
- } else {
1822
- for (let i = 0; i < targetSamples; i++) {
1823
- if (++work % 1024 === 0) {
1824
- await yieldTurn(context.signal);
1825
- context.signal?.throwIfAborted();
1826
- }
1827
- dst[i] = Math.sin(2 * Math.PI * 440 * i / targetRate) * 0.2 * volFactor;
1828
- }
1829
1832
  }
1830
1833
  if (reverseAudio) dst.reverse();
1831
1834
  newChannelData.push(dst);
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createFfprobeCommand
3
- } from "../safe-bash/command-chunks/chunk-MQCLG2CT.js";
3
+ } from "../safe-bash/command-chunks/chunk-FMXBLKWO.js";
4
4
  import "../safe-bash/command-chunks/chunk-MGBHGZEX.js";
5
- import "../safe-bash/command-chunks/chunk-O3FTKLWR.js";
5
+ import "../safe-bash/command-chunks/chunk-BXOBM4HJ.js";
6
6
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
7
7
 
8
8
  // packages/safe-bash-command-ffprobe/src/index.ts
@@ -11,9 +11,9 @@ import {
11
11
  loadManifestResources,
12
12
  resolvePath,
13
13
  rethrowRuntimeError
14
- } from "../safe-bash/command-chunks/chunk-MQCLG2CT.js";
14
+ } from "../safe-bash/command-chunks/chunk-FMXBLKWO.js";
15
15
  import "../safe-bash/command-chunks/chunk-MGBHGZEX.js";
16
- import "../safe-bash/command-chunks/chunk-O3FTKLWR.js";
16
+ import "../safe-bash/command-chunks/chunk-BXOBM4HJ.js";
17
17
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
18
18
  export {
19
19
  createFfprobeCommand,
@@ -446,6 +446,7 @@ function createGpgCommand(options = {}) {
446
446
  let symmetric = false;
447
447
  let decrypt = false;
448
448
  let armor = false;
449
+ let withColons = false;
449
450
  let passphrase;
450
451
  let passphraseFile;
451
452
  let passphraseFd;
@@ -469,6 +470,7 @@ function createGpgCommand(options = {}) {
469
470
  quickGenKey = true;
470
471
  else if (a === "--export") exportKeys = true;
471
472
  else if (a === "--import") importKeys = true;
473
+ else if (a === "--with-colons") withColons = true;
472
474
  else if ((a === "-u" || a === "--local-user") && i + 1 < args.length) signerUid = args[++i];
473
475
  else if (a.startsWith("-bsau") && a.length > 5) {
474
476
  detachSign = true;
@@ -551,10 +553,16 @@ uid [ultimate] ${key.uid}
551
553
  }
552
554
  if (listKeys) {
553
555
  const keys = await loadKeyring(context);
556
+ const filtered = positionals.length === 0 ? keys : keys.filter((k) => positionals.some((q) => k.uid.includes(q) || k.keyIdHex.includes(q.toUpperCase())));
554
557
  const lines = [];
555
- for (const k of keys) {
556
- lines.push(`sec ed25519/${k.keyIdHex} 2026-09-28 [SC]`);
557
- lines.push(`uid [ultimate] ${k.uid}`);
558
+ for (const k of filtered) {
559
+ if (withColons) {
560
+ lines.push(`sec:u:255:22:${k.keyIdHex}:1790553600:::u:::scESC:::+:::23::0:`);
561
+ lines.push(`uid:u::::1790553600::${k.keyIdHex}::${k.uid}::::::::::0:`);
562
+ } else {
563
+ lines.push(`sec ed25519/${k.keyIdHex} 2026-09-28 [SC]`);
564
+ lines.push(`uid [ultimate] ${k.uid}`);
565
+ }
558
566
  }
559
567
  await writeText(context.stdout, lines.length > 0 ? `${lines.join("\n")}
560
568
  ` : "");
@@ -966,7 +966,7 @@ async function decodeFileImage(source, storage, filesystem, cwd, signal, options
966
966
 
967
967
  // packages/safe-bash-command-imagemagick/src/compare-file.ts
968
968
  import { readImageMetadataFromSource, tryPdfMetadata, readImageMetadata, decodeImage, encodeStoredImage as encodeStoredImage2, tryImageFile, UnsupportedStoredResource as UnsupportedStoredResource2, UnsupportedImageFormat as UnsupportedImageFormat2 } from "../image-ast/portable.js";
969
- import { PagedStorage as PagedStorage2 } from "@poe-platform/safe-fs/storage";
969
+ import { PagedStorage as PagedStorage2, PagedStorageCache } from "@poe-platform/safe-fs/storage";
970
970
  import { FsError as FsError2 } from "@poe-platform/safe-fs/contracts";
971
971
  import { resolvePath as resolvePath2 } from "../safe-bash-contracts/path.js";
972
972
  import { writeBytes } from "../safe-bash-contracts/io.js";
@@ -981,7 +981,7 @@ var CompareInputFailure = class extends Error {
981
981
  };
982
982
  async function withCompareFiles(input, stdinBytes, signal, run) {
983
983
  const { filesystem: fs, cwd, stdout, registerCleanup } = input, context = { signal, ...registerCleanup ? { registerCleanup } : {} }, io = { signal };
984
- const storage = new PagedStorage2({ fs, cwd, env: {}, signal });
984
+ const storage = new PagedStorage2({ fs, cwd, env: {}, signal }, 16, new PagedStorageCache(16, 65536));
985
985
  const snapshots = new EncodedSnapshots(storage, signal);
986
986
  let failed = true;
987
987
  const materialize = async (source) => {
@@ -4330,9 +4330,9 @@ function* annotatePixelSteps(img, offsetStr, text, state) {
4330
4330
  const fontSize = Math.max(8, state.pointsize);
4331
4331
  const estW = Math.max(8, Math.ceil(text.length * fontSize * 0.6));
4332
4332
  const estH = Math.max(8, Math.ceil(fontSize));
4333
- const gravOff = resolveGravityOffset(img.width - estW, img.height - estH, state.gravity);
4334
- const x = Math.max(0, Math.round(gravOff.left + g.x));
4335
- const y = Math.max(fontSize, Math.round(gravOff.top + estH + g.y));
4333
+ const offset = gravityAdjustBox(img.width, img.height, estW, estH, g.x, g.y, state.gravity);
4334
+ const x = Math.max(0, offset.x);
4335
+ const y = Math.max(fontSize, offset.y + estH);
4336
4336
  const scale = (state.density || 72) / 72;
4337
4337
  const effFontSize = Math.max(6, fontSize * scale);
4338
4338
  const glyphH = Math.max(7, Math.round(effFontSize * 0.76));
@@ -7319,6 +7319,8 @@ function* parseMontageArguments(argv) {
7319
7319
  let padY = 2;
7320
7320
  let borderW = 0;
7321
7321
  const operands = [];
7322
+ const labels = [];
7323
+ let label = "";
7322
7324
  for (let i = 0; i < argv.length; i++) {
7323
7325
  if (++cooperativeWork % 64 === 0)
7324
7326
  yield;
@@ -7345,17 +7347,30 @@ function* parseMontageArguments(argv) {
7345
7347
  state.gravity = parseGravity(argv[++i] ?? "center");
7346
7348
  } else if (t === "-quality") {
7347
7349
  state.quality = Math.max(1, Math.min(100, Number(argv[++i] ?? 92)));
7348
- } else if (t === "-mode" || t === "-label" || t === "-title") {
7350
+ } else if (t === "-label") {
7351
+ label = argv[++i] ?? "";
7352
+ } else if (t === "+label") {
7353
+ label = "";
7354
+ } else if (t === "-set") {
7355
+ const property = argv[++i];
7356
+ const value = argv[++i] ?? "";
7357
+ if (property === "label") labels.fill(value);
7358
+ } else if (t === "-pointsize") {
7359
+ state.pointsize = Math.max(1, Number(argv[++i] ?? 12));
7360
+ } else if (t === "-fill") {
7361
+ state.fill = parseColor(argv[++i] ?? "#000000");
7362
+ } else if (t === "-mode" || t === "-title" || t === "-font") {
7349
7363
  i++;
7350
7364
  } else if (!t.startsWith("-")) {
7351
7365
  operands.push(t);
7366
+ labels.push(label);
7352
7367
  }
7353
7368
  }
7354
- return { state, tileCols, tileRows, cellW, cellH, padX, padY, borderW, operands };
7369
+ return { state, tileCols, tileRows, cellW, cellH, padX, padY, borderW, operands, labels };
7355
7370
  }
7356
7371
  function* runMontageCliSteps(argv, files, stdinBytes, signal) {
7357
7372
  let cooperativeWork = 63;
7358
- const { state, tileCols, tileRows, cellW, cellH, padX, padY, borderW, operands } = yield* parseMontageArguments(argv);
7373
+ const { state, tileCols, tileRows, cellW, cellH, padX, padY, borderW, operands, labels } = yield* parseMontageArguments(argv);
7359
7374
  if (operands.length < 2) {
7360
7375
  return {
7361
7376
  exitCode: 1,
@@ -7366,7 +7381,7 @@ function* runMontageCliSteps(argv, files, stdinBytes, signal) {
7366
7381
  const outSpec = operands[operands.length - 1];
7367
7382
  const inPaths = operands.slice(0, -1);
7368
7383
  const fastMetaDims = [];
7369
- let canStreamTiles = cellW === void 0 && cellH === void 0;
7384
+ let canStreamTiles = cellW === void 0 && cellH === void 0 && !labels.some(Boolean);
7370
7385
  if (canStreamTiles) {
7371
7386
  for (const p of inPaths) {
7372
7387
  const rawBytes = files.get(p);
@@ -7500,7 +7515,7 @@ function* runMontageCliSteps(argv, files, stdinBytes, signal) {
7500
7515
  }
7501
7516
  } else {
7502
7517
  const images = [];
7503
- for (const p of inPaths) {
7518
+ for (const [inputIndex, p] of inPaths.entries()) {
7504
7519
  yield;
7505
7520
  let loadedList;
7506
7521
  try {
@@ -7542,6 +7557,16 @@ function* runMontageCliSteps(argv, files, stdinBytes, signal) {
7542
7557
  });
7543
7558
  if (thumb !== prev) detachRgbaBuffer(prev.data);
7544
7559
  }
7560
+ if (labels[inputIndex]) {
7561
+ const text = yield* formatMagickPropertyStringSteps(labels[inputIndex], thumb, () => thumb, { filePath: parseInputToken(p).baseToken });
7562
+ const height = Math.ceil(Math.max(8, state.pointsize) * 1.4);
7563
+ const caption = decodeImage3(new TextEncoder().encode(createLabelSvg(text, { ...state, hasSize: true, sizeWidth: thumb.width, sizeHeight: height, gravity: "center" })));
7564
+ const previous = thumb;
7565
+ thumb = yield* extendImageSteps(thumb, { top: 0, bottom: height, left: 0, right: 0, background: state.background, extendWith: "background" });
7566
+ if (thumb !== previous) detachRgbaBuffer(previous.data);
7567
+ yield* blitOverRgbaInPlaceSteps(thumb, caption, 0, thumb.height - height);
7568
+ detachRgbaBuffer(caption.data);
7569
+ }
7545
7570
  images.push(thumb);
7546
7571
  }
7547
7572
  }
@@ -7602,7 +7627,7 @@ function* runMontageCliSteps(argv, files, stdinBytes, signal) {
7602
7627
  return { exitCode: 0, stdout: "", stderr: "" };
7603
7628
  }
7604
7629
  async function runMontageFiles(argv, input, stdinBytes, signal) {
7605
- const { state, tileCols, tileRows, cellW, cellH, padX, padY, borderW, operands } = await drainSteps(parseMontageArguments(argv), signal);
7630
+ const { state, tileCols, tileRows, cellW, cellH, padX, padY, borderW, operands, labels } = await drainSteps(parseMontageArguments(argv), signal);
7606
7631
  if (operands.length < 2) {
7607
7632
  await probeImageArguments(argv, input, stdinBytes, signal);
7608
7633
  return { exitCode: 1, stdout: "", stderr: "montage: missing an image filename\n" };
@@ -7610,7 +7635,7 @@ async function runMontageFiles(argv, input, stdinBytes, signal) {
7610
7635
  const outSpec = operands.at(-1), paths = operands.slice(0, -1);
7611
7636
  return withCompareFiles(input, stdinBytes, signal, async (backend) => {
7612
7637
  const sources = new IntegerTable4(backend.storage, 128), images = new StoredImageStack(backend.storage, signal);
7613
- let fast = cellW === void 0 && cellH === void 0, maxThumbW = cellW ?? 0, maxThumbH = cellH ?? 0;
7638
+ let fast = cellW === void 0 && cellH === void 0 && !labels.some(Boolean), maxThumbW = cellW ?? 0, maxThumbH = cellH ?? 0;
7614
7639
  const sourceAt = async (index) => {
7615
7640
  const size = Number(await sources.get(BigInt(index * 5 + 1)) ?? -1n);
7616
7641
  if (size < 0) return null;
@@ -7687,6 +7712,14 @@ async function runMontageFiles(argv, input, stdinBytes, signal) {
7687
7712
  if (resize) image = await transformStoredImage(image, backend.storage, { kind: "resize", ...resize }, signal);
7688
7713
  }
7689
7714
  if (borderW > 0) image = await transformStoredImage(image, backend.storage, { kind: "extend", top: borderW, bottom: borderW, left: borderW, right: borderW, background: state.borderColor, extendWith: "background" }, signal);
7715
+ if (labels[index]) {
7716
+ const labeled = image;
7717
+ const text = await formatRetainedIdentify(labels[index], image, { filePath: parseInputToken(path2).baseToken }, async () => ({ image: labeled, storage: backend.storage }), signal);
7718
+ const height = Math.ceil(Math.max(8, state.pointsize) * 1.4);
7719
+ const caption = await decodeStoredMagickSvg(createLabelSvg(text, { ...state, hasSize: true, sizeWidth: image.width, sizeHeight: height, gravity: "center" }), 72, backend, signal);
7720
+ image = await transformStoredImage(image, backend.storage, { kind: "extend", top: 0, bottom: height, left: 0, right: 0, background: state.background, extendWith: "background" }, signal);
7721
+ image = await compositeStoredMagick(image, caption, backend, signal, 0, image.height - height, "over", void 0, false, true);
7722
+ }
7690
7723
  maxThumbW = Math.max(maxThumbW, image.width);
7691
7724
  maxThumbH = Math.max(maxThumbH, image.height);
7692
7725
  await images.push(image);
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  decodeLlmText,
3
- indentLlmText,
3
+ indentLlmText
4
+ } from "../safe-bash/command-chunks/chunk-T4TGJYFV.js";
5
+ import {
4
6
  withEmbeddingJsonDocument
5
- } from "../safe-bash/command-chunks/chunk-UYNJF5QN.js";
7
+ } from "../safe-bash/command-chunks/chunk-ZALAWNOE.js";
6
8
  import {
7
9
  acquireEmbeddingInput,
8
10
  commandArguments,
@@ -11,13 +13,13 @@ import {
11
13
  embeddingText,
12
14
  hasUnpairedSurrogate,
13
15
  pythonSurrogateId
14
- } from "../safe-bash/command-chunks/chunk-7ZQVMPSB.js";
16
+ } from "../safe-bash/command-chunks/chunk-5CAXR62E.js";
15
17
  import {
16
18
  createLlmSpool,
17
19
  fileSource,
18
20
  floatText,
19
21
  isPythonPrintable
20
- } from "../safe-bash/command-chunks/chunk-E5CDHXFA.js";
22
+ } from "../safe-bash/command-chunks/chunk-VOR6YDZC.js";
21
23
  import {
22
24
  tokenInteger
23
25
  } from "../safe-bash/command-chunks/chunk-GDH7OVYK.js";
@@ -3,10 +3,10 @@ import {
3
3
  createLlmCommands,
4
4
  llmCommands,
5
5
  llmReferenceVersion
6
- } from "../safe-bash/command-chunks/chunk-4EA7WI3L.js";
7
- import "../safe-bash/command-chunks/chunk-EWECMOQ5.js";
8
- import "../safe-bash/command-chunks/chunk-7ZQVMPSB.js";
9
- import "../safe-bash/command-chunks/chunk-E5CDHXFA.js";
6
+ } from "../safe-bash/command-chunks/chunk-QOOQD6BD.js";
7
+ import "../safe-bash/command-chunks/chunk-UIHPHIKI.js";
8
+ import "../safe-bash/command-chunks/chunk-5CAXR62E.js";
9
+ import "../safe-bash/command-chunks/chunk-VOR6YDZC.js";
10
10
  import "../safe-bash/command-chunks/chunk-SENLC5KK.js";
11
11
  import "../safe-bash/command-chunks/chunk-3PO534WJ.js";
12
12
  import "../safe-bash/command-chunks/chunk-B74LVFAN.js";
@@ -23,11 +23,18 @@ export interface EmbeddingJsonDocument {
23
23
  }
24
24
  /** Validate a complete JSON document before exposing caller-backed records.
25
25
  * Code points remain distinct even when their JavaScript strings look alike. */
26
- export declare function withEmbeddingJsonDocument<T>(options: {
26
+ export interface JsonDocumentOptions {
27
27
  fs: FileSystem;
28
28
  directory: string;
29
29
  signal: AbortSignal;
30
30
  maxFileBytes: number;
31
31
  maxOpenFiles: number;
32
- }, input: AsyncIterable<Uint8Array>, operation: (document: EmbeddingJsonDocument) => Promise<T>): Promise<T>;
32
+ profile?: 'python39' | 'javascript';
33
+ maxControlBytes?: number;
34
+ }
35
+ export declare function openJsonDocument(options: JsonDocumentOptions, input: AsyncIterable<Uint8Array>): Promise<EmbeddingJsonDocument & {
36
+ close(): Promise<void>;
37
+ }>;
38
+ /** Scoped compatibility helper; explicit readers must close their returned lease. */
39
+ export declare function withEmbeddingJsonDocument<T>(options: JsonDocumentOptions, input: AsyncIterable<Uint8Array>, operation: (document: EmbeddingJsonDocument) => Promise<T>): Promise<T>;
33
40
  export {};
@@ -1,5 +1,5 @@
1
1
  export { serializeLlmTokenUsage } from "./usage.js";
2
- export { LlmLoaderLookupError, type LlmLoaderProvider, type LlmDiscoveredLoaders, type LlmLoaderDiscoveryContext } from './loader-provider.js';
2
+ export { LlmLoaderLookupError, LlmPluginExit, type LlmLoaderProvider, type LlmDiscoveredLoaders, type LlmLoaderDiscoveryContext } from './loader-provider.js';
3
3
  export { createLlmToolRegistry, selectLlmTools, type LlmRegisteredTool, type LlmToolLoader, type LlmToolboxDescription, type LlmPluginQuery, type LlmPluginInfo } from './tool-registry.js';
4
4
  export { executeLlmToolCalls, LlmCancelToolCall, type LlmToolContext, type LlmToolOutput, type LlmExecutableTool, type LlmToolExecutionResult, type LlmToolExecutionOptions } from './tool-execution.js';
5
5
  export type { LlmTool, LlmToolCall, LlmMessage } from "./types.js";
@@ -28,3 +28,4 @@ export { createLlmFragmentSource, type LlmFragmentInputSource, type LlmFragmentS
28
28
  export { createLlmUrlFragmentSource } from "./url-fragment-source.js";
29
29
  export { streamLlmToolChain, type LlmToolChainOptions } from "./tool-chain.js";
30
30
  export { createLlmFragmentLoaders, loadLlmPluginFragments, getLlmFragmentPrefix, type LlmFragmentLoader, type LlmFragmentLoaderContext, type LlmLoadedFragment } from "./fragment-loaders.js";
31
+ export { openJsonDocument as openLlmJsonDocument, type EmbeddingJsonDocument as LlmJsonDocument, type EmbeddingJsonNode as LlmJsonNode } from './import-json-document.js';
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  templateYaml
3
3
  } from "../safe-bash/command-chunks/chunk-4AOPWK4N.js";
4
+ import {
5
+ openJsonDocument
6
+ } from "../safe-bash/command-chunks/chunk-ZALAWNOE.js";
4
7
  import "../safe-bash/command-chunks/chunk-54KLOXWD.js";
5
8
  import {
6
9
  createElevenLabsProvider
@@ -19,6 +22,7 @@ import "../safe-bash/command-chunks/chunk-HLRLMFMS.js";
19
22
  import {
20
23
  LlmCancelToolCall,
21
24
  LlmLoaderLookupError,
25
+ LlmPluginExit,
22
26
  createLlmCommand,
23
27
  createLlmCommands,
24
28
  createLlmFragmentLoaders,
@@ -44,14 +48,14 @@ import {
44
48
  serializeLlmTokenUsage,
45
49
  streamLlmToolChain,
46
50
  validateLlmTemplateParameters
47
- } from "../safe-bash/command-chunks/chunk-4EA7WI3L.js";
48
- import "../safe-bash/command-chunks/chunk-EWECMOQ5.js";
51
+ } from "../safe-bash/command-chunks/chunk-QOOQD6BD.js";
52
+ import "../safe-bash/command-chunks/chunk-UIHPHIKI.js";
49
53
  import {
50
54
  createLlmConfiguration
51
- } from "../safe-bash/command-chunks/chunk-7ZQVMPSB.js";
55
+ } from "../safe-bash/command-chunks/chunk-5CAXR62E.js";
52
56
  import {
53
57
  createLlmSpool
54
- } from "../safe-bash/command-chunks/chunk-E5CDHXFA.js";
58
+ } from "../safe-bash/command-chunks/chunk-VOR6YDZC.js";
55
59
  import {
56
60
  createLlmService,
57
61
  validateModelOptions
@@ -78,6 +82,7 @@ import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
78
82
  export {
79
83
  LlmCancelToolCall,
80
84
  LlmLoaderLookupError,
85
+ LlmPluginExit,
81
86
  createElevenLabsProvider,
82
87
  createLlmCommand,
83
88
  createLlmCommands,
@@ -104,6 +109,7 @@ export {
104
109
  llmTemplateUsesInput,
105
110
  loadLlmPluginFragments,
106
111
  openAiChatOptions,
112
+ openJsonDocument as openLlmJsonDocument,
107
113
  parseLlmSchemaDsl,
108
114
  resolveLlmSchemaInput,
109
115
  resolveUrlAttachment as resolveLlmUrlAttachment,
@@ -18,6 +18,11 @@ export interface LlmLoaderProvider {
18
18
  /** Lookup failures precede loader execution and retain their native diagnostic. */
19
19
  export declare class LlmLoaderLookupError extends Error {
20
20
  }
21
+ /** An explicitly requested plugin process exit, after its diagnostics are emitted. */
22
+ export declare class LlmPluginExit extends Error {
23
+ readonly exitCode: number;
24
+ constructor(exitCode: number);
25
+ }
21
26
  export declare function discoverLlmLoaders(loaders: ReadonlyMap<string, {
22
27
  readonly description?: string;
23
28
  }> | undefined, context: LlmLoaderDiscoveryContext, provider?: LlmLoaderProvider): Promise<ReadonlyMap<string, {
@@ -20566,9 +20566,9 @@ var MemoryLedger = class {
20566
20566
  hasInfiniteRetained;
20567
20567
  constructor(limits) {
20568
20568
  this.limits = limits;
20569
- this.maxFileBytesSmi = limits.maxFileBytes >= MAX_SMI ? MAX_SMI : limits.maxFileBytes | 0;
20570
- this.maxRetainedBytesSmi = limits.maxRetainedBytes >= MAX_SMI ? MAX_SMI : limits.maxRetainedBytes | 0;
20571
- this.maxMetadataUnitsSmi = limits.maxMetadataUnits >= MAX_SMI ? MAX_SMI : limits.maxMetadataUnits | 0;
20569
+ this.maxFileBytesSmi = Math.min(limits.maxFileBytes, MAX_SMI) | 0;
20570
+ this.maxRetainedBytesSmi = Math.min(limits.maxRetainedBytes, MAX_SMI) | 0;
20571
+ this.maxMetadataUnitsSmi = Math.min(limits.maxMetadataUnits, MAX_SMI) | 0;
20572
20572
  this.hasInfiniteRetained = limits.maxRetainedBytes === Infinity;
20573
20573
  if (limits.maxFileBytes !== Infinity)
20574
20574
  this.hasInfiniteFileBytes = false;
@@ -20587,18 +20587,18 @@ var MemoryLedger = class {
20587
20587
  throw new FsError("EFBIG", { syscall, path: path6 });
20588
20588
  }
20589
20589
  }
20590
+ canReserve(bytes, units) {
20591
+ return (bytes | 0) === bytes && bytes >= 0 && (units | 0) === units && units >= 0 && this.retainedBytes <= this.maxRetainedBytesSmi - bytes && this.metadataUnits <= this.maxMetadataUnitsSmi - units;
20592
+ }
20590
20593
  check(bytes, units, syscall, path6) {
20591
- if ((bytes | 0) === bytes && bytes >= 0 && (units | 0) === units && units >= 0 && this.retainedBytes <= this.maxRetainedBytesSmi - bytes && this.metadataUnits <= this.maxMetadataUnitsSmi - units) {
20594
+ if (this.canReserve(bytes, units))
20592
20595
  return;
20593
- }
20594
- const maxRetained = this.limits.maxRetainedBytes;
20595
- const maxUnits = this.limits.maxMetadataUnits;
20596
- if (!Number.isSafeInteger(bytes) || bytes < 0 || maxRetained !== Infinity && bytes > maxRetained - this.retainedBytes || !Number.isSafeInteger(units) || units < 0 || maxUnits !== Infinity && units > maxUnits - this.metadataUnits) {
20596
+ if (!Number.isSafeInteger(bytes) || bytes < 0 || bytes > this.limits.maxRetainedBytes - this.retainedBytes || !Number.isSafeInteger(units) || units < 0 || units > this.limits.maxMetadataUnits - this.metadataUnits) {
20597
20597
  throw new FsError("ENOSPC", { syscall, path: path6 });
20598
20598
  }
20599
20599
  }
20600
20600
  reserve(bytes, units, syscall, path6) {
20601
- if ((bytes | 0) === bytes && bytes >= 0 && (units | 0) === units && units >= 0 && this.retainedBytes <= this.maxRetainedBytesSmi - bytes && this.metadataUnits <= this.maxMetadataUnitsSmi - units) {
20601
+ if (this.canReserve(bytes, units)) {
20602
20602
  this.retainedBytes = this.retainedBytes + bytes | 0;
20603
20603
  this.metadataUnits = this.metadataUnits + units | 0;
20604
20604
  return;
@@ -20637,9 +20637,6 @@ var MemoryAllocation = class {
20637
20637
  }
20638
20638
  }
20639
20639
  };
20640
- Object.assign(MemoryAllocation.prototype, {
20641
- references: 1
20642
- });
20643
20640
  Object.assign(MemoryLedger.prototype, { hasInfiniteFileBytes: true });
20644
20641
 
20645
20642
  // ../safe-fs/dist/config.js
@@ -25463,7 +25460,7 @@ var getFsBridgeProvider = FileSystemBridge.getProvider;
25463
25460
  var empty = new Uint8Array();
25464
25461
 
25465
25462
  // ../safe-fs/dist/storage.js
25466
- var pageBytes = 16 * 1024;
25463
+ var defaultPageBytes = 16 * 1024;
25467
25464
 
25468
25465
  // src/management.ts
25469
25466
  import { commandRuntimeIdentity as commandRuntimeIdentity2, collectBytes as collectBytes3, toByteSource, createOutputOperation as createOutputOperation2 } from "../safe-bash-contracts/index.js";
@@ -129,9 +129,9 @@ function* parsePdftoppmArgsSteps(argv, hasStdin) {
129
129
  singleFile = true;
130
130
  else if (arg === "-forcenum")
131
131
  forceNum = true;
132
- else if (arg === "-o")
132
+ else if (arg === "-o" || arg === "-odd")
133
133
  oddOnly = true;
134
- else if (arg === "-e")
134
+ else if (arg === "-e" || arg === "-even")
135
135
  evenOnly = true;
136
136
  else if (arg === "-cropbox")
137
137
  useCropBox = true;
@@ -17,7 +17,7 @@ import {
17
17
  } from "../safe-bash/command-chunks/chunk-IGHFIRXK.js";
18
18
  import {
19
19
  createPlaywrightController
20
- } from "../safe-bash/command-chunks/chunk-RUAGHZNF.js";
20
+ } from "../safe-bash/command-chunks/chunk-X5ODTF3E.js";
21
21
  import "../safe-bash/command-chunks/chunk-SPZR6J6S.js";
22
22
  import "../safe-bash/command-chunks/chunk-GGDJ725I.js";
23
23
  import "../safe-bash/command-chunks/chunk-MAFCR5HR.js";
@@ -53,7 +53,7 @@ import {
53
53
  import "../safe-bash/command-chunks/chunk-Q2GU7KCT.js";
54
54
  import "../safe-bash/command-chunks/chunk-WDF3IURH.js";
55
55
  import "../safe-bash/command-chunks/chunk-D43FDVLM.js";
56
- import "../safe-bash/command-chunks/chunk-2KMNVJB7.js";
56
+ import "../safe-bash/command-chunks/chunk-A7PKUIJT.js";
57
57
  import "../safe-bash/command-chunks/chunk-GYGORRXA.js";
58
58
  import {
59
59
  createPlaywrightAdapter