@poe-platform/safe-bash 0.1.838 → 0.1.840

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 (61) hide show
  1. package/dist/mp4-ast/types.d.ts +4 -2
  2. package/dist/pdf-ast/cos/security.d.ts +10 -0
  3. package/dist/pdf-ast/edit/retained-attachment-edits.d.ts +4 -0
  4. package/dist/pdf-ast/edit/retained-graph.d.ts +1 -1
  5. package/dist/pdf-ast/image.js +1 -1
  6. package/dist/pdf-ast/index.d.ts +2 -1
  7. package/dist/pdf-ast/index.js +7 -1
  8. package/dist/pdf-ast/vendor/pdfjs-fonts.d.mts +8 -0
  9. package/dist/pdf-ast/vendor/pdfjs-fonts.mjs +28 -0
  10. package/dist/safe-bash/command-chunks/{chunk-SG2KOOD4.js → chunk-3SAYZFMD.js} +2 -2
  11. package/dist/safe-bash/command-chunks/{chunk-FH5VMAPS.js → chunk-45ZH6CNF.js} +20 -4
  12. package/dist/safe-bash/command-chunks/{chunk-T6OXG7QQ.js → chunk-AAOPVEPF.js} +66 -1
  13. package/dist/safe-bash/command-chunks/{chunk-46GA576V.js → chunk-CPKVUB7S.js} +2 -2
  14. package/dist/safe-bash/command-chunks/{chunk-MBXNG6C3.js → chunk-DLLN3C3Q.js} +1 -1
  15. package/dist/safe-bash/command-chunks/{chunk-ZSQCROFE.js → chunk-DM5T5D2K.js} +5 -1
  16. package/dist/safe-bash/command-chunks/{chunk-3EAZRKI4.js → chunk-G7HQYFIU.js} +10 -1
  17. package/dist/safe-bash/command-chunks/{chunk-GYKQ3IOV.js → chunk-LMYQMJYY.js} +94 -18
  18. package/dist/safe-bash/command-chunks/{chunk-DX7KU6YU.js → chunk-N52AHO6S.js} +1 -1
  19. package/dist/safe-bash/command-chunks/{chunk-4BSD2RGK.js → chunk-QPKL5GWH.js} +102 -42
  20. package/dist/safe-bash/command-chunks/{chunk-Z2T7E4ID.js → chunk-R7QLP5RH.js} +1212 -1119
  21. package/dist/safe-bash/command-chunks/{chunk-RSFKQE2U.js → chunk-T5WFJ44Z.js} +1 -1
  22. package/dist/safe-bash/command-chunks/{chunk-77ROD2TR.js → chunk-X3WNWRVT.js} +11 -5
  23. package/dist/safe-bash/command-chunks/{chunk-TCXM7BSZ.js → chunk-YFMNXPLP.js} +4 -4
  24. package/dist/safe-bash/command-chunks/{chunk-DQVOBGI2.js → chunk-YVFQ5I36.js} +7335 -7162
  25. package/dist/safe-bash-command-exiftool/index.js +25 -1
  26. package/dist/safe-bash-command-ffmpeg/index.js +174 -41
  27. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  28. package/dist/safe-bash-command-ffprobe/media.js +2 -2
  29. package/dist/safe-bash-command-imagemagick/index.js +504 -111
  30. package/dist/safe-bash-command-mdq/index.js +2 -0
  31. package/dist/safe-bash-command-pandoc/citeproc-filters.js +7 -7
  32. package/dist/safe-bash-command-pandoc/command.js +8 -8
  33. package/dist/safe-bash-command-pandoc/index.js +51 -51
  34. package/dist/safe-bash-command-qpdf/index.js +1037 -654
  35. package/dist/safe-bash-command-qpdf/page-range.d.ts +2 -0
  36. package/dist/safe-bash-command-soffice/index.js +28 -8
  37. package/dist/safe-bash-command-sqlite3/btree.d.ts +2 -1
  38. package/dist/safe-bash-command-sqlite3/engine.d.ts +15 -1
  39. package/dist/safe-bash-command-sqlite3/index.js +294 -68
  40. package/dist/safe-bash-command-tar/create.js +2 -2
  41. package/dist/safe-bash-command-tar/extract.js +2 -2
  42. package/dist/safe-bash-command-tar/format.js +1 -1
  43. package/dist/safe-bash-command-tar/index.js +4 -4
  44. package/dist/safe-bash-command-tar/modes.js +4 -4
  45. package/dist/safe-bash-command-unzip/index.js +1 -1
  46. package/dist/safe-bash-command-unzip/unzip.js +1 -1
  47. package/dist/safe-bash-markdown-engine/commonmark-blocks.d.ts +17 -1
  48. package/dist/safe-bash-markdown-engine/commonmark-blocks.js +3 -3
  49. package/dist/safe-bash-markdown-engine/commonmark-inlines.d.ts +1 -1
  50. package/dist/safe-bash-markdown-engine/commonmark-inlines.js +3 -3
  51. package/dist/safe-bash-markdown-engine/commonmark-syntax.d.ts +5 -0
  52. package/dist/safe-bash-markdown-engine/commonmark-syntax.js +5 -1
  53. package/dist/safe-bash-markdown-engine/gfm-syntax.js +2 -2
  54. package/dist/safe-bash-markdown-engine/index.js +4 -4
  55. package/dist/safe-bash-zip-engine/index.js +1 -1
  56. package/dist/safe-bash-zip-engine/zip/repair.js +1 -1
  57. package/dist/safe-bash-zip-engine/zip/sfx.js +1 -1
  58. package/dist/safe-bash-zip-engine/zip-format.d.ts +2 -0
  59. package/dist/safe-bash-zip-engine/zip-format.js +1 -1
  60. package/package.json +2 -2
  61. package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +2 -0
