@poe-platform/safe-bash 0.1.788 → 0.1.790
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/image-ast/index.browser.js +147 -80
- package/dist/image-ast/index.js +147 -80
- package/dist/mp4-ast/mp4.d.ts +2 -0
- package/dist/pdf-ast/cos/parser.d.ts +1 -0
- package/dist/pdf-ast/cos/security.d.ts +2 -0
- package/dist/pdf-ast/cos/writer.d.ts +1 -0
- package/dist/pdf-ast/document.d.ts +3 -0
- package/dist/pdf-ast/edit/forms.d.ts +1 -0
- package/dist/pdf-ast/index.js +171 -82
- package/dist/safe-bash/chunks/{chunk-L5QQLNTO.js → chunk-22PI65AH.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-Q3E6C3DX.js → chunk-2TAGYMPK.js} +49 -34
- package/dist/safe-bash/chunks/{chunk-Z3HX3ZBA.js → chunk-2W4HTMEK.js} +52 -48
- package/dist/safe-bash/chunks/{chunk-FFZXP6ZC.js → chunk-3M7L7XU2.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-XNODZRVD.js → chunk-3QAO6UYS.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-YPETOVQU.js → chunk-3VKFK3NF.js} +2 -2
- package/dist/safe-bash/chunks/chunk-5OST7NOX.js +42 -0
- package/dist/safe-bash/chunks/{chunk-KEBSX2AX.js → chunk-6HLURHVU.js} +2 -2
- package/dist/safe-bash/chunks/chunk-DYEUZE6Z.js +19 -0
- package/dist/safe-bash/chunks/{chunk-T2TGCHKE.js → chunk-FM3WBSZT.js} +2 -2
- package/dist/safe-bash/chunks/chunk-GAYRKQM6.js +22 -0
- package/dist/safe-bash/chunks/{chunk-Q45QCA4J.js → chunk-I3KSESCR.js} +0 -7
- package/dist/safe-bash/chunks/{chunk-OSKDIBQS.js → chunk-JLIMK5TD.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-2AYZCT5X.js → chunk-JQ2FAJJT.js} +27 -23
- package/dist/safe-bash/chunks/{chunk-QA3NVP43.js → chunk-JRE6Z3T7.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-DC5EHLKS.js → chunk-NDIL6T7Y.js} +5 -5
- package/dist/safe-bash/chunks/{chunk-747G42FY.js → chunk-OPR4UAIT.js} +2 -2
- package/dist/safe-bash/chunks/chunk-OSMQCYSP.js +19 -0
- package/dist/safe-bash/chunks/chunk-OYB332PQ.js +17 -0
- package/dist/safe-bash/chunks/{chunk-ZMYVCRAF.js → chunk-QTIH2AFE.js} +77 -69
- package/dist/safe-bash/chunks/{chunk-PYTLIUST.js → chunk-SBESXWT2.js} +43 -44
- package/dist/safe-bash/chunks/{chunk-4FDQJUFW.js → chunk-SDEPGTOF.js} +1 -1
- package/dist/safe-bash/chunks/chunk-UZU5BIJI.js +32 -0
- package/dist/safe-bash/chunks/{chunk-BI6JV62X.js → chunk-VCCMROTL.js} +7 -10
- package/dist/safe-bash/chunks/chunk-W47GHRRF.js +13 -0
- package/dist/safe-bash/chunks/{chunk-NPMQWZUZ.js → chunk-WS7KZIUM.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-3PZYHMGM.js → chunk-YYAERCWS.js} +7 -7
- package/dist/safe-bash/chunks/{chunk-5U7JECDB.js → chunk-ZPGVEUKF.js} +8 -7
- package/dist/safe-bash/chunks/{csvkit-K55OYAQC.js → csvkit-USUJG62I.js} +65 -11
- package/dist/safe-bash/chunks/{ffmpeg-BEFTQ6DZ.js → ffmpeg-KRGG5DLH.js} +21 -10
- package/dist/safe-bash/chunks/{gh-HQWOWLWE.js → gh-UCFDUZCX.js} +16 -8
- package/dist/safe-bash/chunks/{git-UFNPAOYZ.js → git-LPAF6KDG.js} +7 -9
- package/dist/safe-bash/chunks/{imagemagick-53BMHH6D.js → imagemagick-KGREKK4G.js} +38 -7
- package/dist/safe-bash/chunks/{implementation-QUTAAYMT.js → implementation-FXDRYS5A.js} +34 -8
- package/dist/safe-bash/chunks/{pdfimages-4OYI6FLG.js → pdfimages-UADCF4G4.js} +12 -8
- package/dist/safe-bash/chunks/{pdfinfo-I7U6TQPP.js → pdfinfo-O7UWPF4W.js} +38 -13
- package/dist/safe-bash/chunks/{pdftk-SUA6FMHI.js → pdftk-AERXIJTN.js} +13 -8
- package/dist/safe-bash/chunks/{pdftoppm-4C5DGEWX.js → pdftoppm-L466JQKI.js} +17 -10
- package/dist/safe-bash/chunks/{pdftotext-Y4WI225Y.js → pdftotext-SUSI4WXS.js} +19 -9
- package/dist/safe-bash/chunks/{qpdf-IORB4RV5.js → qpdf-YL24KVRH.js} +14 -8
- package/dist/safe-bash/chunks/{sips-WHAMJFEU.js → sips-QXEQZERX.js} +14 -7
- package/dist/safe-bash/chunks/{soffice-SYEK6WJS.js → soffice-TBITRML3.js} +16 -8
- package/dist/safe-bash/chunks/{wkhtmltopdf-ZIICWJLF.js → wkhtmltopdf-NJA2THRC.js} +27 -7
- package/dist/safe-bash/command-chunks/chunk-2C5BEBPY.js +1388 -0
- package/dist/safe-bash/command-chunks/{chunk-FXYWQ6S4.js → chunk-2EXV2ZLV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PFBJR2PY.js → chunk-2KRKKW5S.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4DSJDVBM.js → chunk-32F3RBUW.js} +10 -749
- package/dist/safe-bash/command-chunks/{chunk-L3MLMXL4.js → chunk-3ZK5F23O.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4QX6XCDD.js → chunk-4RNIZ3RT.js} +79 -0
- package/dist/safe-bash/command-chunks/{chunk-D7TADAYG.js → chunk-64LG3EVJ.js} +17 -0
- package/dist/safe-bash/command-chunks/{chunk-TOSM3T3A.js → chunk-6EASC5EC.js} +20 -9
- package/dist/safe-bash/command-chunks/{chunk-ZF3ZVGQC.js → chunk-7JRITHKW.js} +150 -80
- package/dist/safe-bash/command-chunks/{chunk-IJ3FXP4Q.js → chunk-A3ZX6SCY.js} +1 -1
- package/dist/safe-bash/{chunks/chunk-LD76P7AG.js → command-chunks/chunk-AKDMCNX4.js} +74 -39
- package/dist/safe-bash/command-chunks/{chunk-KSIGF4AG.js → chunk-BK4CMEE6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JUDOV5MJ.js → chunk-CBDVLMJB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XGMWWUHV.js → chunk-CZ5DAK4K.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-Z57TV6TC.js → chunk-EZ2DTOLI.js} +4 -2
- package/dist/safe-bash/command-chunks/{chunk-ADCGH6A7.js → chunk-FH3D75FC.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WYJTWJZ5.js → chunk-G3G6W5ZE.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3HDIDEUJ.js → chunk-GF54KE2M.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-H4LWTITX.js +169 -0
- package/dist/safe-bash/command-chunks/chunk-I2MQNBGR.js +145 -0
- package/dist/safe-bash/command-chunks/{chunk-Z7TYZG3A.js → chunk-IHHTTQX6.js} +5 -3
- package/dist/safe-bash/command-chunks/{chunk-5GRLAARV.js → chunk-IOXI5ZAJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-INDIFLBW.js → chunk-JTAGNROA.js} +4 -0
- package/dist/safe-bash/command-chunks/{chunk-Y5IHIAY3.js → chunk-MDPIOQUD.js} +12 -8
- package/dist/safe-bash/command-chunks/chunk-PGEYORBZ.js +25 -0
- package/dist/safe-bash/command-chunks/chunk-QI4MGIN6.js +6 -0
- package/dist/safe-bash/command-chunks/chunk-QM4UZF3C.js +753 -0
- package/dist/safe-bash/command-chunks/chunk-QTYZAWSB.js +91 -0
- package/dist/safe-bash/command-chunks/chunk-SNK7K3XW.js +90 -0
- package/dist/safe-bash/command-chunks/chunk-T5OLGM43.js +314 -0
- package/dist/safe-bash/command-chunks/chunk-TB7IFMUZ.js +802 -0
- package/dist/safe-bash/command-chunks/{chunk-YNT4ZJHW.js → chunk-TPPBPIWL.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-VMK4XVKO.js +82 -0
- package/dist/safe-bash/command-chunks/chunk-VNSJKXDU.js +130 -0
- package/dist/safe-bash/command-chunks/{chunk-2LP3VMPA.js → chunk-WFDW4XXD.js} +1 -17
- package/dist/safe-bash/command-chunks/chunk-WR37IS4O.js +318 -0
- package/dist/safe-bash/command-chunks/chunk-YFNTMH6Z.js +6 -0
- package/dist/safe-bash/commands/basic.js +148 -48
- package/dist/safe-bash/commands/bytes/compression/index.js +5 -6
- package/dist/safe-bash/commands/cmp.d.ts +2 -3
- package/dist/safe-bash/commands/cmp.js +2 -689
- package/dist/safe-bash/commands/csplit/index.browser.js +2 -2
- package/dist/safe-bash/commands/docx/index.browser.js +4 -47
- package/dist/safe-bash/commands/docx/index.d.ts +2 -24
- package/dist/safe-bash/commands/docx/index.js +2 -41
- package/dist/safe-bash/commands/docx/io.d.ts +1 -14
- package/dist/safe-bash/commands/docx/io.js +1 -15
- package/dist/safe-bash/commands/factor/index.browser.js +2 -2
- package/dist/safe-bash/commands/getopt/index.browser.js +2 -2
- package/dist/safe-bash/commands/hexdump/index.browser.js +2 -2
- package/dist/safe-bash/commands/iconv/index.browser.js +2 -2
- package/dist/safe-bash/commands/line-endings/index.browser.js +2 -2
- package/dist/safe-bash/commands/llm/command.d.ts +1 -4
- package/dist/safe-bash/commands/llm/command.js +1 -248
- package/dist/safe-bash/commands/llm/elevenlabs-stream.d.ts +1 -2
- package/dist/safe-bash/commands/llm/elevenlabs-stream.js +1 -117
- package/dist/safe-bash/commands/llm/elevenlabs.d.ts +1 -15
- package/dist/safe-bash/commands/llm/elevenlabs.js +1 -123
- package/dist/safe-bash/commands/llm/index.browser.js +20 -15
- package/dist/safe-bash/commands/llm/index.d.ts +1 -6
- package/dist/safe-bash/commands/llm/index.js +1 -4
- package/dist/safe-bash/commands/llm/mime.d.ts +1 -2
- package/dist/safe-bash/commands/llm/mime.js +1 -136
- package/dist/safe-bash/commands/llm/openai-http.d.ts +1 -8
- package/dist/safe-bash/commands/llm/openai-http.js +1 -143
- package/dist/safe-bash/commands/llm/openai-sse.d.ts +1 -3
- package/dist/safe-bash/commands/llm/openai-sse.js +1 -78
- package/dist/safe-bash/commands/llm/openai.d.ts +1 -14
- package/dist/safe-bash/commands/llm/openai.js +1 -288
- package/dist/safe-bash/commands/llm/providers/elevenlabs.d.ts +1 -1
- package/dist/safe-bash/commands/llm/providers/elevenlabs.js +1 -1
- package/dist/safe-bash/commands/llm/providers/index.browser.js +6 -6
- package/dist/safe-bash/commands/llm/providers/index.d.ts +1 -3
- package/dist/safe-bash/commands/llm/providers/index.js +1 -2
- package/dist/safe-bash/commands/llm/providers/openai.d.ts +1 -1
- package/dist/safe-bash/commands/llm/providers/openai.js +1 -1
- package/dist/safe-bash/commands/llm/providers/shared.d.ts +1 -23
- package/dist/safe-bash/commands/llm/providers/shared.js +1 -65
- package/dist/safe-bash/commands/llm/service.d.ts +1 -37
- package/dist/safe-bash/commands/llm/service.js +1 -151
- package/dist/safe-bash/commands/llm/types.d.ts +1 -52
- package/dist/safe-bash/commands/llm/types.js +1 -1
- package/dist/safe-bash/commands/mdq/index.browser.js +3 -3
- package/dist/safe-bash/commands/media/index.browser.js +1 -1
- package/dist/safe-bash/commands/network/index.browser.js +9 -9
- package/dist/safe-bash/commands/network/types.d.ts +2 -40
- package/dist/safe-bash/commands/node/index.browser.js +6 -8
- package/dist/safe-bash/commands/op/index.browser.js +3 -3
- package/dist/safe-bash/commands/op/index.js +12 -28
- package/dist/safe-bash/commands/pptx/index.d.ts +2 -28
- package/dist/safe-bash/commands/pptx/index.js +2 -152
- package/dist/safe-bash/commands/pr/index.browser.js +2 -2
- package/dist/safe-bash/commands/printf-float.d.ts +1 -0
- package/dist/safe-bash/commands/printf-float.js +48 -38
- package/dist/safe-bash/commands/printf-format.js +9 -6
- package/dist/safe-bash/commands/printf-quote.d.ts +3 -0
- package/dist/safe-bash/commands/printf-quote.js +62 -0
- package/dist/safe-bash/commands/printf-wide.d.ts +5 -0
- package/dist/safe-bash/commands/printf-wide.js +41 -0
- package/dist/safe-bash/commands/python/index.browser.js +8 -8
- package/dist/safe-bash/commands/python/worker.browser.js +2 -2
- package/dist/safe-bash/commands/truncate.d.ts +2 -3
- package/dist/safe-bash/commands/truncate.js +2 -686
- package/dist/safe-bash/commands/tsort/index.browser.js +2 -2
- package/dist/safe-bash/commands/xml/index.browser.js +2 -2
- package/dist/safe-bash/commands/yq/index.browser.js +3 -3
- package/dist/safe-bash/contracts/diagnostics.d.ts +2 -0
- package/dist/safe-bash/contracts/diagnostics.js +2 -0
- package/dist/safe-bash/contracts/runtime-control.d.ts +2 -0
- package/dist/safe-bash/contracts/runtime-control.js +2 -0
- package/dist/safe-bash/core.browser.d.ts +1 -1
- package/dist/safe-bash/core.browser.js +10645 -14065
- package/dist/safe-bash/core.d.ts +10 -1
- package/dist/safe-bash/core.js +0 -1
- package/dist/safe-bash/jobs.browser.js +5 -4
- package/dist/safe-bash/opt-in/commands/cmp/index.d.ts +6 -2
- package/dist/safe-bash/opt-in/commands/cmp/index.js +776 -79
- package/dist/safe-bash/opt-in/commands/cmp/options.d.ts +0 -12
- package/dist/safe-bash/opt-in/commands/cmp/options.js +0 -153
- package/dist/safe-bash/opt-in/commands/truncate/index.d.ts +8 -3
- package/dist/safe-bash/opt-in/commands/truncate/index.js +790 -272
- package/dist/safe-bash/opt-in/commands/truncate/sync.d.ts +1 -0
- package/dist/safe-bash/opt-in/commands/truncate/sync.js +60 -0
- package/dist/safe-bash/optional-host.browser.js +61 -80
- package/dist/safe-bash/optional-host.d.ts +3 -1
- package/dist/safe-bash/optional-host.js +3 -1
- package/dist/safe-bash/shell/runtime.js +44 -18
- package/dist/safe-bash/yq-browser/index.js +1 -1
- package/dist/safe-bash-checksum-engine/index.d.ts +1 -1
- package/dist/safe-bash-checksum-engine/index.js +14 -2
- package/dist/safe-bash-command-bzip2/index.js +2 -1
- package/dist/safe-bash-command-cmp/index.d.ts +10 -0
- package/dist/safe-bash-command-cmp/index.js +796 -0
- package/dist/safe-bash-command-cmp/options.d.ts +12 -0
- package/dist/safe-bash-command-cmp/options.js +42 -0
- package/dist/safe-bash-command-csvcut/index.js +11 -8
- package/dist/safe-bash-command-csvgrep/index.js +35 -7
- package/dist/safe-bash-command-csvkit/codecs/python.js +4 -3
- package/dist/safe-bash-command-csvkit/codecs/utf8.js +3 -2
- package/dist/safe-bash-command-csvkit/index.js +80 -324
- package/dist/safe-bash-command-csvkit/python-regex.d.ts +5 -0
- package/dist/safe-bash-command-csvkit/python-regex.js +14 -0
- package/dist/safe-bash-command-csvkit/runtime.d.ts +1 -0
- package/dist/safe-bash-command-csvkit/sync-support.js +4 -2
- package/dist/safe-bash-command-diff3/index.js +3 -0
- package/dist/safe-bash-command-docx/LICENSE +21 -0
- package/dist/safe-bash-command-docx/index.d.ts +30 -0
- package/dist/safe-bash-command-docx/index.js +67 -0
- package/dist/safe-bash-command-docx/io.d.ts +14 -0
- package/dist/safe-bash-command-docx/io.js +26 -0
- package/dist/safe-bash-command-envsubst/index.js +34 -3
- package/dist/safe-bash-command-exiftool/index.js +3 -0
- package/dist/safe-bash-command-ffmpeg/index.js +8073 -7940
- package/dist/safe-bash-command-fold/family.js +1 -1
- package/dist/safe-bash-command-fold/index.js +1 -1
- package/dist/safe-bash-command-git/git_rust.wasm +0 -0
- package/dist/safe-bash-command-git/wasm.generated.js +1 -1
- package/dist/safe-bash-command-htmlq/index.js +5 -0
- package/dist/safe-bash-command-imagemagick/index.d.ts +25 -21
- package/dist/safe-bash-command-imagemagick/index.js +671 -273
- package/dist/safe-bash-command-llm/LICENSE +21 -0
- package/dist/safe-bash-command-llm/command.d.ts +5 -0
- package/dist/safe-bash-command-llm/command.js +14 -0
- package/dist/safe-bash-command-llm/configuration.d.ts +18 -0
- package/dist/safe-bash-command-llm/elevenlabs-stream.d.ts +2 -0
- package/dist/safe-bash-command-llm/elevenlabs-stream.js +7 -0
- package/dist/safe-bash-command-llm/elevenlabs.d.ts +15 -0
- package/dist/safe-bash-command-llm/elevenlabs.js +10 -0
- package/dist/safe-bash-command-llm/index.d.ts +10 -0
- package/dist/safe-bash-command-llm/index.js +46 -0
- package/dist/safe-bash-command-llm/mime.d.ts +2 -0
- package/dist/safe-bash-command-llm/mime.js +9 -0
- package/dist/safe-bash-command-llm/model-options.d.ts +3 -0
- package/dist/safe-bash-command-llm/openai-http.d.ts +8 -0
- package/dist/safe-bash-command-llm/openai-http.js +17 -0
- package/dist/safe-bash-command-llm/openai-sse.d.ts +3 -0
- package/dist/safe-bash-command-llm/openai-sse.js +8 -0
- package/dist/safe-bash-command-llm/openai.d.ts +14 -0
- package/dist/safe-bash-command-llm/openai.js +12 -0
- package/dist/safe-bash-command-llm/providers/elevenlabs.d.ts +1 -0
- package/dist/safe-bash-command-llm/providers/elevenlabs.js +11 -0
- package/dist/safe-bash-command-llm/providers/index.d.ts +3 -0
- package/dist/safe-bash-command-llm/providers/index.js +24 -0
- package/dist/safe-bash-command-llm/providers/openai.d.ts +1 -0
- package/dist/safe-bash-command-llm/providers/openai.js +13 -0
- package/dist/safe-bash-command-llm/providers/shared.d.ts +23 -0
- package/dist/safe-bash-command-llm/providers/shared.js +13 -0
- package/dist/safe-bash-command-llm/schemas.d.ts +2 -0
- package/dist/safe-bash-command-llm/service.d.ts +42 -0
- package/dist/safe-bash-command-llm/service.js +9 -0
- package/dist/safe-bash-command-llm/templates.d.ts +27 -0
- package/dist/safe-bash-command-llm/types.d.ts +87 -0
- package/dist/safe-bash-command-llm/types.js +6 -0
- package/dist/safe-bash-command-mmdc/command.d.ts +4 -0
- package/dist/safe-bash-command-mmdc/index.d.ts +1 -1
- package/dist/safe-bash-command-mmdc/index.js +7134 -6699
- package/dist/safe-bash-command-mmdc/layout.d.ts +1 -0
- package/dist/safe-bash-command-mmdc/parser.d.ts +1 -0
- package/dist/safe-bash-command-mmdc/png.d.ts +3 -0
- package/dist/safe-bash-command-mmdc/raster.d.ts +1 -0
- package/dist/safe-bash-command-mmdc/svg.d.ts +1 -0
- package/dist/safe-bash-command-op/index.js +19 -14
- package/dist/safe-bash-command-pandoc/command.js +3 -3
- package/dist/safe-bash-command-pandoc/index.js +3 -3
- package/dist/safe-bash-command-pdfimages/index.d.ts +7 -1
- package/dist/safe-bash-command-pdfimages/index.js +210 -113
- package/dist/safe-bash-command-pdfinfo/index.d.ts +24 -20
- package/dist/safe-bash-command-pdfinfo/index.js +517 -241
- package/dist/safe-bash-command-pdftk/index.d.ts +7 -3
- package/dist/safe-bash-command-pdftk/index.js +261 -125
- package/dist/safe-bash-command-pdftoppm/index.d.ts +15 -7
- package/dist/safe-bash-command-pdftoppm/index.js +326 -189
- package/dist/safe-bash-command-pdftotext/index.d.ts +9 -5
- package/dist/safe-bash-command-pdftotext/index.js +237 -107
- package/dist/safe-bash-command-pptx/LICENSE +21 -0
- package/dist/safe-bash-command-pptx/index.d.ts +33 -0
- package/dist/safe-bash-command-pptx/index.js +168 -0
- package/dist/safe-bash-command-qpdf/index.d.ts +9 -3
- package/dist/safe-bash-command-qpdf/index.js +254 -130
- package/dist/safe-bash-command-sha512sum/index.js +12 -475
- package/dist/safe-bash-command-sips/index.d.ts +9 -5
- package/dist/safe-bash-command-sips/index.js +65 -46
- package/dist/safe-bash-command-soffice/index.d.ts +9 -3
- package/dist/safe-bash-command-soffice/index.js +66 -25
- package/dist/safe-bash-command-sqlite3/engine.d.ts +9 -0
- package/dist/safe-bash-command-sqlite3/index.d.ts +1 -0
- package/dist/safe-bash-command-sqlite3/index.js +851 -352
- package/dist/safe-bash-command-ssconvert/formats/xls.js +3 -3
- package/dist/safe-bash-command-ssconvert/index.js +147 -80
- package/dist/safe-bash-command-timeout/index.js +3 -3
- package/dist/safe-bash-command-truncate/index.d.ts +8 -3
- package/dist/safe-bash-command-truncate/index.js +790 -272
- package/dist/safe-bash-command-truncate/sync.d.ts +1 -0
- package/dist/safe-bash-command-truncate/sync.js +60 -0
- package/dist/safe-bash-command-wkhtmltopdf/index.js +239 -118
- package/dist/safe-bash-command-wkhtmltopdf/pdf-renderer.d.ts +1 -1
- package/dist/safe-bash-command-xxd/index.js +78 -20
- package/dist/safe-bash-command-xz/command.d.ts +4 -0
- package/dist/safe-bash-command-xz/index.d.ts +1 -1
- package/dist/safe-bash-command-xz/index.js +1 -1
- package/dist/safe-bash-compression-engine/bounded-codec.js +3 -3
- package/dist/safe-bash-compression-engine/codec-loader.js +2 -2
- package/dist/safe-bash-compression-engine/files.js +6 -6
- package/dist/safe-bash-compression-engine/index.js +5 -5
- package/dist/safe-bash-compression-engine/operand.js +6 -6
- package/dist/safe-bash-compression-engine/stream.js +5 -5
- package/dist/safe-bash-compression-engine/zstd-decode.js +4 -4
- package/dist/safe-bash-contracts/command.js +3 -3
- package/dist/safe-bash-contracts/default-executor.d.ts +5 -0
- package/dist/safe-bash-contracts/default-executor.js +37 -0
- package/dist/safe-bash-contracts/diagnostics.js +3 -3
- package/dist/safe-bash-contracts/escaping.js +9 -9
- package/dist/safe-bash-contracts/filesystem-descriptor.js +3 -3
- package/dist/safe-bash-contracts/filesystem-output.js +8 -8
- package/dist/safe-bash-contracts/http.d.ts +41 -0
- package/dist/safe-bash-contracts/http.js +6 -0
- package/dist/safe-bash-contracts/index.js +21 -19
- package/dist/safe-bash-contracts/io.d.ts +12 -0
- package/dist/safe-bash-contracts/io.js +4 -1
- package/dist/safe-bash-contracts/output.js +3 -2
- package/dist/safe-bash-contracts/runtime-control.js +2 -2
- package/dist/safe-bash-contracts/signals.js +1 -1
- package/dist/safe-bash-contracts/yield.d.ts +1 -0
- package/dist/safe-bash-contracts/yield.js +3 -1
- package/dist/safe-bash-csv-engine/index.d.ts +10 -1
- package/dist/safe-bash-csv-engine/index.js +78 -6
- package/dist/safe-bash-io-engine/commands/search/requirements.js +3 -3
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +3 -3
- package/dist/safe-bash-io-engine/gnu-information.d.ts +1 -1
- package/dist/safe-bash-io-engine/gnu-information.js +1 -1
- package/dist/safe-bash-io-engine/internal.d.ts +1 -1
- package/dist/safe-bash-io-engine/internal.js +2 -2
- package/dist/safe-bash-query-engine/index.js +5 -5
- package/dist/safe-bash-query-engine/interpreter.js +3 -3
- package/dist/safe-bash-query-engine/query-core.js +5 -5
- package/package.json +2 -2
- package/dist/safe-bash/chunks/chunk-2G2T5MEM.js +0 -14
- package/dist/safe-bash/chunks/chunk-FJZNUUOQ.js +0 -81
- package/dist/safe-bash/chunks/chunk-GJWUEOT6.js +0 -14
- package/dist/safe-bash/chunks/chunk-LAPF2XE6.js +0 -14
- package/dist/safe-bash/chunks/chunk-O6356Z27.js +0 -37
- package/dist/safe-bash/chunks/chunk-S2LSZFZ6.js +0 -758
- package/dist/safe-bash/chunks/chunk-T3VDYWKZ.js +0 -21
- package/dist/safe-bash/chunks/chunk-VYW4Q6KF.js +0 -12
- package/dist/safe-bash/chunks/chunk-WHURJBET.js +0 -409
- package/dist/safe-bash/opt-in/commands/cmp/compare.js +0 -95
- package/dist/safe-bash/opt-in/commands/cmp/io.js +0 -218
- package/dist/safe-bash/command-chunks/{chunk-RTOJNFFL.js → chunk-KNI4GRXF.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DEH3CMGL.js → chunk-QJ3ONEBI.js} +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
init_buffer
|
|
3
|
+
} from "./chunk-HX3SHTCE.js";
|
|
4
4
|
|
|
5
|
-
// packages/safe-bash/
|
|
6
|
-
|
|
5
|
+
// packages/safe-bash-command-llm/dist/mime.js
|
|
6
|
+
init_buffer();
|
|
7
7
|
import { classify } from "../../safe-bash-command-file/classify.js";
|
|
8
8
|
var extensions = {
|
|
9
9
|
png: "image/png",
|
|
@@ -48,35 +48,45 @@ var extensions = {
|
|
|
48
48
|
};
|
|
49
49
|
function ebmlInteger(bytes, offset, retainMarker = false) {
|
|
50
50
|
const first = bytes[offset];
|
|
51
|
-
if (!first)
|
|
51
|
+
if (!first)
|
|
52
|
+
return void 0;
|
|
52
53
|
let marker = 128, width = 1;
|
|
53
54
|
while (!(first & marker)) {
|
|
54
55
|
marker >>= 1;
|
|
55
56
|
width++;
|
|
56
57
|
}
|
|
57
|
-
if (offset + width > bytes.length)
|
|
58
|
+
if (offset + width > bytes.length)
|
|
59
|
+
return void 0;
|
|
58
60
|
let value = retainMarker ? first : first & marker - 1;
|
|
59
|
-
for (let index = 1; index < width; index++)
|
|
60
|
-
|
|
61
|
+
for (let index = 1; index < width; index++)
|
|
62
|
+
value = value * 256 + bytes[offset + index];
|
|
63
|
+
if (!Number.isSafeInteger(value) || !retainMarker && value === 2 ** (7 * width) - 1)
|
|
64
|
+
return void 0;
|
|
61
65
|
return { value, width };
|
|
62
66
|
}
|
|
63
67
|
function ebmlMimeType(bytes) {
|
|
64
68
|
const header = ebmlInteger(bytes, 4);
|
|
65
|
-
if (!header)
|
|
69
|
+
if (!header)
|
|
70
|
+
return void 0;
|
|
66
71
|
let offset = 4 + header.width;
|
|
67
72
|
const end = Math.min(bytes.length, offset + header.value, 4096);
|
|
68
73
|
while (offset < end) {
|
|
69
74
|
const identifier = ebmlInteger(bytes, offset, true);
|
|
70
|
-
if (!identifier)
|
|
75
|
+
if (!identifier)
|
|
76
|
+
return void 0;
|
|
71
77
|
offset += identifier.width;
|
|
72
78
|
const size = ebmlInteger(bytes, offset);
|
|
73
|
-
if (!size)
|
|
79
|
+
if (!size)
|
|
80
|
+
return void 0;
|
|
74
81
|
offset += size.width;
|
|
75
|
-
if (size.value > end - offset)
|
|
82
|
+
if (size.value > end - offset)
|
|
83
|
+
return void 0;
|
|
76
84
|
if (identifier.value === 17026) {
|
|
77
85
|
const docType = new TextDecoder().decode(bytes.subarray(offset, offset + size.value)).split("\0", 1)[0];
|
|
78
|
-
if (docType === "webm")
|
|
79
|
-
|
|
86
|
+
if (docType === "webm")
|
|
87
|
+
return "video/webm";
|
|
88
|
+
if (docType === "matroska")
|
|
89
|
+
return "video/x-matroska";
|
|
80
90
|
return void 0;
|
|
81
91
|
}
|
|
82
92
|
offset += size.value;
|
|
@@ -86,53 +96,78 @@ function ebmlMimeType(bytes) {
|
|
|
86
96
|
function sniffMimeType(path, bytes) {
|
|
87
97
|
const matches = (signature, offset = 0) => bytes.length >= offset + signature.length && signature.every((byte, index) => bytes[offset + index] === byte);
|
|
88
98
|
const ascii = (offset, text) => bytes.length >= offset + text.length && [...text].every((character, index) => bytes[offset + index] === character.charCodeAt(0));
|
|
89
|
-
if (matches([137, 80, 78, 71, 13, 10, 26, 10]))
|
|
90
|
-
|
|
91
|
-
if (
|
|
99
|
+
if (matches([137, 80, 78, 71, 13, 10, 26, 10]))
|
|
100
|
+
return "image/png";
|
|
101
|
+
if (matches([255, 216, 255]))
|
|
102
|
+
return "image/jpeg";
|
|
103
|
+
if (ascii(0, "GIF87a") || ascii(0, "GIF89a"))
|
|
104
|
+
return "image/gif";
|
|
92
105
|
if (ascii(0, "RIFF")) {
|
|
93
|
-
if (ascii(8, "WEBP"))
|
|
94
|
-
|
|
95
|
-
if (ascii(8, "
|
|
106
|
+
if (ascii(8, "WEBP"))
|
|
107
|
+
return "image/webp";
|
|
108
|
+
if (ascii(8, "WAVE"))
|
|
109
|
+
return "audio/wav";
|
|
110
|
+
if (ascii(8, "AVI "))
|
|
111
|
+
return "video/x-msvideo";
|
|
96
112
|
}
|
|
97
|
-
if (ascii(0, "fLaC"))
|
|
113
|
+
if (ascii(0, "fLaC"))
|
|
114
|
+
return "audio/flac";
|
|
98
115
|
if (ascii(0, "OggS")) {
|
|
99
116
|
const packet = 27 + (bytes[26] ?? 0);
|
|
100
|
-
if (bytes[26] && bytes[packet] === 128 && ascii(packet + 1, "theora"))
|
|
117
|
+
if (bytes[26] && bytes[packet] === 128 && ascii(packet + 1, "theora"))
|
|
118
|
+
return "video/ogg";
|
|
101
119
|
return "audio/ogg";
|
|
102
120
|
}
|
|
103
|
-
if (ascii(0, "ID3") || bytes.length >= 2 && bytes[0] === 255 && (bytes[1] & 224) === 224 && (bytes[1] & 6) !== 0)
|
|
104
|
-
|
|
105
|
-
if (
|
|
121
|
+
if (ascii(0, "ID3") || bytes.length >= 2 && bytes[0] === 255 && (bytes[1] & 224) === 224 && (bytes[1] & 6) !== 0)
|
|
122
|
+
return "audio/mpeg";
|
|
123
|
+
if (bytes.length >= 2 && bytes[0] === 255 && (bytes[1] & 246) === 240)
|
|
124
|
+
return "audio/aac";
|
|
125
|
+
if (ascii(0, "FORM") && (ascii(8, "AIFF") || ascii(8, "AIFC")))
|
|
126
|
+
return "audio/aiff";
|
|
106
127
|
if (ascii(4, "ftyp")) {
|
|
107
|
-
if (ascii(8, "avif") || ascii(8, "avis"))
|
|
108
|
-
|
|
109
|
-
if (ascii(8, "
|
|
110
|
-
|
|
111
|
-
if (ascii(8, "
|
|
128
|
+
if (ascii(8, "avif") || ascii(8, "avis"))
|
|
129
|
+
return "image/avif";
|
|
130
|
+
if (ascii(8, "heic") || ascii(8, "heix"))
|
|
131
|
+
return "image/heic";
|
|
132
|
+
if (ascii(8, "mif1") || ascii(8, "msf1"))
|
|
133
|
+
return "image/heif";
|
|
134
|
+
if (ascii(8, "M4A ") || ascii(8, "M4B "))
|
|
135
|
+
return "audio/mp4";
|
|
136
|
+
if (ascii(8, "qt "))
|
|
137
|
+
return "video/quicktime";
|
|
112
138
|
return "video/mp4";
|
|
113
139
|
}
|
|
114
140
|
if (matches([26, 69, 223, 163])) {
|
|
115
141
|
const mimeType = ebmlMimeType(bytes);
|
|
116
|
-
if (mimeType)
|
|
142
|
+
if (mimeType)
|
|
143
|
+
return mimeType;
|
|
117
144
|
}
|
|
118
|
-
if (ascii(0, "%PDF-"))
|
|
119
|
-
|
|
120
|
-
if (matches([
|
|
121
|
-
|
|
122
|
-
if (
|
|
145
|
+
if (ascii(0, "%PDF-"))
|
|
146
|
+
return "application/pdf";
|
|
147
|
+
if (matches([80, 75, 3, 4]) || matches([80, 75, 5, 6]))
|
|
148
|
+
return "application/zip";
|
|
149
|
+
if (matches([31, 139]))
|
|
150
|
+
return "application/gzip";
|
|
151
|
+
if (matches([73, 73, 42, 0]) || matches([77, 77, 0, 42]))
|
|
152
|
+
return "image/tiff";
|
|
153
|
+
if (ascii(0, "BM"))
|
|
154
|
+
return "image/bmp";
|
|
123
155
|
const prefix = bytes.subarray(0, 512);
|
|
124
156
|
const classified = classify(prefix, bytes.length <= prefix.length).mime;
|
|
125
|
-
if (!["application/octet-stream", "text/plain", "inode/x-empty"].includes(classified))
|
|
157
|
+
if (!["application/octet-stream", "text/plain", "inode/x-empty"].includes(classified))
|
|
158
|
+
return classified;
|
|
126
159
|
const filename = path.slice(path.lastIndexOf("/") + 1);
|
|
127
160
|
const dot = filename.lastIndexOf(".");
|
|
128
161
|
const extension = dot < 0 ? "" : filename.slice(dot + 1).toLowerCase();
|
|
129
162
|
return Object.hasOwn(extensions, extension) ? extensions[extension] : classified === "inode/x-empty" ? "application/octet-stream" : classified;
|
|
130
163
|
}
|
|
131
164
|
function acceptsMimeType(types, mimeType) {
|
|
132
|
-
if ([...mimeType].some((character) => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127))
|
|
165
|
+
if ([...mimeType].some((character) => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127))
|
|
166
|
+
return false;
|
|
133
167
|
const mime = mimeType.split(";", 1)[0].trim().toLowerCase();
|
|
134
168
|
const parts = mime.split("/");
|
|
135
|
-
if (parts.length !== 2 || parts.some((part) => !part || [...part].some((character) => !(character >= "a" && character <= "z" || character >= "0" && character <= "9" || "!#$%&'+-.^_`|~".includes(character)))))
|
|
169
|
+
if (parts.length !== 2 || parts.some((part) => !part || [...part].some((character) => !(character >= "a" && character <= "z" || character >= "0" && character <= "9" || "!#$%&'+-.^_`|~".includes(character)))))
|
|
170
|
+
return false;
|
|
136
171
|
return types.some((type) => {
|
|
137
172
|
const accepted = type.toLowerCase();
|
|
138
173
|
return accepted === mime || accepted.endsWith("/*") && accepted.slice(0, -2) === parts[0];
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_buffer
|
|
3
|
+
} from "./chunk-HX3SHTCE.js";
|
|
4
|
+
|
|
5
|
+
// packages/safe-bash-command-llm/dist/openai-http.js
|
|
6
|
+
init_buffer();
|
|
7
|
+
import { yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
8
|
+
function openAiAbortable(pending, signal) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const abort = () => {
|
|
11
|
+
signal.removeEventListener("abort", abort);
|
|
12
|
+
reject(signal.reason);
|
|
13
|
+
};
|
|
14
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
15
|
+
Promise.resolve(pending).then((value) => {
|
|
16
|
+
signal.removeEventListener("abort", abort);
|
|
17
|
+
if (signal.aborted)
|
|
18
|
+
reject(signal.reason);
|
|
19
|
+
else
|
|
20
|
+
resolve(value);
|
|
21
|
+
}, (error) => {
|
|
22
|
+
signal.removeEventListener("abort", abort);
|
|
23
|
+
reject(signal.aborted ? signal.reason : error);
|
|
24
|
+
});
|
|
25
|
+
if (signal.aborted)
|
|
26
|
+
abort();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async function* openAiBytes(source, signal, limit = Infinity) {
|
|
30
|
+
signal.throwIfAborted();
|
|
31
|
+
const iterator = source[Symbol.asyncIterator]();
|
|
32
|
+
let failed = false, finished = false;
|
|
33
|
+
let size = 0, windows = 0;
|
|
34
|
+
try {
|
|
35
|
+
while (true) {
|
|
36
|
+
signal.throwIfAborted();
|
|
37
|
+
const next = await openAiAbortable(iterator.next(), signal);
|
|
38
|
+
if (next.done) {
|
|
39
|
+
finished = true;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (!(next.value instanceof Uint8Array))
|
|
43
|
+
throw new Error("OpenAI returned a non-byte response chunk");
|
|
44
|
+
size += next.value.byteLength;
|
|
45
|
+
if (size > limit)
|
|
46
|
+
throw new RangeError("Provider response byte limit exceeded");
|
|
47
|
+
if (!next.value.byteLength)
|
|
48
|
+
yield new Uint8Array(0);
|
|
49
|
+
for (let offset = 0; offset < next.value.byteLength; offset += 16384) {
|
|
50
|
+
if (++windows % 64 === 0)
|
|
51
|
+
await yieldTurn(signal);
|
|
52
|
+
signal.throwIfAborted();
|
|
53
|
+
yield Uint8Array.from(next.value.subarray(offset, offset + 16384));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
failed = true;
|
|
58
|
+
throw signal.aborted ? signal.reason : error;
|
|
59
|
+
} finally {
|
|
60
|
+
if (!finished) {
|
|
61
|
+
const returned = Promise.resolve().then(() => iterator.return?.());
|
|
62
|
+
if (signal.aborted)
|
|
63
|
+
void returned.catch(() => void 0);
|
|
64
|
+
else
|
|
65
|
+
await openAiAbortable(returned, signal).catch((error) => {
|
|
66
|
+
if (!failed)
|
|
67
|
+
throw error;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function openAiJson(response, signal, maxBytes = Infinity) {
|
|
73
|
+
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
74
|
+
let text = "", length = 0;
|
|
75
|
+
for await (const chunk of openAiBytes(response.body, signal, maxBytes)) {
|
|
76
|
+
length += chunk.byteLength;
|
|
77
|
+
if (length > maxBytes)
|
|
78
|
+
throw new Error("OpenAI JSON response exceeds buffer limit");
|
|
79
|
+
text += decoder.decode(chunk, { stream: true });
|
|
80
|
+
}
|
|
81
|
+
text += decoder.decode();
|
|
82
|
+
let value;
|
|
83
|
+
try {
|
|
84
|
+
value = JSON.parse(text);
|
|
85
|
+
} catch {
|
|
86
|
+
throw new Error("OpenAI returned malformed JSON");
|
|
87
|
+
}
|
|
88
|
+
if (!openAiRecord(value))
|
|
89
|
+
throw new Error("OpenAI returned a non-object JSON response");
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
function openAiRecord(value) {
|
|
93
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
94
|
+
}
|
|
95
|
+
function openAiError(value) {
|
|
96
|
+
if (typeof value === "string" && value)
|
|
97
|
+
return value.slice(0, 1024);
|
|
98
|
+
if (openAiRecord(value) && typeof value.message === "string")
|
|
99
|
+
return value.message.slice(0, 1024);
|
|
100
|
+
return void 0;
|
|
101
|
+
}
|
|
102
|
+
async function* openAiResponse(transport, input, maxResponseBytes) {
|
|
103
|
+
input.signal.throwIfAborted();
|
|
104
|
+
const cleanups = /* @__PURE__ */ new Map();
|
|
105
|
+
let closed = false, failed = false;
|
|
106
|
+
const run = (cleanup) => {
|
|
107
|
+
cleanup.pending ??= Promise.resolve().then(cleanup.run);
|
|
108
|
+
return cleanup.pending;
|
|
109
|
+
};
|
|
110
|
+
const register = (cleanup, receiver) => {
|
|
111
|
+
if (cleanups.has(cleanup))
|
|
112
|
+
return;
|
|
113
|
+
const entry = { run: () => cleanup.call(receiver) };
|
|
114
|
+
cleanups.set(cleanup, entry);
|
|
115
|
+
if (closed)
|
|
116
|
+
void run(entry).catch(() => void 0);
|
|
117
|
+
};
|
|
118
|
+
const close = async () => {
|
|
119
|
+
closed = true;
|
|
120
|
+
const results = await Promise.allSettled([...cleanups.values()].map(run));
|
|
121
|
+
const rejected = results.find((result) => result.status === "rejected");
|
|
122
|
+
if (rejected?.status === "rejected")
|
|
123
|
+
throw rejected.reason;
|
|
124
|
+
};
|
|
125
|
+
const abort = () => {
|
|
126
|
+
void close().catch(() => void 0);
|
|
127
|
+
};
|
|
128
|
+
input.signal.addEventListener("abort", abort, { once: true });
|
|
129
|
+
try {
|
|
130
|
+
const pending = Promise.resolve().then(() => {
|
|
131
|
+
input.signal.throwIfAborted();
|
|
132
|
+
return transport({ ...input, registerCleanup: register });
|
|
133
|
+
}).then((response2) => {
|
|
134
|
+
register(response2.dispose, response2);
|
|
135
|
+
return response2;
|
|
136
|
+
});
|
|
137
|
+
const response = await openAiAbortable(pending, input.signal);
|
|
138
|
+
if (!Number.isInteger(response.status) || response.status < 200 || response.status >= 300) {
|
|
139
|
+
let detail;
|
|
140
|
+
try {
|
|
141
|
+
detail = openAiError((await openAiJson(response, input.signal, maxResponseBytes)).error);
|
|
142
|
+
} catch {
|
|
143
|
+
input.signal.throwIfAborted();
|
|
144
|
+
}
|
|
145
|
+
throw new Error(`OpenAI HTTP ${response.status}${detail ? `: ${detail}` : ""}`);
|
|
146
|
+
}
|
|
147
|
+
yield response;
|
|
148
|
+
} catch (error) {
|
|
149
|
+
failed = true;
|
|
150
|
+
throw input.signal.aborted ? input.signal.reason : error;
|
|
151
|
+
} finally {
|
|
152
|
+
input.signal.removeEventListener("abort", abort);
|
|
153
|
+
await close().catch((error) => {
|
|
154
|
+
if (!failed && !input.signal.aborted)
|
|
155
|
+
throw error;
|
|
156
|
+
});
|
|
157
|
+
if (!failed)
|
|
158
|
+
input.signal.throwIfAborted();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export {
|
|
163
|
+
openAiAbortable,
|
|
164
|
+
openAiBytes,
|
|
165
|
+
openAiJson,
|
|
166
|
+
openAiRecord,
|
|
167
|
+
openAiError,
|
|
168
|
+
openAiResponse
|
|
169
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
streamElevenLabs
|
|
3
|
+
} from "./chunk-VNSJKXDU.js";
|
|
4
|
+
import {
|
|
5
|
+
credential,
|
|
6
|
+
jsonBody,
|
|
7
|
+
providerLimits
|
|
8
|
+
} from "./chunk-QTYZAWSB.js";
|
|
9
|
+
import {
|
|
10
|
+
acceptsMimeType
|
|
11
|
+
} from "./chunk-AKDMCNX4.js";
|
|
12
|
+
import {
|
|
13
|
+
init_buffer
|
|
14
|
+
} from "./chunk-HX3SHTCE.js";
|
|
15
|
+
|
|
16
|
+
// packages/safe-bash-command-llm/dist/elevenlabs.js
|
|
17
|
+
init_buffer();
|
|
18
|
+
var outputFormats = /* @__PURE__ */ new Map([
|
|
19
|
+
["audio/mpeg", "mp3_44100_128"],
|
|
20
|
+
["audio/wav", "wav_44100"],
|
|
21
|
+
["audio/x-wav", "wav_44100"],
|
|
22
|
+
["audio/pcm", "pcm_44100"],
|
|
23
|
+
["audio/basic", "ulaw_8000"],
|
|
24
|
+
["audio/opus", "opus_48000_128"],
|
|
25
|
+
["audio/ogg", "opus_48000_128"]
|
|
26
|
+
]);
|
|
27
|
+
var optionTypes = {
|
|
28
|
+
tts: /* @__PURE__ */ new Map([
|
|
29
|
+
["stability", "number"],
|
|
30
|
+
["similarity_boost", "number"],
|
|
31
|
+
["style", "number"],
|
|
32
|
+
["speed", "number"],
|
|
33
|
+
["use_speaker_boost", "boolean"]
|
|
34
|
+
]),
|
|
35
|
+
music: /* @__PURE__ */ new Map([
|
|
36
|
+
["music_length_ms", "integer"],
|
|
37
|
+
["seed", "integer"],
|
|
38
|
+
["force_instrumental", "boolean"],
|
|
39
|
+
["respect_sections_durations", "boolean"],
|
|
40
|
+
["store_for_inpainting", "boolean"],
|
|
41
|
+
["sign_with_c2pa", "boolean"]
|
|
42
|
+
])
|
|
43
|
+
};
|
|
44
|
+
function parseOptions(options, endpoint) {
|
|
45
|
+
return Object.fromEntries(Object.entries(options).map(([key, value]) => {
|
|
46
|
+
const type = optionTypes[endpoint].get(key);
|
|
47
|
+
if (!type)
|
|
48
|
+
return [key, value];
|
|
49
|
+
if (type === "boolean") {
|
|
50
|
+
if (typeof value === "boolean")
|
|
51
|
+
return [key, value];
|
|
52
|
+
if (value === "true" || value === "false")
|
|
53
|
+
return [key, value === "true"];
|
|
54
|
+
} else {
|
|
55
|
+
const number = typeof value === "number" ? value : typeof value === "string" && value.trim() ? Number(value) : NaN;
|
|
56
|
+
if (Number.isFinite(number) && (type !== "integer" || Number.isSafeInteger(number)))
|
|
57
|
+
return [key, number];
|
|
58
|
+
}
|
|
59
|
+
throw new Error(`Invalid ElevenLabs option ${key}: expected ${type}`);
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
function createElevenLabsProvider(options) {
|
|
63
|
+
const transport = options.transport;
|
|
64
|
+
if (typeof transport !== "function")
|
|
65
|
+
throw new TypeError("Provider transport is required");
|
|
66
|
+
const apiKey = credential(options.apiKey);
|
|
67
|
+
const limits = providerLimits(options.limits);
|
|
68
|
+
const baseUrl = new URL(options.baseUrl ?? "https://api.elevenlabs.io");
|
|
69
|
+
if (!["https:", "http:"].includes(baseUrl.protocol) || baseUrl.username || baseUrl.password || baseUrl.search || baseUrl.hash) {
|
|
70
|
+
throw new Error("Invalid ElevenLabs baseUrl: expected an HTTP(S) URL without credentials, query, or fragment");
|
|
71
|
+
}
|
|
72
|
+
if (!baseUrl.pathname.endsWith("/"))
|
|
73
|
+
baseUrl.pathname += "/";
|
|
74
|
+
const models = options.models.map((model) => Object.freeze({
|
|
75
|
+
...model,
|
|
76
|
+
...model.aliases === void 0 ? {} : { aliases: Object.freeze([...model.aliases]) },
|
|
77
|
+
...model.attachmentTypes === void 0 ? {} : { attachmentTypes: Object.freeze([...model.attachmentTypes]) }
|
|
78
|
+
}));
|
|
79
|
+
const byId = /* @__PURE__ */ new Map();
|
|
80
|
+
for (const model of models) {
|
|
81
|
+
if (model.endpoint !== "tts" && model.endpoint !== "music")
|
|
82
|
+
throw new Error(`Invalid ElevenLabs endpoint: ${model.endpoint}`);
|
|
83
|
+
if (!model.outputType)
|
|
84
|
+
throw new TypeError("ElevenLabs models require an audio outputType");
|
|
85
|
+
const mimeType = model.outputType.split(";", 1)[0].trim().toLowerCase();
|
|
86
|
+
const format = outputFormats.get(mimeType);
|
|
87
|
+
if (!format || !acceptsMimeType([mimeType], model.outputType) || model.endpoint === "music" && format.startsWith("wav_")) {
|
|
88
|
+
throw new Error(`Unsupported ElevenLabs outputType for ${model.endpoint}: ${model.outputType}`);
|
|
89
|
+
}
|
|
90
|
+
if (model.attachmentTypes?.length)
|
|
91
|
+
throw new Error(`ElevenLabs model ${model.id} does not accept attachments`);
|
|
92
|
+
if (!model.id || byId.has(model.id))
|
|
93
|
+
throw new Error(`Duplicate or empty ElevenLabs model: ${model.id}`);
|
|
94
|
+
byId.set(model.id, { model, format });
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
name: "elevenlabs",
|
|
98
|
+
models: Object.freeze(models),
|
|
99
|
+
async *complete(request) {
|
|
100
|
+
request.signal.throwIfAborted();
|
|
101
|
+
const entry = byId.get(request.model);
|
|
102
|
+
if (!entry)
|
|
103
|
+
throw new Error(`Unknown model: ${request.model}`);
|
|
104
|
+
const { model, format } = entry;
|
|
105
|
+
if (request.attachments.length)
|
|
106
|
+
throw new Error(`Model ${model.id} does not accept ${request.attachments[0].mimeType} attachments`);
|
|
107
|
+
if (request.messages?.length || request.schema !== void 0)
|
|
108
|
+
throw new TypeError("ElevenLabs reference endpoints do not accept messages or schemas");
|
|
109
|
+
if (request.system !== void 0)
|
|
110
|
+
throw new TypeError("ElevenLabs reference endpoints do not accept system prompts");
|
|
111
|
+
const { output_format: requestedFormat, ...requestOptions } = request.options;
|
|
112
|
+
if (requestedFormat !== void 0 && requestedFormat !== format)
|
|
113
|
+
throw new TypeError("output_format conflicts with model outputType");
|
|
114
|
+
let path;
|
|
115
|
+
let body;
|
|
116
|
+
if (model.endpoint === "tts") {
|
|
117
|
+
const { voice_id: suppliedVoice, ...settings } = requestOptions;
|
|
118
|
+
const voice = suppliedVoice ?? model.defaultVoiceId;
|
|
119
|
+
if (typeof voice !== "string" || !voice.trim())
|
|
120
|
+
throw new Error(`ElevenLabs model ${model.id} requires voice_id or a configured defaultVoiceId`);
|
|
121
|
+
if (voice === "." || voice === "..")
|
|
122
|
+
throw new Error("Invalid ElevenLabs voice_id: dot segments are not allowed");
|
|
123
|
+
path = `v1/text-to-speech/${encodeURIComponent(voice)}`;
|
|
124
|
+
body = { text: request.prompt, model_id: model.id, voice_settings: parseOptions(settings, model.endpoint) };
|
|
125
|
+
} else {
|
|
126
|
+
path = "v1/music";
|
|
127
|
+
body = { ...parseOptions(requestOptions, model.endpoint), prompt: request.prompt, model_id: model.id };
|
|
128
|
+
}
|
|
129
|
+
const url = new URL(path, baseUrl);
|
|
130
|
+
url.searchParams.set("output_format", format);
|
|
131
|
+
const payload = jsonBody(body, limits.maxRequestBytes);
|
|
132
|
+
yield* streamElevenLabs(transport, {
|
|
133
|
+
url: url.href,
|
|
134
|
+
method: "POST",
|
|
135
|
+
headers: [["xi-api-key", apiKey], ...payload.headers, ["accept", model.outputType]],
|
|
136
|
+
body: payload.body,
|
|
137
|
+
signal: request.signal
|
|
138
|
+
}, limits.maxResponseBytes);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
createElevenLabsProvider
|
|
145
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decodeFrames,
|
|
3
3
|
utf8Codec
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EZ2DTOLI.js";
|
|
5
5
|
import {
|
|
6
|
-
CsvkitBlocked,
|
|
7
6
|
PythonException
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PGEYORBZ.js";
|
|
8
|
+
import {
|
|
9
|
+
CsvkitBlocked
|
|
10
|
+
} from "./chunk-WFDW4XXD.js";
|
|
9
11
|
import {
|
|
10
12
|
init_buffer
|
|
11
13
|
} from "./chunk-HX3SHTCE.js";
|
|
@@ -911,6 +911,7 @@ function createFoldEngine(options, locale, configuration = {}, signal) {
|
|
|
911
911
|
|
|
912
912
|
// packages/safe-bash-command-fold/dist/command.js
|
|
913
913
|
init_buffer();
|
|
914
|
+
import { yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
914
915
|
import { commandRuntimeIdentity, getCommandArguments } from "../../safe-bash-contracts/command.js";
|
|
915
916
|
import { FsError } from "../../safe-bash-contracts/errors.js";
|
|
916
917
|
import { readBytes, writeBytes } from "../../safe-bash-contracts/io.js";
|
|
@@ -1109,6 +1110,8 @@ async function executeFold(context, configuration, invocation) {
|
|
|
1109
1110
|
`);
|
|
1110
1111
|
};
|
|
1111
1112
|
for (const file of options.files.length ? options.files : ["-"]) {
|
|
1113
|
+
await yieldTurn(signal);
|
|
1114
|
+
signal.throwIfAborted();
|
|
1112
1115
|
signal.throwIfAborted();
|
|
1113
1116
|
let source;
|
|
1114
1117
|
let ownedInput = 0;
|
|
@@ -1191,6 +1194,7 @@ async function executeFold(context, configuration, invocation) {
|
|
|
1191
1194
|
if (!length)
|
|
1192
1195
|
await deliver(engine.push(next.value));
|
|
1193
1196
|
for (let offset = 0; offset < length; offset += 4096) {
|
|
1197
|
+
await yieldTurn(signal);
|
|
1194
1198
|
signal.throwIfAborted();
|
|
1195
1199
|
const unit = new Uint8Array(byteBuffer.call(next.value), byteOffset.call(next.value) + offset, Math.min(4096, length - offset));
|
|
1196
1200
|
const engIn = engine.inputBytes?.() ?? engine.accounting().inputBytes;
|