@poe-platform/safe-bash 0.1.811 → 0.1.812

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/audio-ast/index.d.ts +1 -0
  2. package/dist/audio-ast/index.js +6 -1
  3. package/dist/audio-ast/vorbis.d.ts +14 -0
  4. package/dist/image-ast/index.js +1 -1
  5. package/dist/pdf-ast/cos/value-parser.d.ts +23 -2
  6. package/dist/pdf-ast/extract/retained-form-field-details.d.ts +20 -0
  7. package/dist/pdf-ast/extract/retained-form-fields.d.ts +17 -4
  8. package/dist/pdf-ast/index.d.ts +1 -0
  9. package/dist/pdf-ast/index.js +701 -336
  10. package/dist/pdf-ast/retained-document.d.ts +4 -0
  11. package/dist/safe-bash/audio-ast.browser.js +2 -1
  12. package/dist/safe-bash/command-chunks/{biff-3EFLKBAH-NYWZOYQS.js → biff-YKPDH35C-MVQIWNKV.js} +2309 -2277
  13. package/dist/safe-bash/command-chunks/{chunk-VU3EQF7F.js → chunk-2JSDKQ4J.js} +110 -31
  14. package/dist/safe-bash/command-chunks/{chunk-72C3TZ2U.js → chunk-3Q247UDJ.js} +1 -1
  15. package/dist/safe-bash/command-chunks/{chunk-HARUYHH7.js → chunk-5HUICAWD.js} +1 -1
  16. package/dist/safe-bash/command-chunks/{chunk-2VCKUNDZ.js → chunk-B2C3UPJS.js} +27 -17
  17. package/dist/safe-bash/command-chunks/{chunk-5LI2DLNZ.js → chunk-CJQSAATC.js} +1 -1
  18. package/dist/safe-bash/command-chunks/{chunk-ZHRGYR7B.js → chunk-FDCIPJBQ.js} +1 -1
  19. package/dist/safe-bash/command-chunks/{chunk-5MB64DWR.js → chunk-HWQ2UHMT.js} +8 -8
  20. package/dist/safe-bash/command-chunks/{chunk-5OO2P27R.js → chunk-NARD63DY.js} +98 -1
  21. package/dist/safe-bash/command-chunks/{chunk-Z5QOVRVH.js → chunk-SU26FZLJ.js} +1 -1
  22. package/dist/safe-bash/command-chunks/{chunk-DPR5CYQV.js → chunk-XITDDJFT.js} +2 -0
  23. package/dist/safe-bash/command-chunks/{chunk-YSY6R6AS.js → chunk-XVLWZTPY.js} +230 -28
  24. package/dist/safe-bash/command-chunks/{chunk-WH3TIOTS.js → chunk-ZEGNRZV2.js} +9 -2
  25. package/dist/safe-bash/command-chunks/{chunk-KL3OIBKB.js → chunk-ZEX53S5I.js} +1892 -1878
  26. package/dist/safe-bash/command-chunks/{command-engine-BEWABZ75.js → command-engine-BCUQGJJ4.js} +58 -21
  27. package/dist/safe-bash/command-chunks/{engine-AXXFTGCL-QBQNBI6K.js → engine-LAUEWYSQ-DQCEI5HE.js} +1 -1
  28. package/dist/safe-bash-command-apply-patch/apply.js +4 -4
  29. package/dist/safe-bash-command-apply-patch/index.js +4 -4
  30. package/dist/safe-bash-command-apply-patch/matcher.js +2 -2
  31. package/dist/safe-bash-command-apply-patch/parser.js +2 -2
  32. package/dist/safe-bash-command-apply-patch/shared.d.ts +2 -0
  33. package/dist/safe-bash-command-apply-patch/shared.js +1 -1
  34. package/dist/safe-bash-command-ffmpeg/index.js +1 -1
  35. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  36. package/dist/safe-bash-command-ffprobe/media.js +2 -2
  37. package/dist/safe-bash-command-pandoc/command.js +1 -1
  38. package/dist/safe-bash-command-pandoc/index.js +1 -1
  39. package/dist/safe-bash-command-patch/index.js +2 -2
  40. package/dist/safe-bash-command-patch/patch-publication.js +1 -1
  41. package/dist/safe-bash-command-patch/patch.js +2 -2
  42. package/dist/safe-bash-command-pdftk/index.js +35 -2
  43. package/dist/safe-bash-command-pptx/command-engine.d.ts +12 -3
  44. package/dist/safe-bash-command-pptx/engine.d.ts +2 -2
  45. package/dist/safe-bash-command-pptx/engine.js +1 -1
  46. package/dist/safe-bash-command-ssconvert/index.js +2 -2
  47. package/dist/safe-bash-diff-engine/document.d.ts +2 -1
  48. package/dist/safe-bash-diff-engine/document.js +7 -4
  49. package/dist/safe-bash-presentation-engine/command-placeholder.js +4 -3
  50. package/dist/safe-bash-presentation-engine/index.d.ts +1 -1
  51. package/dist/safe-bash-presentation-engine/index.js +9 -7
  52. package/dist/safe-bash-presentation-engine/presentation-model.js +3 -2
  53. package/dist/safe-bash-presentation-engine/retained-slide-publication.d.ts +24 -0
  54. package/dist/safe-bash-presentation-engine/slides.d.ts +1 -0
  55. package/dist/safe-bash-presentation-engine/slides.js +6 -3
  56. package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +2 -2
  57. package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +46 -13
  58. package/dist/spreadsheet-format-xls/biff-metadata.d.ts +1 -0
  59. package/dist/spreadsheet-format-xls/biff-metadata.js +2 -2
  60. package/dist/spreadsheet-format-xls/biff-write-metadata.js +10 -1
  61. package/package.json +2 -2
