@poe-platform/safe-bash 0.1.797 → 0.1.798
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/dist/pdf/index.d.ts +1 -1
- package/dist/pdf/model.d.ts +7 -2
- package/dist/safe-bash/chunks/{chunk-TGOF7VO5.js → chunk-AMTCC256.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-TCWZNUVP.js → chunk-CSNXID73.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-C2NYCU7O.js → chunk-JSVX4VIA.js} +5 -1
- package/dist/safe-bash/chunks/{chunk-ZXKVOJNL.js → chunk-V3VEATEA.js} +6 -5
- package/dist/safe-bash/chunks/{chunk-D2XB7XIC.js → chunk-XH26YVGW.js} +6 -0
- package/dist/safe-bash/command-chunks/{chunk-A7RIYQIF.js → chunk-DDLQ5YDB.js} +172 -167
- package/dist/safe-bash/command-chunks/{chunk-C2DUYVYZ.js → chunk-ESMCX3YV.js} +138 -36
- package/dist/safe-bash/command-chunks/chunk-EZ7D6DXC.js +6 -0
- package/dist/safe-bash/command-chunks/{chunk-ECAK3JHR.js → chunk-QRRYN2KO.js} +21 -12
- package/dist/safe-bash/command-chunks/{chunk-UUR2S7AD.js → chunk-Y6TUZWPS.js} +28 -1
- package/dist/safe-bash/command-chunks/{pptx-KY2OJWZW-76LBHCHD.js → pptx-GBPNWNEP-7EQEVXV5.js} +8 -2
- package/dist/safe-bash/commands/llm/index.browser.js +9 -1
- package/dist/safe-bash/commands/llm/providers/index.browser.js +6 -2
- package/dist/safe-bash/core.browser.js +1 -1
- package/dist/safe-bash/core.d.ts +5 -1
- package/dist/safe-bash/core.js +5 -1
- package/dist/safe-bash/full-core.browser.js +134 -5
- package/dist/safe-bash/lazy-optional.d.ts +13 -0
- package/dist/safe-bash/lazy-optional.js +118 -0
- package/dist/safe-bash/plugins/index.browser.js +3 -3
- package/dist/safe-bash/registry-entry.browser.js +2 -2
- package/dist/safe-bash/shell/env-warning.js +3 -2
- package/dist/safe-bash/shell/runtime.js +2 -2
- package/dist/safe-bash/shell-entry.browser.js +2 -2
- package/dist/safe-bash-command-csvkit/index.js +528 -498
- 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-llm/base64-stream.d.ts +2 -0
- package/dist/safe-bash-command-llm/chat-json.d.ts +10 -0
- package/dist/safe-bash-command-llm/index.d.ts +2 -1
- package/dist/safe-bash-command-llm/index.js +11 -2
- package/dist/safe-bash-command-llm/json-string.d.ts +2 -0
- package/dist/safe-bash-command-llm/json-value.d.ts +2 -0
- package/dist/safe-bash-command-llm/openai.d.ts +1 -0
- package/dist/safe-bash-command-llm/openai.js +4 -2
- package/dist/safe-bash-command-llm/provider-serialization.d.ts +6 -0
- package/dist/safe-bash-command-llm/providers/index.d.ts +2 -1
- package/dist/safe-bash-command-llm/providers/index.js +12 -3
- package/dist/safe-bash-command-llm/providers/openai.d.ts +1 -1
- package/dist/safe-bash-command-llm/providers/openai.js +4 -2
- package/dist/safe-bash-command-pandoc/citeproc-filters.js +1 -1
- 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-ssconvert/index.js +1 -1
- package/package.json +5 -4
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
defaultPdfLimits,
|
|
4
4
|
renderPdf,
|
|
5
5
|
suppliedDefaultFont
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QRRYN2KO.js";
|
|
7
7
|
import {
|
|
8
8
|
createZipCodec
|
|
9
9
|
} from "./chunk-MKQVQMXO.js";
|
|
@@ -19,11 +19,12 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
createCiteprocFilterCapability,
|
|
21
21
|
defaultTreeAdapter,
|
|
22
|
+
encodeXML,
|
|
22
23
|
htmlReader,
|
|
23
24
|
htmlTreeDocument,
|
|
24
25
|
html_exports,
|
|
25
26
|
parseFragment
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Y6TUZWPS.js";
|
|
27
28
|
import {
|
|
28
29
|
AstError,
|
|
29
30
|
PandocError
|
|
@@ -40,7 +41,7 @@ import {
|
|
|
40
41
|
init_buffer
|
|
41
42
|
} from "./chunk-HX3SHTCE.js";
|
|
42
43
|
|
|
43
|
-
// packages/safe-bash-command-pandoc/dist/chunks/chunk-
|
|
44
|
+
// packages/safe-bash-command-pandoc/dist/chunks/chunk-BVLWOSZS.js
|
|
44
45
|
init_buffer();
|
|
45
46
|
import * as gfm_syntax_star from "../../safe-bash-markdown-engine/gfm-syntax.js";
|
|
46
47
|
import * as commonmark_blocks_star from "../../safe-bash-markdown-engine/commonmark-blocks.js";
|
|
@@ -3791,7 +3792,7 @@ async function parseStrictJson(text, context, error, number = () => {
|
|
|
3791
3792
|
continue;
|
|
3792
3793
|
}
|
|
3793
3794
|
if (cursor === text.length) error(cursor, "Incomplete JSON escape");
|
|
3794
|
-
const
|
|
3795
|
+
const escape2 = await step();
|
|
3795
3796
|
const escapes = {
|
|
3796
3797
|
'"': '"',
|
|
3797
3798
|
"\\": "\\",
|
|
@@ -3802,11 +3803,11 @@ async function parseStrictJson(text, context, error, number = () => {
|
|
|
3802
3803
|
r: "\r",
|
|
3803
3804
|
t: " "
|
|
3804
3805
|
};
|
|
3805
|
-
if (Object.hasOwn(escapes,
|
|
3806
|
-
append2(escapes[
|
|
3806
|
+
if (Object.hasOwn(escapes, escape2)) {
|
|
3807
|
+
append2(escapes[escape2]);
|
|
3807
3808
|
continue;
|
|
3808
3809
|
}
|
|
3809
|
-
if (
|
|
3810
|
+
if (escape2 !== "u") error(cursor - 1, "Invalid JSON escape");
|
|
3810
3811
|
let code = 0;
|
|
3811
3812
|
for (let i = 0; i < 4; i++) {
|
|
3812
3813
|
if (cursor === text.length) error(cursor, "Incomplete JSON Unicode escape");
|
|
@@ -9776,7 +9777,7 @@ var epubWriter = {
|
|
|
9776
9777
|
const fail3 = (message, code = "E_CAPABILITY") => {
|
|
9777
9778
|
throw new PandocError(code, ctx.operation ?? "write", message, "epub");
|
|
9778
9779
|
};
|
|
9779
|
-
const
|
|
9780
|
+
const escape2 = (value) => {
|
|
9780
9781
|
ctx.checkpoint(value.length);
|
|
9781
9782
|
let result = "";
|
|
9782
9783
|
for (const ch of value) {
|
|
@@ -9825,7 +9826,7 @@ var epubWriter = {
|
|
|
9825
9826
|
await ctx.cooperate();
|
|
9826
9827
|
const name = resource.id;
|
|
9827
9828
|
if (!name || name.startsWith("/") || name.includes(":") || name.includes("\\") || name.split("/").some((p) => !p || p === "." || p === "..")) fail3("Unsafe declared resource key", "E_RESOURCE");
|
|
9828
|
-
|
|
9829
|
+
escape2(name);
|
|
9829
9830
|
if (media.has(name)) fail3("Duplicate declared resource key", "E_RESOURCE");
|
|
9830
9831
|
const ext = name.slice(name.lastIndexOf(".") + 1).toLowerCase();
|
|
9831
9832
|
const b = resource.bytes;
|
|
@@ -9930,13 +9931,13 @@ var epubWriter = {
|
|
|
9930
9931
|
for (const resource of media.values()) if (!resource.used) fail3("Orphan declared resource", "E_RESOURCE");
|
|
9931
9932
|
const serialize = (node) => {
|
|
9932
9933
|
ctx.checkpoint();
|
|
9933
|
-
if (defaultTreeAdapter.isTextNode(node)) return
|
|
9934
|
+
if (defaultTreeAdapter.isTextNode(node)) return escape2(node.value);
|
|
9934
9935
|
if (!defaultTreeAdapter.isElementNode(node)) return "";
|
|
9935
|
-
const attrs = node.attrs.map((a) => ` ${a.name}="${
|
|
9936
|
+
const attrs = node.attrs.map((a) => ` ${a.name}="${escape2(a.value)}"`).join("");
|
|
9936
9937
|
if (["br", "hr", "img", "col"].includes(node.tagName)) return `<${node.tagName}${attrs}/>`;
|
|
9937
9938
|
return `<${node.tagName}${attrs}>${node.childNodes.map(serialize).join("")}</${node.tagName}>`;
|
|
9938
9939
|
};
|
|
9939
|
-
const xhtml = (body, name) => `<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="${
|
|
9940
|
+
const xhtml = (body, name) => `<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="${escape2(lang)}" xml:lang="${escape2(lang)}"><head><title>${escape2(name)}</title><link rel="stylesheet" type="text/css" href="style.css"/></head><body>${body}</body></html>`;
|
|
9940
9941
|
const parts = /* @__PURE__ */ new Map();
|
|
9941
9942
|
let total = 0;
|
|
9942
9943
|
const add = (name, value) => {
|
|
@@ -9954,8 +9955,8 @@ var epubWriter = {
|
|
|
9954
9955
|
add("EPUB/style.css", css);
|
|
9955
9956
|
for (const chapter of chapters) add(`EPUB/${chapter.name}`, xhtml(chapter.nodes.map(serialize).join(""), title));
|
|
9956
9957
|
for (const resource of media.values()) add(`EPUB/${resource.path}`, resource.bytes);
|
|
9957
|
-
if (cover !== void 0) add("EPUB/cover.xhtml", xhtml(`<section class="cover" epub:type="cover"><h1>${
|
|
9958
|
-
add("EPUB/nav.xhtml", xhtml(`<nav epub:type="toc" id="toc"><h1>Contents</h1><ol>${toc.map((t) => `<li class="level-${t.level}"><a href="${
|
|
9958
|
+
if (cover !== void 0) add("EPUB/cover.xhtml", xhtml(`<section class="cover" epub:type="cover"><h1>${escape2(title)}</h1><img src="${uri(media.get(cover).path)}" alt="${escape2(title)}"/></section>`, title));
|
|
9959
|
+
add("EPUB/nav.xhtml", xhtml(`<nav epub:type="toc" id="toc"><h1>Contents</h1><ol>${toc.map((t) => `<li class="level-${t.level}"><a href="${escape2(t.href)}">${escape2(t.label)}</a></li>`).join("")}</ol></nav>${cover === void 0 ? "" : '<nav epub:type="landmarks"><h2>Landmarks</h2><ol><li><a epub:type="cover" href="cover.xhtml">Cover</a></li></ol></nav>'}`, "Contents"));
|
|
9959
9960
|
const digestInput = [];
|
|
9960
9961
|
let digestSize = 0;
|
|
9961
9962
|
for (const [name, bytes] of parts) {
|
|
@@ -9977,8 +9978,8 @@ var epubWriter = {
|
|
|
9977
9978
|
const digest = new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256", input));
|
|
9978
9979
|
ctx.checkpoint();
|
|
9979
9980
|
const identifier2 = explicitIdentifier ?? `urn:sha256:${[...digest].map((n) => n.toString(16).padStart(2, "0")).join("")}`;
|
|
9980
|
-
const items = [`<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>`, '<item id="css" href="style.css" media-type="text/css"/>', ...chapters.map((c, i) => `<item id="chapter-${i + 1}" href="${c.name}" media-type="application/xhtml+xml"/>`), ...[...media.entries()].map(([key, r], i) => `<item id="resource-${i + 1}" href="${
|
|
9981
|
-
add("EPUB/package.opf", `<?xml version="1.0" encoding="UTF-8"?><package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="publication-id"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier id="publication-id">${
|
|
9981
|
+
const items = [`<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>`, '<item id="css" href="style.css" media-type="text/css"/>', ...chapters.map((c, i) => `<item id="chapter-${i + 1}" href="${c.name}" media-type="application/xhtml+xml"/>`), ...[...media.entries()].map(([key, r], i) => `<item id="resource-${i + 1}" href="${escape2(uri(r.path))}" media-type="${r.type}"${key === cover ? ' properties="cover-image"' : ""}/>`), ...cover === void 0 ? [] : ['<item id="cover" href="cover.xhtml" media-type="application/xhtml+xml"/>']];
|
|
9982
|
+
add("EPUB/package.opf", `<?xml version="1.0" encoding="UTF-8"?><package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="publication-id"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier id="publication-id">${escape2(identifier2)}</dc:identifier><dc:title>${escape2(title)}</dc:title><dc:language>${escape2(lang)}</dc:language><meta property="dcterms:modified">${modified}</meta></metadata><manifest>${items.join("")}</manifest><spine>${cover === void 0 ? "" : '<itemref idref="cover"/>'}${chapters.map((_, i) => `<itemref idref="chapter-${i + 1}"/>`).join("")}</spine></package>`);
|
|
9982
9983
|
const signal = ctx.signal ?? new AbortController().signal;
|
|
9983
9984
|
const limits = { maxArchiveBytes: ctx.limits.outputBytes, maxEntryBytes: ctx.limits.expandedBytes, maxTotalBytes: ctx.limits.expandedBytes, maxMembers: ctx.limits.parts, maxPathBytes: ctx.limits.text, maxDepth: ctx.limits.depth, maxPaxBytes: ctx.limits.binaryBytes, maxTextBytes: ctx.limits.text, chunkSize: 4096 };
|
|
9984
9985
|
const zip = createZipCodec({ compression: createCompressionCodec(), yieldTurn: async () => ctx.cooperate(), fail: (message) => fail3(message, message.includes("limit") ? "E_LIMIT" : "E_CAPABILITY") }, { rejectDuplicateNames: true, validatePayloads: true });
|
|
@@ -10019,6 +10020,7 @@ var pdfWriter = {
|
|
|
10019
10020
|
throw new PandocError("E_CAPABILITY", ctx.operation ?? "write", message, "pdf");
|
|
10020
10021
|
};
|
|
10021
10022
|
if (document.direction === "rtl" || document.direction === "auto") fail3("PDF profile requires explicit LTR text");
|
|
10023
|
+
const styledFonts = /* @__PURE__ */ new Map();
|
|
10022
10024
|
const notes = [];
|
|
10023
10025
|
const runs = async (nodes, size = ctx.pdf?.fontSize ?? 12, link, style = {}) => {
|
|
10024
10026
|
const result = [];
|
|
@@ -10027,8 +10029,15 @@ var pdfWriter = {
|
|
|
10027
10029
|
ctx.charge("references", 1);
|
|
10028
10030
|
if (node.t === "Str" || node.t === "Space" || node.t === "SoftBreak" || node.t === "LineBreak" || node.t === "Code") {
|
|
10029
10031
|
const text = node.t === "Str" ? node.c : node.t === "Code" ? node.c[1] : node.t === "LineBreak" ? "\n" : " ";
|
|
10032
|
+
let font;
|
|
10033
|
+
if (!ctx.pdfFonts && (style.bold || style.italic || node.t === "Code")) {
|
|
10034
|
+
const family = node.t === "Code" ? "Courier" : "Helvetica";
|
|
10035
|
+
const name = family + (style.bold && style.italic ? "-BoldOblique" : style.bold ? "-Bold" : style.italic ? "-Oblique" : "");
|
|
10036
|
+
font = `standard:${name}`;
|
|
10037
|
+
styledFonts.set(name, { id: font, standard: name });
|
|
10038
|
+
}
|
|
10030
10039
|
ctx.charge("retainedBytes", text.length * 2 + 64);
|
|
10031
|
-
result.push({ text, size, ...style, ...link === void 0 ? {} : { link } });
|
|
10040
|
+
result.push({ text, size, ...style, ...font === void 0 ? {} : { font }, ...link === void 0 ? {} : { link } });
|
|
10032
10041
|
} else if (node.t === "Link") result.push(...await runs(node.c[1], size, node.c[2][0], style));
|
|
10033
10042
|
else if (node.t === "Span") result.push(...await runs(node.c[1], size, link, style));
|
|
10034
10043
|
else if (node.t === "Math") {
|
|
@@ -10158,11 +10167,11 @@ var pdfWriter = {
|
|
|
10158
10167
|
}
|
|
10159
10168
|
}
|
|
10160
10169
|
const budgetMap = { fontBytes: "binaryBytes", fonts: "fonts", glyphs: "glyphs", pages: "pages", objects: "objects", images: "images", imageBytes: "binaryBytes", decodedImageBytes: "retainedBytes", layoutWork: "layoutWork" };
|
|
10161
|
-
ctx.bound("fonts", ctx.pdfFonts?.length ?? 1);
|
|
10162
|
-
const fonts = ctx.pdfFonts ?? [suppliedDefaultFont((size) => {
|
|
10170
|
+
ctx.bound("fonts", (ctx.pdfFonts?.length ?? 1) + styledFonts.size);
|
|
10171
|
+
const fonts = [...ctx.pdfFonts ?? [suppliedDefaultFont((size) => {
|
|
10163
10172
|
ctx.bound("binaryBytes", size);
|
|
10164
10173
|
ctx.charge("retainedBytes", size * 2);
|
|
10165
|
-
})];
|
|
10174
|
+
})], ...styledFonts.values()];
|
|
10166
10175
|
try {
|
|
10167
10176
|
const bytes = await renderPdf({ blocks: blocks3, fonts, metadata: metadata2, ...ctx.pdf?.lineHeight === void 0 ? {} : { lineHeight: ctx.pdf.lineHeight }, ...ctx.pdfPage === void 0 ? {} : { page: ctx.pdfPage } }, { signal: ctx.signal, yield: () => ctx.cooperate(256), limits: { outputBytes: ctx.limits.outputBytes }, charge: (key, amount) => {
|
|
10168
10177
|
const mapped = budgetMap[key];
|
|
@@ -10407,6 +10416,19 @@ var pdf_default = {
|
|
|
10407
10416
|
write: ["standalone", "pdfPage", "pdfFonts", "pdf"]
|
|
10408
10417
|
}
|
|
10409
10418
|
};
|
|
10419
|
+
var EntityLevel;
|
|
10420
|
+
(function(EntityLevel2) {
|
|
10421
|
+
EntityLevel2[EntityLevel2["XML"] = 0] = "XML";
|
|
10422
|
+
EntityLevel2[EntityLevel2["HTML"] = 1] = "HTML";
|
|
10423
|
+
})(EntityLevel || (EntityLevel = {}));
|
|
10424
|
+
var EncodingMode;
|
|
10425
|
+
(function(EncodingMode2) {
|
|
10426
|
+
EncodingMode2[EncodingMode2["UTF8"] = 0] = "UTF8";
|
|
10427
|
+
EncodingMode2[EncodingMode2["ASCII"] = 1] = "ASCII";
|
|
10428
|
+
EncodingMode2[EncodingMode2["Extensive"] = 2] = "Extensive";
|
|
10429
|
+
EncodingMode2[EncodingMode2["Attribute"] = 3] = "Attribute";
|
|
10430
|
+
EncodingMode2[EncodingMode2["Text"] = 4] = "Text";
|
|
10431
|
+
})(EncodingMode || (EncodingMode = {}));
|
|
10410
10432
|
var attr2 = ["", [], []];
|
|
10411
10433
|
async function modelContext(ctx) {
|
|
10412
10434
|
const { DocumentBudget } = await import("./src-UJOWAS2S.js");
|
|
@@ -10479,13 +10501,18 @@ var docxReader = { format: "docx", async read(input, ctx) {
|
|
|
10479
10501
|
var docxWriter = { format: "docx", async write(document, ctx) {
|
|
10480
10502
|
return guarded(ctx, async () => {
|
|
10481
10503
|
const blocks3 = [];
|
|
10482
|
-
const
|
|
10504
|
+
const paragraphs = [];
|
|
10505
|
+
const numbering2 = [];
|
|
10506
|
+
const w = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
|
10507
|
+
const r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
10508
|
+
const runs = (nodes, bold = false, italic = false, link) => {
|
|
10483
10509
|
const result = [];
|
|
10484
10510
|
for (const node of nodes) {
|
|
10485
10511
|
ctx.checkpoint();
|
|
10486
|
-
if (node.t === "Strong") result.push(...runs(node.c, true, italic));
|
|
10487
|
-
else if (node.t === "Emph") result.push(...runs(node.c, bold, true));
|
|
10488
|
-
else if (node.t === "Span") result.push(...runs(node.c[1], bold, italic));
|
|
10512
|
+
if (node.t === "Strong") result.push(...runs(node.c, true, italic, link));
|
|
10513
|
+
else if (node.t === "Emph") result.push(...runs(node.c, bold, true, link));
|
|
10514
|
+
else if (node.t === "Span") result.push(...runs(node.c[1], bold, italic, link));
|
|
10515
|
+
else if (node.t === "Link") result.push(...runs(node.c[1], bold, italic, node.c[2][0]));
|
|
10489
10516
|
else {
|
|
10490
10517
|
let text;
|
|
10491
10518
|
if (node.t === "Str") text = node.c;
|
|
@@ -10493,25 +10520,100 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10493
10520
|
else if (node.t === "LineBreak") text = "\n";
|
|
10494
10521
|
else if (node.t === "Code") text = node.c[1];
|
|
10495
10522
|
else throw new PandocError("E_UNSUPPORTED_FEATURE", "write", `Unsupported DOCX inline: ${node.t}`, "docx");
|
|
10496
|
-
result.push({ text, bold, italic });
|
|
10523
|
+
result.push({ text, bold, italic, ...link === void 0 ? {} : { link } });
|
|
10497
10524
|
}
|
|
10498
10525
|
}
|
|
10499
10526
|
return result;
|
|
10500
10527
|
};
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10528
|
+
const paragraph = (target, content, properties, level) => {
|
|
10529
|
+
paragraphs.push({ runs: content, properties });
|
|
10530
|
+
target.push({ kind: "paragraph", ...level === void 0 ? {} : { level }, runs: content.map(({ link: _link, ...run }) => run) });
|
|
10531
|
+
};
|
|
10532
|
+
const visit5 = async (nodes, target, indent3 = 0, list2) => {
|
|
10533
|
+
for (const block2 of nodes) {
|
|
10534
|
+
await ctx.cooperate();
|
|
10535
|
+
const properties = (list2?.pending ? `<w:numPr><w:ilvl w:val="${list2.level}"/><w:numId w:val="${list2.id}"/></w:numPr>` : "") + (indent3 ? `<w:ind w:left="${indent3}"/>` : "");
|
|
10536
|
+
if (block2.t === "Header") {
|
|
10537
|
+
paragraph(target, runs(block2.c[2]), properties, block2.c[0]);
|
|
10538
|
+
if (list2) list2.pending = false;
|
|
10539
|
+
} else if (block2.t === "Para" || block2.t === "Plain") {
|
|
10540
|
+
paragraph(target, runs(block2.c), properties);
|
|
10541
|
+
if (list2) list2.pending = false;
|
|
10542
|
+
} else if (block2.t === "CodeBlock") {
|
|
10543
|
+
paragraph(target, [{ text: block2.c[1] }], properties);
|
|
10544
|
+
if (list2) list2.pending = false;
|
|
10545
|
+
} else if (block2.t === "Div") await visit5(block2.c[1], target, indent3, list2);
|
|
10546
|
+
else if (block2.t === "BlockQuote") await visit5(block2.c, target, indent3 + 720, list2);
|
|
10547
|
+
else if (block2.t === "HorizontalRule") paragraph(target, [], `<w:pBdr><w:bottom w:val="single" w:sz="6" w:space="1" w:color="auto"/></w:pBdr>`);
|
|
10548
|
+
else if (block2.t === "BulletList" || block2.t === "OrderedList") {
|
|
10549
|
+
const level = list2 ? list2.level + 1 : 0;
|
|
10550
|
+
if (level > 8) throw new PandocError("E_UNSUPPORTED_FEATURE", "write", "DOCX lists support at most nine levels", "docx");
|
|
10551
|
+
const id = numbering2.length + 1;
|
|
10552
|
+
const styles = { DefaultStyle: "decimal", Decimal: "decimal", LowerAlpha: "lowerLetter", UpperAlpha: "upperLetter", LowerRoman: "lowerRoman", UpperRoman: "upperRoman" };
|
|
10553
|
+
const format2 = block2.t === "BulletList" ? "bullet" : styles[block2.c[0][1]];
|
|
10554
|
+
if (!format2) throw new PandocError("E_UNSUPPORTED_FEATURE", "write", "Unsupported DOCX list style", "docx");
|
|
10555
|
+
const marker = block2.t === "BulletList" ? "\u2022" : block2.c[0][2] === "TwoParens" ? `(%${level + 1})` : block2.c[0][2] === "OneParen" ? `%${level + 1})` : `%${level + 1}.`;
|
|
10556
|
+
numbering2.push(`<w:abstractNum w:abstractNumId="${id}"><w:multiLevelType w:val="multilevel"/><w:lvl w:ilvl="${level}"><w:start w:val="${block2.t === "BulletList" ? 1 : block2.c[0][0]}"/><w:numFmt w:val="${format2}"/><w:lvlText w:val="${marker}"/><w:pPr><w:ind w:left="${720 * (level + 1)}" w:hanging="360"/></w:pPr></w:lvl></w:abstractNum>`);
|
|
10557
|
+
for (const item of block2.t === "BulletList" ? block2.c : block2.c[1]) await visit5(item, target, indent3, { id, level, pending: true });
|
|
10558
|
+
} else if (block2.t === "Table") {
|
|
10559
|
+
if (block2.c[1][1].length) await visit5(block2.c[1][1], target, indent3);
|
|
10560
|
+
else if (block2.c[1][0]?.length) paragraph(target, runs(block2.c[1][0]), "");
|
|
10561
|
+
const rows = [];
|
|
10562
|
+
for (const row2 of [...block2.c[3][1], ...block2.c[4].flatMap((body) => [...body[2], ...body[3]]), ...block2.c[5][1]]) {
|
|
10563
|
+
const cells = [];
|
|
10564
|
+
for (const cell2 of row2[1]) {
|
|
10565
|
+
if (cell2[2] !== 1 || cell2[3] !== 1) throw new PandocError("E_UNSUPPORTED_FEATURE", "write", "DOCX table spans are unsupported", "docx");
|
|
10566
|
+
const children2 = [];
|
|
10567
|
+
await visit5(cell2[4], children2);
|
|
10568
|
+
if (!children2.length || children2.at(-1)?.kind !== "paragraph") paragraph(children2, [], "");
|
|
10569
|
+
cells.push({ blocks: children2 });
|
|
10570
|
+
}
|
|
10571
|
+
rows.push(cells);
|
|
10572
|
+
}
|
|
10573
|
+
target.push({ kind: "table", rows, headerRows: block2.c[3][1].length });
|
|
10574
|
+
} else throw new PandocError("E_UNSUPPORTED_FEATURE", "write", `Unsupported DOCX block: ${block2.t}`, "docx");
|
|
10575
|
+
}
|
|
10576
|
+
};
|
|
10577
|
+
await visit5(document.blocks, blocks3);
|
|
10578
|
+
const { createDocumentArchive, writeDocumentArchive, DocumentXmlEditor } = await import("./src-UJOWAS2S.js");
|
|
10509
10579
|
const mc = await modelContext(ctx);
|
|
10510
10580
|
const archiveContext = { signal: mc.signal, budget: mc.budget };
|
|
10511
10581
|
const archive = await createDocumentArchive({ content: { version: 1, blocks: blocks3 } }, archiveContext);
|
|
10582
|
+
const main = new DocumentXmlEditor(archive.members.find((member) => member.name === "word/document.xml").bytes, {}, void 0, mc.budget);
|
|
10583
|
+
const relationships = new DocumentXmlEditor(archive.members.find((member) => member.name === "word/_rels/document.xml.rels").bytes, {}, void 0, mc.budget);
|
|
10584
|
+
let paragraphIndex = 0, relationshipId = 2;
|
|
10585
|
+
const linkRelationships = [];
|
|
10586
|
+
const edit = async (node) => {
|
|
10587
|
+
await ctx.cooperate();
|
|
10588
|
+
if (node.namespace === w && node.localName === "p") {
|
|
10589
|
+
const extra = paragraphs[paragraphIndex++];
|
|
10590
|
+
if (!extra) return;
|
|
10591
|
+
const replacements = /* @__PURE__ */ new Map();
|
|
10592
|
+
const properties = node.children.find((child) => child.localName === "pPr");
|
|
10593
|
+
if (properties && extra.properties) replacements.set(properties, `<w:pPr>${main.sourceXml(properties, /* @__PURE__ */ new Map(), true)}${extra.properties}</w:pPr>`);
|
|
10594
|
+
const nativeRuns = node.children.filter((child) => child.localName === "r");
|
|
10595
|
+
for (const [index, run] of extra.runs.entries()) if (run.link !== void 0) {
|
|
10596
|
+
ctx.checkpoint();
|
|
10597
|
+
const native = nativeRuns[index];
|
|
10598
|
+
const anchor = run.link.startsWith("#");
|
|
10599
|
+
const id = `rId${relationshipId++}`;
|
|
10600
|
+
if (!anchor) linkRelationships.push(`<Relationship Id="${id}" Type="${r}/hyperlink" Target="${encodeXML(run.link)}" TargetMode="External"/>`);
|
|
10601
|
+
replacements.set(native, `<w:hyperlink ${anchor ? `w:anchor="${encodeXML(run.link.slice(1))}"` : `xmlns:r="${r}" r:id="${id}"`}>${main.sourceXml(native)}</w:hyperlink>`);
|
|
10602
|
+
}
|
|
10603
|
+
if (extra.properties || replacements.size) main.replaceElement(node, `<w:p xmlns:w="${w}">${!properties && extra.properties ? `<w:pPr>${extra.properties}</w:pPr>` : ""}${main.sourceXml(node, replacements, true)}</w:p>`);
|
|
10604
|
+
} else for (const child of node.children) await edit(child);
|
|
10605
|
+
};
|
|
10606
|
+
await edit(main.root);
|
|
10607
|
+
if (numbering2.length) linkRelationships.push(`<Relationship Id="rId${relationshipId++}" Type="${r}/numbering" Target="numbering.xml"/>`);
|
|
10608
|
+
if (linkRelationships.length) relationships.insertChildren(relationships.root, linkRelationships.map((xml) => xml.replace("<Relationship ", '<Relationship xmlns="http://schemas.openxmlformats.org/package/2006/relationships" ')).join(""));
|
|
10609
|
+
const types = new DocumentXmlEditor(archive.members.find((member) => member.name === "[Content_Types].xml").bytes, {}, void 0, mc.budget);
|
|
10610
|
+
if (numbering2.length) types.insertChildren(types.root, '<Override xmlns="http://schemas.openxmlformats.org/package/2006/content-types" PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>');
|
|
10611
|
+
const parts = /* @__PURE__ */ new Map([["word/document.xml", main.serialize()], ["word/_rels/document.xml.rels", relationships.serialize()], ["[Content_Types].xml", types.serialize()]]);
|
|
10612
|
+
const members = archive.members.map((member) => ({ ...member, bytes: parts.get(member.name) ?? member.bytes }));
|
|
10613
|
+
if (numbering2.length) members.push({ name: "word/numbering.xml", bytes: new TextEncoder().encode(`<w:numbering xmlns:w="${w}">${numbering2.join("")}${numbering2.map((_, i) => `<w:num w:numId="${i + 1}"><w:abstractNumId w:val="${i + 1}"/></w:num>`).join("")}</w:numbering>`), directory: false, modified: /* @__PURE__ */ new Date(0) });
|
|
10512
10614
|
const chunks = [];
|
|
10513
10615
|
let size = 0;
|
|
10514
|
-
await writeDocumentArchive(archive, { async write(bytes2) {
|
|
10616
|
+
await writeDocumentArchive({ members, comment: archive.comment }, { async write(bytes2) {
|
|
10515
10617
|
size += bytes2.length;
|
|
10516
10618
|
ctx.bound("outputBytes", size);
|
|
10517
10619
|
ctx.charge("retainedBytes", bytes2.length);
|
|
@@ -10551,7 +10653,7 @@ var pptx_default = {
|
|
|
10551
10653
|
format: "pptx",
|
|
10552
10654
|
async read(input, context, selection) {
|
|
10553
10655
|
context.signal?.throwIfAborted();
|
|
10554
|
-
const { pptxReader } = await import("./pptx-
|
|
10656
|
+
const { pptxReader } = await import("./pptx-GBPNWNEP-7EQEVXV5.js");
|
|
10555
10657
|
context.signal?.throwIfAborted();
|
|
10556
10658
|
return pptxReader.read(input, context, selection);
|
|
10557
10659
|
}
|
|
@@ -10560,7 +10662,7 @@ var pptx_default = {
|
|
|
10560
10662
|
format: "pptx",
|
|
10561
10663
|
async write(document, context, selection) {
|
|
10562
10664
|
context.signal?.throwIfAborted();
|
|
10563
|
-
const { pptxWriter } = await import("./pptx-
|
|
10665
|
+
const { pptxWriter } = await import("./pptx-GBPNWNEP-7EQEVXV5.js");
|
|
10564
10666
|
context.signal?.throwIfAborted();
|
|
10565
10667
|
return pptxWriter.write(document, context, selection);
|
|
10566
10668
|
}
|
|
@@ -2453,7 +2453,7 @@ function suppliedDefaultFont(admit) {
|
|
|
2453
2453
|
|
|
2454
2454
|
// packages/pdf/src/index.ts
|
|
2455
2455
|
init_buffer();
|
|
2456
|
-
import { PDFDocument, rgb, PDFName, PDFHexString as PDFHexString2, pushGraphicsState, popGraphicsState, concatTransformationMatrix, drawObject, beginText, endText, setFontAndSize, setTextMatrix, showText, setFillingRgbColor } from "pdf-lib";
|
|
2456
|
+
import { PDFDocument, StandardFonts, rgb, PDFName, PDFHexString as PDFHexString2, pushGraphicsState, popGraphicsState, concatTransformationMatrix, drawObject, beginText, endText, setFontAndSize, setTextMatrix, showText, setFillingRgbColor } from "pdf-lib";
|
|
2457
2457
|
import fontkit from "@pdf-lib/fontkit";
|
|
2458
2458
|
import { setTextRenderingMode, TextRenderingMode, setLineWidth, setStrokingRgbColor } from "pdf-lib";
|
|
2459
2459
|
|
|
@@ -2918,9 +2918,13 @@ async function renderPdf(document, context = {}) {
|
|
|
2918
2918
|
if (!font.id || ids.has(font.id)) unsupported("Duplicate/empty font identity");
|
|
2919
2919
|
ids.add(font.id);
|
|
2920
2920
|
charge("fonts", 1);
|
|
2921
|
-
charge("fontBytes", font.bytes.length);
|
|
2922
2921
|
charge("objects", 8);
|
|
2923
|
-
|
|
2922
|
+
if ("standard" in font) {
|
|
2923
|
+
if (!Object.values(StandardFonts).includes(font.standard)) unsupported("Unknown standard font");
|
|
2924
|
+
} else {
|
|
2925
|
+
charge("fontBytes", font.bytes.length);
|
|
2926
|
+
admitTrueTypeFont(font.bytes, unsupported, (amount) => charge("layoutWork", amount));
|
|
2927
|
+
}
|
|
2924
2928
|
}
|
|
2925
2929
|
const pdf = await PDFDocument.create({ updateMetadata: false });
|
|
2926
2930
|
pdf.registerFontkit(fontkit);
|
|
@@ -2944,6 +2948,11 @@ async function renderPdf(document, context = {}) {
|
|
|
2944
2948
|
const parsedFonts = /* @__PURE__ */ new Map();
|
|
2945
2949
|
try {
|
|
2946
2950
|
for (const resource of document.fonts) {
|
|
2951
|
+
if ("standard" in resource) {
|
|
2952
|
+
fonts.set(resource.id, await pdf.embedFont(resource.standard));
|
|
2953
|
+
await cooperate();
|
|
2954
|
+
continue;
|
|
2955
|
+
}
|
|
2947
2956
|
const bytes2 = new Uint8Array(resource.bytes);
|
|
2948
2957
|
const parsed = fontkit.create(bytes2);
|
|
2949
2958
|
if (!positive(parsed.unitsPerEm) || !Number.isInteger(parsed.numGlyphs) || parsed.numGlyphs < 1 || parsed.numGlyphs > 65535) unsupported("Invalid font metrics");
|
|
@@ -2966,11 +2975,12 @@ async function renderPdf(document, context = {}) {
|
|
|
2966
2975
|
if (!(cp >= 32 && cp <= 126 || cp >= 160 && cp <= 255 || cp >= 880 && cp <= 1327) || cp >= 1155 && cp <= 1161) unsupported("Unsupported script or combining sequence");
|
|
2967
2976
|
const candidates = run.font === void 0 ? [...fonts.values()] : [fonts.get(run.font), ...fonts.values()];
|
|
2968
2977
|
if (run.font !== void 0 && !fonts.has(run.font)) unsupported("Unknown font identity");
|
|
2969
|
-
const font = candidates.find((candidate) => candidate && coverage.get(candidate).has(cp) && parsedFonts.get(candidate).glyphForCodePoint(cp).id > 0);
|
|
2978
|
+
const font = candidates.find((candidate) => candidate && coverage.get(candidate).has(cp) && (!parsedFonts.has(candidate) || parsedFonts.get(candidate).glyphForCodePoint(cp).id > 0));
|
|
2970
2979
|
if (!font) unsupported(`No supplied font covers U+${cp.toString(16)}`);
|
|
2971
|
-
const
|
|
2972
|
-
|
|
2973
|
-
|
|
2980
|
+
const parsed = parsedFonts.get(font);
|
|
2981
|
+
const parsedGlyph = parsed?.glyphForCodePoint(cp);
|
|
2982
|
+
if (parsedGlyph && (!Number.isInteger(parsedGlyph.id) || parsedGlyph.id <= 0 || parsedGlyph.id >= parsed.numGlyphs)) unsupported("Font character map points outside glyph records");
|
|
2983
|
+
const encoded2 = parsedGlyph ? parsedGlyph.id.toString(16).padStart(4, "0").toUpperCase() : font.encodeText(text).asString();
|
|
2974
2984
|
let scalars = emittedScalars.get(font);
|
|
2975
2985
|
if (!scalars) {
|
|
2976
2986
|
scalars = /* @__PURE__ */ new Map();
|
|
@@ -2990,13 +3000,12 @@ async function renderPdf(document, context = {}) {
|
|
|
2990
3000
|
}
|
|
2991
3001
|
if (!["https:", "http:", "mailto:"].includes(url.protocol)) unsupported("Unsafe link scheme");
|
|
2992
3002
|
}
|
|
2993
|
-
const width = parsedGlyph.advanceWidth /
|
|
3003
|
+
const width = parsedGlyph ? parsedGlyph.advanceWidth / parsed.unitsPerEm * size : font.widthOfTextAtSize(text, size);
|
|
2994
3004
|
if (!positive(width)) unsupported(`Nonadvancing glyph U+${cp.toString(16)}`);
|
|
2995
|
-
const
|
|
2996
|
-
const
|
|
2997
|
-
const descent = -parsed.descent / parsed.unitsPerEm * size;
|
|
3005
|
+
const ascent = parsed ? parsed.ascent / parsed.unitsPerEm * size : font.heightAtSize(size, { descender: false });
|
|
3006
|
+
const descent = parsed ? -parsed.descent / parsed.unitsPerEm * size : font.heightAtSize(size) - ascent;
|
|
2998
3007
|
if (!positive(ascent) || !Number.isFinite(descent) || descent < 0) unsupported("Invalid vertical font metrics");
|
|
2999
|
-
return { text, code: encoded2, font, size, width, ascent, descent, bold: run.bold ?? false, italic: run.italic ?? false, strikeout: run.strikeout ?? false, underline: run.underline ?? false, ...run.link === void 0 ? {} : { link: run.link } };
|
|
3008
|
+
return { text, code: encoded2, font, size, width, ascent, descent, bold: parsed ? run.bold ?? false : false, italic: parsed ? run.italic ?? false : false, strikeout: run.strikeout ?? false, underline: run.underline ?? false, ...run.link === void 0 ? {} : { link: run.link } };
|
|
3000
3009
|
};
|
|
3001
3010
|
const lines = async (block, width) => {
|
|
3002
3011
|
charge("layoutWork", 1);
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
init_buffer
|
|
14
14
|
} from "./chunk-HX3SHTCE.js";
|
|
15
15
|
|
|
16
|
-
// packages/safe-bash-command-pandoc/dist/chunks/chunk-
|
|
16
|
+
// packages/safe-bash-command-pandoc/dist/chunks/chunk-XVEXYI23.js
|
|
17
17
|
init_buffer();
|
|
18
18
|
var require_citeproc_commonjs = __commonJS({
|
|
19
19
|
"../../node_modules/citeproc/citeproc_commonjs.js"(exports, module) {
|
|
@@ -26781,6 +26781,14 @@ function endTagInForeignContent(p, token) {
|
|
|
26781
26781
|
}
|
|
26782
26782
|
}
|
|
26783
26783
|
}
|
|
26784
|
+
var xmlReplacer = /["$&'<>\u0080-\uFFFF]/g;
|
|
26785
|
+
var xmlCodeMap = /* @__PURE__ */ new Map([
|
|
26786
|
+
[34, """],
|
|
26787
|
+
[38, "&"],
|
|
26788
|
+
[39, "'"],
|
|
26789
|
+
[60, "<"],
|
|
26790
|
+
[62, ">"]
|
|
26791
|
+
]);
|
|
26784
26792
|
var getCodePoint = (
|
|
26785
26793
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
26786
26794
|
String.prototype.codePointAt == null ? (c, index) => (c.charCodeAt(index) & 64512) === 55296 ? (c.charCodeAt(index) - 55296) * 1024 + c.charCodeAt(index + 1) - 56320 + 65536 : c.charCodeAt(index) : (
|
|
@@ -26788,6 +26796,24 @@ var getCodePoint = (
|
|
|
26788
26796
|
((input, index) => input.codePointAt(index))
|
|
26789
26797
|
)
|
|
26790
26798
|
);
|
|
26799
|
+
function encodeXML(input) {
|
|
26800
|
+
let returnValue = "";
|
|
26801
|
+
let lastIndex = 0;
|
|
26802
|
+
let match;
|
|
26803
|
+
while ((match = xmlReplacer.exec(input)) !== null) {
|
|
26804
|
+
const { index } = match;
|
|
26805
|
+
const char = input.charCodeAt(index);
|
|
26806
|
+
const next = xmlCodeMap.get(char);
|
|
26807
|
+
if (next === void 0) {
|
|
26808
|
+
returnValue += `${input.substring(lastIndex, index)}&#x${getCodePoint(input, index).toString(16)};`;
|
|
26809
|
+
lastIndex = xmlReplacer.lastIndex += Number((char & 64512) === 55296);
|
|
26810
|
+
} else {
|
|
26811
|
+
returnValue += input.substring(lastIndex, index) + next;
|
|
26812
|
+
lastIndex = index + 1;
|
|
26813
|
+
}
|
|
26814
|
+
}
|
|
26815
|
+
return returnValue + input.substr(lastIndex);
|
|
26816
|
+
}
|
|
26791
26817
|
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
26792
26818
|
TAG_NAMES.AREA,
|
|
26793
26819
|
TAG_NAMES.BASE,
|
|
@@ -27400,6 +27426,7 @@ function createCiteprocFilterCapability(options = {}) {
|
|
|
27400
27426
|
export {
|
|
27401
27427
|
html_exports,
|
|
27402
27428
|
defaultTreeAdapter,
|
|
27429
|
+
encodeXML,
|
|
27403
27430
|
parseFragment,
|
|
27404
27431
|
htmlReader,
|
|
27405
27432
|
htmlTreeDocument,
|
package/dist/safe-bash/command-chunks/{pptx-KY2OJWZW-76LBHCHD.js → pptx-GBPNWNEP-7EQEVXV5.js}
RENAMED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
init_buffer
|
|
15
15
|
} from "./chunk-HX3SHTCE.js";
|
|
16
16
|
|
|
17
|
-
// packages/safe-bash-command-pandoc/dist/chunks/pptx-
|
|
17
|
+
// packages/safe-bash-command-pandoc/dist/chunks/pptx-GBPNWNEP.js
|
|
18
18
|
init_buffer();
|
|
19
19
|
|
|
20
20
|
// packages/pptx/src/index.ts
|
|
@@ -30126,7 +30126,7 @@ var declaredOperations = {
|
|
|
30126
30126
|
// packages/pptx/src/chart-objects.ts
|
|
30127
30127
|
init_buffer();
|
|
30128
30128
|
|
|
30129
|
-
// packages/safe-bash-command-pandoc/dist/chunks/pptx-
|
|
30129
|
+
// packages/safe-bash-command-pandoc/dist/chunks/pptx-GBPNWNEP.js
|
|
30130
30130
|
var attr8 = ["", [], []];
|
|
30131
30131
|
function engineContext(context) {
|
|
30132
30132
|
const l = context.limits;
|
|
@@ -30390,6 +30390,12 @@ var pptxWriter = {
|
|
|
30390
30390
|
case "Header":
|
|
30391
30391
|
paragraph(block.c[2], level);
|
|
30392
30392
|
break;
|
|
30393
|
+
case "BlockQuote": {
|
|
30394
|
+
const before = y;
|
|
30395
|
+
await blocks(block.c, level + 1, firstParagraph ? bullet : void 0);
|
|
30396
|
+
if (y !== before) firstParagraph = false;
|
|
30397
|
+
break;
|
|
30398
|
+
}
|
|
30393
30399
|
case "BulletList":
|
|
30394
30400
|
for (const item2 of block.c) await blocks(item2, bullet ? level + 1 : level, { kind: "character", character: "\u2022" });
|
|
30395
30401
|
break;
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
createLlmService,
|
|
7
7
|
createLlmTemplateStore,
|
|
8
8
|
createOpenAiProvider,
|
|
9
|
+
encodeLlmBase64,
|
|
9
10
|
evaluateLlmTemplate,
|
|
10
11
|
findExtractedRange,
|
|
11
12
|
getLlmModelAliases,
|
|
@@ -14,10 +15,13 @@ import {
|
|
|
14
15
|
parseLlmSchemaDsl,
|
|
15
16
|
resolveLlmSchemaInput,
|
|
16
17
|
selectLlmModelByQuery,
|
|
18
|
+
serializeLlmJsonString,
|
|
19
|
+
serializeLlmJsonValue,
|
|
20
|
+
serializeOpenAiChatRequest,
|
|
17
21
|
templateYaml,
|
|
18
22
|
validateLlmTemplateParameters,
|
|
19
23
|
validateModelOptions
|
|
20
|
-
} from "../../chunks/chunk-
|
|
24
|
+
} from "../../chunks/chunk-JSVX4VIA.js";
|
|
21
25
|
import "../../chunks/chunk-YG5WAHK7.js";
|
|
22
26
|
export {
|
|
23
27
|
createElevenLabsProvider,
|
|
@@ -27,6 +31,7 @@ export {
|
|
|
27
31
|
createLlmService,
|
|
28
32
|
createLlmTemplateStore,
|
|
29
33
|
createOpenAiProvider,
|
|
34
|
+
encodeLlmBase64,
|
|
30
35
|
evaluateLlmTemplate,
|
|
31
36
|
findExtractedRange,
|
|
32
37
|
getLlmModelAliases,
|
|
@@ -35,6 +40,9 @@ export {
|
|
|
35
40
|
parseLlmSchemaDsl,
|
|
36
41
|
resolveLlmSchemaInput,
|
|
37
42
|
selectLlmModelByQuery,
|
|
43
|
+
serializeLlmJsonString,
|
|
44
|
+
serializeLlmJsonValue,
|
|
45
|
+
serializeOpenAiChatRequest,
|
|
38
46
|
templateYaml,
|
|
39
47
|
validateLlmTemplateParameters,
|
|
40
48
|
validateModelOptions
|
|
@@ -4,8 +4,12 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash/src/commands/llm/providers/index.ts
|
|
6
6
|
init_platform();
|
|
7
|
-
import { createElevenLabsProvider, createOpenAiProvider } from "../../../../safe-bash-command-llm/providers/index.js";
|
|
7
|
+
import { createElevenLabsProvider, createOpenAiProvider, encodeLlmBase64, serializeLlmJsonString, serializeLlmJsonValue, serializeOpenAiChatRequest } from "../../../../safe-bash-command-llm/providers/index.js";
|
|
8
8
|
export {
|
|
9
9
|
createElevenLabsProvider,
|
|
10
|
-
createOpenAiProvider
|
|
10
|
+
createOpenAiProvider,
|
|
11
|
+
encodeLlmBase64,
|
|
12
|
+
serializeLlmJsonString,
|
|
13
|
+
serializeLlmJsonValue,
|
|
14
|
+
serializeOpenAiChatRequest
|
|
11
15
|
};
|
|
@@ -4,5 +4,5 @@ export { baseAgentCommands, createBoundedRegexProvider } from "./registry-entry.
|
|
|
4
4
|
export { agentCommands, createAgentCommands } from "./plugins/index.browser.js";
|
|
5
5
|
export { EreLedger, EreProfileLimitError, EreSyntaxError, EreUnsupportedError, EreUsageUnknownError, RegexExecutionError, RegexExecutor, RegexSession, compileEre, matchEre } from "./commands/regex-execution/public.browser.js";
|
|
6
6
|
export { PythonFailure, PythonPackageConflictError, createPythonCommands, createPythonExecutorPool, createPythonHostBridge, createPythonJspiAssets, createPythonJspiExecutor, createPythonJspiNativeCall, createPythonJspiStatResult, createPythonJspiTrampoline, createPythonLlmCapability, createPythonPackageCache, createPythonPackageEnvironment, createPythonPackageManifestStore, createPythonShellCapability, inspectPythonCapabilities, pythonCommands, pythonDocumentPackages, pythonHostFailureCode } from "./commands/python/index.browser.js";
|
|
7
|
-
export { createElevenLabsProvider, createLlmCommand, createLlmCommands, createLlmConfiguration, createLlmService, createLlmTemplateStore, createOpenAiProvider, evaluateLlmTemplate, findExtractedRange, getLlmModelAliases, llmCommands, llmTemplateUsesInput, parseLlmSchemaDsl, resolveLlmSchemaInput, selectLlmModelByQuery, templateYaml, validateLlmTemplateParameters, validateModelOptions } from "./commands/llm/index.browser.js";
|
|
7
|
+
export { createElevenLabsProvider, createLlmCommand, createLlmCommands, createLlmConfiguration, createLlmService, createLlmTemplateStore, createOpenAiProvider, encodeLlmBase64, evaluateLlmTemplate, findExtractedRange, getLlmModelAliases, llmCommands, llmTemplateUsesInput, parseLlmSchemaDsl, resolveLlmSchemaInput, selectLlmModelByQuery, serializeLlmJsonString, serializeLlmJsonValue, serializeOpenAiChatRequest, templateYaml, validateLlmTemplateParameters, validateModelOptions } from "./commands/llm/index.browser.js";
|
|
8
8
|
import "./chunks/chunk-KV7PKOHV.js";
|
package/dist/safe-bash/core.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export { createYesCommand, createYesCommands, yesCommands, type YesCommandOption
|
|
|
64
64
|
export { createDdCommand, createDdCommands, ddCommands, type DdFileHandle, type DdFileOpener, type DdFileRequest, type DdCommandsOptions, type DdLimits, type DdOptions } from "./dd.js";
|
|
65
65
|
export { createNumfmtCommand, createNumfmtCommands, numfmtCommands, type NumfmtCommandsOptions, type NumfmtLimits, type NumfmtOptions } from "./commands/numfmt/index.js";
|
|
66
66
|
export { createEnvsubstCommand, createEnvsubstCommands, envsubstCommands, type EnvsubstCommandsOptions, type EnvsubstLimits, type EnvsubstOptions } from "./commands/envsubst/index.js";
|
|
67
|
-
export { createCalCommand, createCalCommands, calCommands, type CalCommandsOptions, type CalLimits, type CalOptions } from "./commands/cal/index.js";
|
|
67
|
+
export { createCalCommand, createNcalCommand, createCalCommands, calCommands, type CalCommandsOptions, type CalLimits, type CalOptions } from "./commands/cal/index.js";
|
|
68
68
|
export { createPathchkCommand, createPathchkCommands, pathchkCommands, type PathchkCommandsOptions, type PathchkLimits, type PathchkOptions } from "./commands/pathchk/index.js";
|
|
69
69
|
export { createGetconfCommand, createGetconfCommands, getconfCommands, type GetconfCommandsOptions, type GetconfLimits, type GetconfOptions } from "./commands/getconf/index.js";
|
|
70
70
|
export { createSha512sumCommand, createSha512sumCommands, sha512sumCommands, type Sha512sumCommandsOptions, type Sha512sumLimits, type Sha512sumOptions } from "./commands/sha512sum/index.js";
|
|
@@ -121,4 +121,8 @@ export type { ImagemagickLimits } from "./commands/imagemagick/index.js";
|
|
|
121
121
|
export type { UnrtfLimits } from "./commands/unrtf/index.js";
|
|
122
122
|
export type { WkhtmltopdfLimits } from "./commands/wkhtmltopdf/index.js";
|
|
123
123
|
export type { XzLimits } from "./commands/xz/index.js";
|
|
124
|
+
export { createConvertCommand, createMogrifyCommand, createCompositeCommand, createMontageCommand, createIdentifyCommand, createCompareCommand } from "./lazy-optional.js";
|
|
125
|
+
export { createPdfuniteCommand, createPdfseparateCommand, createPdffontsCommand, createPdfdetachCommand, createPdftocairoCommand } from "./lazy-optional.js";
|
|
126
|
+
export { createLibreofficeCommand } from "./lazy-optional.js";
|
|
127
|
+
export { createFormatInspectionCommand } from "./lazy-optional.js";
|
|
124
128
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/safe-bash/core.js
CHANGED
|
@@ -64,7 +64,7 @@ export { createYesCommand, createYesCommands, yesCommands } from "./yes.js";
|
|
|
64
64
|
export { createDdCommand, createDdCommands, ddCommands } from "./dd.js";
|
|
65
65
|
export { createNumfmtCommand, createNumfmtCommands, numfmtCommands } from "./commands/numfmt/index.js";
|
|
66
66
|
export { createEnvsubstCommand, createEnvsubstCommands, envsubstCommands } from "./commands/envsubst/index.js";
|
|
67
|
-
export { createCalCommand, createCalCommands, calCommands } from "./commands/cal/index.js";
|
|
67
|
+
export { createCalCommand, createNcalCommand, createCalCommands, calCommands } from "./commands/cal/index.js";
|
|
68
68
|
export { createPathchkCommand, createPathchkCommands, pathchkCommands } from "./commands/pathchk/index.js";
|
|
69
69
|
export { createGetconfCommand, createGetconfCommands, getconfCommands } from "./commands/getconf/index.js";
|
|
70
70
|
export { createSha512sumCommand, createSha512sumCommands, sha512sumCommands } from "./commands/sha512sum/index.js";
|
|
@@ -111,4 +111,8 @@ export { createSshCommand, createSshKeygenCommand, createSshCommands, sshCommand
|
|
|
111
111
|
export { createGpgCommand, createGpgCommands, gpgCommands } from "./commands/gpg/index.js";
|
|
112
112
|
export { createGhCommand, createGhCommands, ghCommands } from "./lazy-optional.js";
|
|
113
113
|
export { optionalCommands, createOptionalCommands, optionalCommandCatalog, createLazyCommands, createLazyCommandLoader, lazyCommandPlugin } from "./lazy-optional.js";
|
|
114
|
+
export { createConvertCommand, createMogrifyCommand, createCompositeCommand, createMontageCommand, createIdentifyCommand, createCompareCommand } from "./lazy-optional.js";
|
|
115
|
+
export { createPdfuniteCommand, createPdfseparateCommand, createPdffontsCommand, createPdfdetachCommand, createPdftocairoCommand } from "./lazy-optional.js";
|
|
116
|
+
export { createLibreofficeCommand } from "./lazy-optional.js";
|
|
117
|
+
export { createFormatInspectionCommand } from "./lazy-optional.js";
|
|
114
118
|
//# sourceMappingURL=core.js.map
|