@@ -1,3 +1,5 @@
1
+ export declare class QpdfPageRangeError extends Error {
2
+ }
1
3
  /** Expand on demand. Later exclusions filter earlier ranges without a page set;
2
4
  * the compact descriptors grow only with the caller's range expression. */
3
5
  export declare function iterateQpdfPageRange(rangeSpec: string, totalPages: number): Generator<number, void, void>;
@@ -877,10 +877,16 @@ function parseHtmlBlocks(source) {
877
877
  const blocks = [];
878
878
  let text = "";
879
879
  let kind = "paragraph";
880
+ const lists = [];
881
+ let marker = "";
882
+ let preformatted = false;
880
883
  const tables = [];
881
884
  const flush = () => {
882
- const value = text.replace(/[\t\n\r\f ]+/g, " ").trim();
883
- if (value) blocks.push({ kind, text: value });
885
+ const value = preformatted ? text : text.split("\n").map((line) => line.replace(/[\t\r\f ]+/g, " ").trim()).join("\n");
886
+ if (value) {
887
+ blocks.push(preformatted ? { kind, text: marker + value, preformatted: true } : { kind, text: marker + value });
888
+ marker = "";
889
+ }
884
890
  text = "";
885
891
  };
886
892
  const append = (value) => {
@@ -893,7 +899,7 @@ function parseHtmlBlocks(source) {
893
899
  while (stack.length) {
894
900
  const { node, exit } = stack.pop();
895
901
  if ("value" in node && node.nodeName === "#text") {
896
- append(node.value);
902
+ append(preformatted ? node.value : node.value.replace(/[\t\n\r\f ]+/g, " "));
897
903
  continue;
898
904
  }
899
905
  const tag = "tagName" in node ? node.tagName : "";
@@ -918,10 +924,23 @@ function parseHtmlBlocks(source) {
918
924
  table.cell = void 0;
919
925
  } else table.cell = "";
920
926
  } else if (boundaries.has(tag) || tag === "br") append(" ");
927
+ } else if (tag === "pre") {
928
+ flush();
929
+ preformatted = !exit;
930
+ kind = "paragraph";
931
+ } else if (preformatted) {
932
+ if (tag === "br" && !exit) append("\n");
921
933
  } else if (boundaries.has(tag)) {
922
934
  flush();
923
935
  kind = !exit && headings.has(tag) ? "heading" : "paragraph";
924
- } else if (tag === "br") append("\n");
936
+ if (tag === "ul" || tag === "ol") {
937
+ if (exit) lists.pop();
938
+ else lists.push({ next: tag === "ol" ? 1 : void 0 });
939
+ } else if (tag === "li") {
940
+ const list = lists.at(-1);
941
+ marker = exit || !list ? "" : list.next === void 0 ? "\u2022 " : `${list.next++}. `;
942
+ }
943
+ } else if (tag === "br" && !exit) append("\n");
925
944
  if (!exit && "childNodes" in node) {
926
945
  stack.push({ node, exit: true });
927
946
  for (let i = node.childNodes.length - 1; i >= 0; i--) stack.push({ node: node.childNodes[i] });
@@ -3598,7 +3617,7 @@ function* renderBlocksToPdf(blocks, title = "Document") {
3598
3617
  for (const block of blocks) {
3599
3618
  if (++work % 32 === 0) yield void 0;
3600
3619
  if (block.kind === "heading") {
3601
- const lines = wrapTextLines(block.text ?? "", 48);
3620
+ const lines = (block.text ?? "").split("\n").flatMap((line) => wrapTextLines(line, 48));
3602
3621
  for (const line of lines) {
3603
3622
  ensureSpace(26);
3604
3623
  page.drawText(line, {
@@ -3612,14 +3631,14 @@ function* renderBlocksToPdf(blocks, title = "Document") {
3612
3631
  }
3613
3632
  y -= 4;
3614
3633
  } else if (block.kind === "paragraph") {
3615
- const lines = wrapTextLines(block.text ?? "", 84);
3634
+ const lines = (block.text ?? "").split("\n").flatMap((line) => block.preformatted ? [line] : wrapTextLines(line, 84));
3616
3635
  for (const line of lines) {
3617
3636
  ensureSpace(16);
3618
3637
  page.drawText(line, {
3619
3638
  x: 54,
3620
3639
  y,
3621
3640
  size: 11,
3622
- font: "Helvetica",
3641
+ font: block.preformatted ? "Courier" : "Helvetica",
3623
3642
  color: rgb(0.15, 0.15, 0.15)
3624
3643
  });
3625
3644
  y -= 15;
@@ -3856,7 +3875,8 @@ function renderBlocksToHtml(blocks, title = "Document") {
3856
3875
  html += `<h1>${escapeHtmlText(b.text ?? "")}</h1>
3857
3876
  `;
3858
3877
  } else if (b.kind === "paragraph") {
3859
- html += `<p>${escapeHtmlText(b.text ?? "")}</p>
3878
+ const tag = b.preformatted ? "pre" : "p";
3879
+ html += `<${tag}>${escapeHtmlText(b.text ?? "")}</${tag}>
3860
3880
  `;
3861
3881
  } else if (b.kind === "table" && b.rows) {
3862
3882
  html += "<table>\n";
@@ -4,7 +4,8 @@ export interface StoredTableMeta {
4
4
  name: string;
5
5
  tbl_name: string;
6
6
  rootpage: number;
7
- sql: string;
7
+ sql: string | null;
8
+ indexPresorted?: boolean;
8
9
  withoutRowId?: boolean;
9
10
  }
10
11
  export interface StoredDatabaseImage {
@@ -68,9 +68,20 @@ export interface TableDef {
68
68
  collation: string | undefined;
69
69
  }[] | undefined;
70
70
  uniqueColSets: string[][];
71
+ implicitIndexes?: {
72
+ columns: string[];
73
+ order: {
74
+ desc: boolean;
75
+ collation: string | undefined;
76
+ }[];
77
+ primary: boolean;
78
+ }[] | undefined;
71
79
  fts5?: boolean | undefined;
72
80
  foreignKeys?: ForeignKeyDef[] | undefined;
73
81
  }
82
+ export declare class SqliteConstraintError extends Error {
83
+ readonly code = 19;
84
+ }
74
85
  export interface Token {
75
86
  type: "word" | "string" | "ident" | "number" | "blob" | "op" | "punct" | "param";
76
87
  value: string;
@@ -81,6 +92,7 @@ export declare function tokenizeSql(sql: string): Token[];
81
92
  export type ExprNode = {
82
93
  kind: "literal";
83
94
  value: SqlValue;
95
+ booleanLiteral?: true;
84
96
  } | {
85
97
  kind: "column";
86
98
  table?: string | undefined;
@@ -174,6 +186,7 @@ export declare class SqliteDatabase {
174
186
  constructor(maxRows?: number);
175
187
  private checkRowCount;
176
188
  executeStatementAsync(sql: string, signal: AbortSignal): Promise<QueryResultSet | null>;
189
+ private readonly rowTables;
177
190
  tables: Map<string, TableDef>;
178
191
  indexes: Map<string, IndexDef>;
179
192
  views: Map<string, ViewDef>;
@@ -189,7 +202,7 @@ export declare class SqliteDatabase {
189
202
  lastInsertRowid: number;
190
203
  lastChanges: number;
191
204
  totalChanges: number;
192
- inTransaction: boolean;
205
+ get inTransaction(): boolean;
193
206
  private foreignKeyDepth;
194
207
  private outerRows;
195
208
  private preparing;
@@ -257,6 +270,7 @@ export declare class SqliteDatabase {
257
270
  rows: SqlValue[][];
258
271
  }>): SqlValue;
259
272
  private evalExprSteps;
273
+ private expressionAffinity;
260
274
  private applyUnary;
261
275
  private applyBinary;
262
276
  private applyCast;