@@ -1,3 +1,4 @@
1
+ export { normalizeVorbisCommentKey } from "./vorbis.js";
1
2
  export { probeFlacSource, type FlacCommentSpan } from "./flac-source.js";
2
3
  export { probeWavSource, type AudioProbeSource, type WavTagSpan } from "./wav-source.js";
3
4
  export * from "./types.js";
@@ -158,11 +158,15 @@ function pictureBase64(picture) {
158
158
  function addVorbisComment(tags, value) {
159
159
  const split = value.indexOf("=");
160
160
  if (split > 0) {
161
- const key = value.slice(0, split).toUpperCase(), name = names[key] ?? key;
161
+ const name = normalizeVorbisCommentKey(value.slice(0, split));
162
162
  tags[name] = tags[name] ? `${tags[name]}
163
163
  ${value.slice(split + 1)}` : value.slice(split + 1);
164
164
  }
165
165
  }
166
+ function normalizeVorbisCommentKey(value) {
167
+ const key = value.toUpperCase();
168
+ return names[key] ?? key;
169
+ }
166
170
 
167
171
  // packages/audio-ast/src/flac.ts
168
172
  function parseFlac(bytes) {
@@ -1694,6 +1698,7 @@ export {
1694
1698
  extractChannels,
1695
1699
  fade,
1696
1700
  normalize,
1701
+ normalizeVorbisCommentKey,
1697
1702
  pad,
1698
1703
  parseAudio,
1699
1704
  probeAudio,
@@ -0,0 +1,14 @@
1
+ import type { AudioPicture, AudioTags } from "./types.js";
2
+ export declare function parseComments(bytes: Uint8Array): {
3
+ tags: AudioTags;
4
+ vendor: string;
5
+ comments: string[];
6
+ size: number;
7
+ };
8
+ export declare function encodeComments(tags: AudioTags, vendor?: string): Uint8Array;
9
+ export declare function parsePicture(bytes: Uint8Array): AudioPicture;
10
+ export declare function encodePicture(p: AudioPicture): Uint8Array;
11
+ export declare function pictureBase64(picture: AudioPicture): string;
12
+ /** Preserve normalization and duplicate joining for decoded Vorbis comments. */
13
+ export declare function addVorbisComment(tags: AudioTags, value: string): void;
14
+ export declare function normalizeVorbisCommentKey(value: string): string;
@@ -1762,7 +1762,7 @@ async function openPdfImage(source, fs, directory, signal, options, storage) {
1762
1762
  if (failure) throw failure.error;
1763
1763
  };
1764
1764
  try {
1765
- document = await PdfRetainedDocument.open(retained, { fs, directory }, { signal, recovery: "repair", chunkBytes: 16384, maxNodes: 1 / 0, maxTokenBytes: 1 / 0, maxRecursionDepth: 1 / 0, maxPageTreeDepth: 1 / 0, xref: { arrayStorage: values, storedArrayKeys: ["Index"] }, valueArrays: { stringStorage: values, storedStringKeys: ["ActualText"], arrayStorage: values, storedArrayKeys: ["Contents", "Annots", "Kids", "Widths", "W", "Differences", "ON", "OFF", "OCGs"], storedArrayPaths: [["ExtGState", "*", "D"]] } });
1765
+ document = await PdfRetainedDocument.open(retained, { fs, directory }, { signal, recovery: "repair", chunkBytes: 16384, maxNodes: 1 / 0, maxTokenBytes: 1 / 0, maxRecursionDepth: 1 / 0, maxPageTreeDepth: 1 / 0, xref: { arrayStorage: values, storedArrayKeys: ["Index"] }, valueArrays: { containerStorage: values, stringStorage: values, storedStringKeys: ["ActualText"], arrayStorage: values, storedArrayKeys: ["Contents", "Annots", "Kids", "Widths", "W", "Differences", "ON", "OFF", "OCGs"], storedArrayPaths: [["ExtGState", "*", "D"]] } });
1766
1766
  let pages = 0, selected;
1767
1767
  for await (let page of document.pages())
1768
1768
  pages++, page.index <= Math.max(0, settings.page ?? 0) && (selected = page);
@@ -1,7 +1,9 @@
1
- import type { PdfCosNode, PdfCosDict, PdfPixelStorage } from "../ast.js";
1
+ import type { PdfCosNode, PdfCosDict, PdfDictEntry, PdfPixelStorage, PdfStoredItems } from "../ast.js";
2
2
  import type { CosToken } from "./lexer.js";
3
3
  export interface ValueArrayStorage {
4
4
  readonly arrayStorage?: PdfPixelStorage;
5
+ /** Back suspended parser containers; selected descriptors must share this storage. */
6
+ readonly containerStorage?: PdfPixelStorage;
5
7
  /** Select decoded source strings without changing other string consumers. */
6
8
  readonly stringStorage?: PdfPixelStorage;
7
9
  readonly storedStringKeys?: readonly string[];
@@ -14,11 +16,30 @@ export interface ValueArrayStorage {
14
16
  readonly arrayPathPrefix?: readonly string[];
15
17
  readonly storeRootArray?: boolean;
16
18
  }
19
+ export type ValueContainer = ({
20
+ kind: "array";
21
+ start: number;
22
+ items: PdfCosNode[];
23
+ storedItems?: PdfStoredItems;
24
+ tail: number;
25
+ } | {
26
+ kind: "dict";
27
+ start: number;
28
+ entries: PdfDictEntry[];
29
+ key?: PdfDictEntry["key"];
30
+ }) & {
31
+ path: readonly (string | null)[];
32
+ };
17
33
  export type ValueWork<T> = Generator<void | "token" | PdfCosDict | {
18
34
  kind: "array-append";
19
35
  node: PdfCosNode;
20
36
  previous: number;
21
- }, T, CosToken | PdfCosNode | number | undefined>;
37
+ } | {
38
+ kind: "container-push";
39
+ container: ValueContainer;
40
+ } | {
41
+ kind: "container-pop";
42
+ }, T, CosToken | PdfCosNode | ValueContainer | number | undefined>;
22
43
  export declare function parseValueSteps(lexer: {
23
44
  offset: number;
24
45
  setStringStorage?: (storage: PdfPixelStorage | undefined) => void;
@@ -0,0 +1,20 @@
1
+ import type { PdfIndexStorage } from "../cos/object-index.js";
2
+ import type { PdfFormFieldInfo } from "../edit/forms.js";
3
+ import type { PdfRetainedDocument } from "../retained-document.js";
4
+ import { type RetainedFieldOptions } from "./retained-form-fields.js";
5
+ /** Borrowed field metadata. Consume values/options before advancing the field
6
+ * iterator. Both iterators close when their field or document is released. */
7
+ export interface PdfRetainedFormFieldDetails {
8
+ readonly name: string;
9
+ readonly type: PdfFormFieldInfo["type"];
10
+ readonly flags: number;
11
+ readonly justification: "Left" | "Centered" | "Right";
12
+ readonly maxLength: number | undefined;
13
+ readonly altName: string | undefined;
14
+ readonly defaultValue: string | undefined;
15
+ readonly stateValue: string | undefined;
16
+ readonly checked: boolean | undefined;
17
+ values(): AsyncGenerator<string, void, void>;
18
+ options(): AsyncGenerator<string, void, void>;
19
+ }
20
+ export declare function walkRetainedFormFieldDetails(document: PdfRetainedDocument, storage: PdfIndexStorage, options?: RetainedFieldOptions): AsyncGenerator<PdfRetainedFormFieldDetails, void, void>;
@@ -1,11 +1,24 @@
1
+ import { type PdfCosDict, type PdfCosNode } from "../ast.js";
1
2
  import type { PdfIndexStorage } from "../cos/object-index.js";
2
3
  import type { PdfFormFieldInfo } from "../edit/forms.js";
3
4
  import type { PdfRetainedDocument } from "../retained-document.js";
4
5
  export type PdfRetainedFormField = Pick<PdfFormFieldInfo, "name" | "type" | "value">;
5
- /** Summarize fields one at a time. Traversal frames and active-path membership
6
- * live on caller storage, preserving repeated fields while stopping cycles. */
7
- export declare function walkRetainedFormFields(document: PdfRetainedDocument, storage: PdfIndexStorage, options?: {
6
+ export interface RetainedFieldEntry {
7
+ readonly name: string;
8
+ readonly dict: PdfCosDict;
9
+ readonly ft: string;
10
+ readonly flags: number;
11
+ readonly justification: number;
12
+ readonly maxLength: number | undefined;
13
+ }
14
+ export interface RetainedFieldOptions {
8
15
  maxDepth?: number;
9
16
  maxStagingBytes?: number;
10
17
  signal?: AbortSignal;
11
- }): AsyncGenerator<PdfRetainedFormField, void, void>;
18
+ }
19
+ export declare function inheritedRetainedFieldEntry(document: PdfRetainedDocument, storage: PdfIndexStorage, dict: PdfCosDict, key: string, options: RetainedFieldOptions): Promise<PdfCosNode | undefined>;
20
+ /** Summarize fields one at a time. Traversal frames and active-path membership
21
+ * live on caller storage, preserving repeated fields while stopping cycles. */
22
+ export declare function walkRetainedFieldEntries(document: PdfRetainedDocument, storage: PdfIndexStorage, options?: RetainedFieldOptions): AsyncGenerator<RetainedFieldEntry, void, void>;
23
+ /** Compatibility summaries; detailed consumers can iterate values/options separately. */
24
+ export declare function walkRetainedFormFields(document: PdfRetainedDocument, storage: PdfIndexStorage, options?: RetainedFieldOptions): AsyncGenerator<PdfRetainedFormField, void, void>;
@@ -32,6 +32,7 @@ export * from "./extract/text.js";
32
32
  export * from "./extract/tables.js";
33
33
  export * from "./extract/semantic-ast.js";
34
34
  export * from "./extract/images.js";
35
+ export type { PdfRetainedFormFieldDetails } from "./extract/retained-form-field-details.js";
35
36
  export type { PdfRetainedFormField } from "./extract/retained-form-fields.js";
36
37
  export type { PdfRetainedAttachment } from "./extract/retained-attachments.js";
37
38
  export * from "./edit/redact.js";