@poe-platform/safe-bash 0.1.809 → 0.1.810
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/audio-ast/index.d.ts +1 -1
- package/dist/audio-ast/index.js +6 -0
- package/dist/audio-ast/wav-source.d.ts +7 -1
- package/dist/image-ast/index.js +1 -1
- package/dist/pdf-ast/cos/mutable-object-store.d.ts +3 -0
- package/dist/pdf-ast/cos/qpdf-json-document.d.ts +42 -0
- package/dist/pdf-ast/cos/qpdf-json-values.d.ts +7 -0
- package/dist/pdf-ast/index.d.ts +1 -0
- package/dist/pdf-ast/index.js +508 -37
- package/dist/pdf-ast/retained-document.d.ts +3 -1
- package/dist/safe-bash/chunks/{chunk-RQCK77SC.js → chunk-65TFMAZU.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-SOFBGDXG.js → chunk-HHSOUC3Z.js} +32 -0
- package/dist/safe-bash/chunks/{chunk-WAZEELYB.js → chunk-ZA5FQ34E.js} +10 -5
- package/dist/safe-bash/command-chunks/biff-ORSHM4YX-QYPGRDAZ.js +4937 -0
- package/dist/safe-bash/command-chunks/{chunk-62ZAHKFS.js → chunk-2VCKUNDZ.js} +130 -14
- package/dist/safe-bash/command-chunks/{chunk-GLVD3JJG.js → chunk-BYZUOF6X.js} +2858 -2816
- package/dist/safe-bash/command-chunks/{chunk-6OKH4X67.js → chunk-CAXJ4RLF.js} +264 -1
- package/dist/safe-bash/command-chunks/{chunk-YJJBGN7U.js → chunk-CHR2OD2U.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-D7XBUF76.js → chunk-D2ASPM7R.js} +109 -23
- package/dist/safe-bash/command-chunks/chunk-D5AYP2UM.js +816 -0
- package/dist/safe-bash/command-chunks/{chunk-WFDG3N5R.js → chunk-ECDEPKKW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-OQCJGUI6.js → chunk-HARUYHH7.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-NVBUC644.js → chunk-HKGNBH7Z.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-MGBHGZEX.js +12 -0
- package/dist/safe-bash/command-chunks/{chunk-4557HE3J.js → chunk-PMWW7KSB.js} +161 -42
- package/dist/safe-bash/command-chunks/{chunk-JW3KIZU6.js → chunk-RUXY7GN5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KELMIFVV.js → chunk-TI52LKLL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JJQ72P3V.js → chunk-VCML4T5D.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5HGEXQVD.js → chunk-WC2OCF4H.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-WH3TIOTS.js +326 -0
- package/dist/safe-bash/command-chunks/{chunk-45FI2IPY.js → chunk-WQ6ABTJU.js} +3 -6
- package/dist/safe-bash/command-chunks/{chunk-NB7JO7FE.js → chunk-YTFWPJ3F.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GKYCV6BU.js → chunk-ZEPDT6I5.js} +482 -168
- package/dist/safe-bash/command-chunks/{command-engine-P5DFM4OU.js → command-engine-BEWABZ75.js} +10 -3
- package/dist/safe-bash/command-chunks/{engine-RU4OFLPO-CPLFYD67.js → engine-MEPOXIXT-WZMRHACG.js} +1 -1
- package/dist/safe-bash/command-chunks/pdf-LOZAXXS6-ERI57IAV.js +557 -0
- package/dist/safe-bash/commands/audio/index.browser.js +2 -14
- package/dist/safe-bash/commands/diff-patch/index.js +0 -2
- package/dist/safe-bash/commands/ffprobe/index.browser.js +2 -5
- package/dist/safe-bash/commands/pandoc/index.browser.js +3 -1
- package/dist/safe-bash/commands/text.js +10 -1
- package/dist/safe-bash/core.d.ts +2 -2
- package/dist/safe-bash/core.js +2 -2
- package/dist/safe-bash/full-core.browser.js +18 -22
- package/dist/safe-bash/lazy-optional.d.ts +9 -0
- package/dist/safe-bash/lazy-optional.js +24 -0
- package/dist/safe-bash/plugins/index.browser.js +5 -3
- package/dist/safe-bash/registry-entry.browser.js +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +2 -2
- package/dist/safe-bash-command-apply-patch/index.js +2 -2
- package/dist/safe-bash-command-apply-patch/parser.d.ts +20 -1
- package/dist/safe-bash-command-apply-patch/parser.js +1 -1
- package/dist/safe-bash-command-ffprobe/index.js +2 -1
- package/dist/safe-bash-command-ffprobe/media.js +2 -1
- package/dist/safe-bash-command-ffprobe/options.d.ts +15 -0
- package/dist/safe-bash-command-ffprobe/options.js +7 -0
- package/dist/safe-bash-command-media/index.js +2 -2
- package/dist/safe-bash-command-media/plugin.js +1 -1
- package/dist/safe-bash-command-media/remote.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +6 -6
- package/dist/safe-bash-command-pandoc/index.js +31 -31
- package/dist/safe-bash-command-patch/index.js +2 -2
- package/dist/safe-bash-command-patch/patch-publication.d.ts +2 -2
- package/dist/safe-bash-command-patch/patch-publication.js +1 -1
- package/dist/safe-bash-command-patch/patch.js +2 -2
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-ssconvert/index.js +2 -2
- package/dist/safe-bash-command-xmllint/index.js +137 -30
- package/dist/safe-bash-compression-engine/bounded-codec.js +2 -2
- package/dist/safe-bash-compression-engine/codec-loader.js +1 -1
- package/dist/safe-bash-compression-engine/files.js +5 -5
- package/dist/safe-bash-compression-engine/index.js +4 -4
- package/dist/safe-bash-compression-engine/operand.js +5 -5
- package/dist/safe-bash-compression-engine/stream.js +4 -4
- package/dist/safe-bash-compression-engine/zstd-decode.js +3 -3
- package/dist/safe-bash-media-engine/imagemagick.d.ts +2 -0
- package/dist/safe-bash-media-engine/index.js +162 -72
- package/dist/safe-bash-network-engine/body.d.ts +1 -0
- package/dist/safe-bash-network-engine/body.js +1 -1
- package/dist/safe-bash-network-engine/transfer.js +11 -3
- package/dist/safe-bash-presentation-engine/command-placeholder.js +4 -3
- package/dist/safe-bash-presentation-engine/index.d.ts +1 -1
- package/dist/safe-bash-presentation-engine/index.js +9 -4
- package/dist/safe-bash-presentation-engine/presentation-model.js +3 -2
- package/dist/safe-bash-presentation-engine/retained-text.js +3 -3
- package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +26 -0
- package/dist/safe-bash-presentation-engine/xml-parts.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/xml-parts.js +7 -1
- package/dist/safe-bash-xml-engine/document.js +1 -1
- package/dist/safe-bash-xml-engine/index.js +1 -1
- package/dist/spreadsheet-engine/rendering/print/tab-layout.d.ts +11 -0
- package/dist/spreadsheet-engine/rendering/print/tab-layout.js +15 -0
- package/dist/spreadsheet-engine/rendering/print/text-lines.d.ts +2 -2
- package/dist/spreadsheet-engine/rendering/print/text-lines.js +3 -3
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +4 -0
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +137 -56
- package/dist/spreadsheet-format-xls/biff-encryption.d.ts +1 -1
- package/dist/spreadsheet-format-xls/biff-encryption.js +8 -3
- package/dist/spreadsheet-format-xls/biff-property-bytes.d.ts +1 -1
- package/dist/spreadsheet-format-xls/biff-property-bytes.js +2 -2
- package/dist/spreadsheet-format-xls/biff.js +11 -3
- package/package.json +3 -2
- package/dist/safe-bash/chunks/chunk-I2A5ZCPD.js +0 -17
- package/dist/safe-bash/chunks/chunk-PQTT2EZP.js +0 -8
- package/dist/safe-bash/command-chunks/biff-DS263V2K-2GP4GZT7.js +0 -4868
- package/dist/safe-bash/command-chunks/chunk-6ZFYWT3U.js +0 -581
- package/dist/safe-bash/command-chunks/chunk-S244SWDH.js +0 -153
- package/dist/safe-bash/command-chunks/pdf-T7AWYZGQ-KNAYJ7YF.js +0 -552
- /package/dist/safe-bash/command-chunks/{chunk-EMMSXKEJ.js → chunk-4Q4R3VZU.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { probeWavSource, type AudioProbeSource } from "./wav-source.js";
|
|
1
|
+
export { probeWavSource, type AudioProbeSource, type WavTagSpan } from "./wav-source.js";
|
|
2
2
|
export * from "./types.js";
|
|
3
3
|
export { decodePcm, encodeWav } from "./wav.js";
|
|
4
4
|
export * from "./dsp.js";
|
package/dist/audio-ast/index.js
CHANGED
|
@@ -328,6 +328,12 @@ async function probeWavSource(source, options = {}) {
|
|
|
328
328
|
for (let pos = start + 4; pos < start + size; ) {
|
|
329
329
|
const info = await read(pos, 8), id = info.text(0, 4), length = info.u32(4, true);
|
|
330
330
|
if (length > start + size - pos - 8) throw new Error("WAV INFO exceeds LIST bounds");
|
|
331
|
+
if (options.onTag) {
|
|
332
|
+
await options.onTag({ key: infoNames[id] ?? id, offset: pos + 8, length });
|
|
333
|
+
options.signal?.throwIfAborted();
|
|
334
|
+
pos += 8 + length + length % 2;
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
331
337
|
const decoder = new TextDecoder();
|
|
332
338
|
let text2 = "", ended = false;
|
|
333
339
|
for (let index = 0; index < length; index += 16384) {
|
|
@@ -4,7 +4,13 @@ export interface AudioProbeSource {
|
|
|
4
4
|
readonly size: number;
|
|
5
5
|
read(offset: number, length: number): Promise<Uint8Array>;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
export interface WavTagSpan {
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly offset: number;
|
|
10
|
+
readonly length: number;
|
|
11
|
+
}
|
|
12
|
+
/** Skip sample/unknown payloads and AST nodes. onTag exposes spans instead of materialized tag strings. */
|
|
8
13
|
export declare function probeWavSource(source: AudioProbeSource, options?: {
|
|
9
14
|
signal?: AbortSignal;
|
|
15
|
+
onTag?: (span: WavTagSpan) => Promise<void>;
|
|
10
16
|
}): Promise<Omit<AudioAst, "data" | "nodes" | "pictures">>;
|
package/dist/image-ast/index.js
CHANGED
|
@@ -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: ["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: { 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);
|
|
@@ -42,6 +42,9 @@ export declare class PdfMutableObjectStore {
|
|
|
42
42
|
private save;
|
|
43
43
|
get(number: number): Promise<PdfRetainedOutputObject | undefined>;
|
|
44
44
|
private load;
|
|
45
|
+
/** Borrow encoded stream bytes without parsing the object's dictionary. */
|
|
46
|
+
getStream(number: number): Promise<PdfRetainedOutputObject["stream"]>;
|
|
47
|
+
private streamSnapshot;
|
|
45
48
|
/** Remember successful decoding only while this stream snapshot is current. */
|
|
46
49
|
markDecoded(object: PdfRetainedOutputObject): Promise<void>;
|
|
47
50
|
/** Enumerate live identities without parsing values or reading payloads. */
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type PdfCosRef } from "../ast.js";
|
|
2
|
+
import { PdfFileSource } from "../source.js";
|
|
3
|
+
import type { PdfRetainedDocument } from "../retained-document.js";
|
|
4
|
+
import type { PdfIndexStorage } from "./object-index.js";
|
|
5
|
+
export interface ApplyQpdfJsonOptions {
|
|
6
|
+
/** The caller retains ownership of datafile handles. */
|
|
7
|
+
readonly dataFile?: (path: string) => Promise<PdfFileSource | undefined>;
|
|
8
|
+
readonly maxInputBytes?: number;
|
|
9
|
+
readonly syntaxError?: (offset: number, message: string, tokenOffset?: number) => never;
|
|
10
|
+
}
|
|
11
|
+
/** A mutable JSON-import document backed only by the caller filesystem. Apply
|
|
12
|
+
* updates sequentially and publish chunks only after all updates succeed.
|
|
13
|
+
* A failed update may have applied earlier objects; discard the owner on error. */
|
|
14
|
+
export declare class QpdfJsonDocument {
|
|
15
|
+
private readonly storage;
|
|
16
|
+
rootRef: PdfCosRef | undefined;
|
|
17
|
+
infoRef: PdfCosRef | undefined;
|
|
18
|
+
private readonly store;
|
|
19
|
+
private readonly backing;
|
|
20
|
+
private readonly positions;
|
|
21
|
+
private readonly order;
|
|
22
|
+
private readonly catalogs;
|
|
23
|
+
private ordinal;
|
|
24
|
+
private readonly controller;
|
|
25
|
+
private readonly signal;
|
|
26
|
+
private pending;
|
|
27
|
+
private closing;
|
|
28
|
+
constructor(storage: PdfIndexStorage, options?: {
|
|
29
|
+
signal?: AbortSignal;
|
|
30
|
+
});
|
|
31
|
+
private remember;
|
|
32
|
+
static fromDocument(document: PdfRetainedDocument, source: PdfFileSource, storage: PdfIndexStorage, options?: {
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
}): Promise<QpdfJsonDocument>;
|
|
35
|
+
apply(input: AsyncIterable<Uint8Array> | Iterable<Uint8Array>, options?: ApplyQpdfJsonOptions): Promise<void>;
|
|
36
|
+
private update;
|
|
37
|
+
chunks(options?: {
|
|
38
|
+
maxOutputBytes?: number;
|
|
39
|
+
chunkBytes?: number;
|
|
40
|
+
}): AsyncGenerator<Uint8Array>;
|
|
41
|
+
close(): Promise<void>;
|
|
42
|
+
}
|
|
@@ -10,6 +10,7 @@ export declare class QpdfJsonValues {
|
|
|
10
10
|
private readonly scratch;
|
|
11
11
|
private readonly first;
|
|
12
12
|
private readonly next;
|
|
13
|
+
private sourceOrder;
|
|
13
14
|
private closed;
|
|
14
15
|
private work;
|
|
15
16
|
private constructor();
|
|
@@ -26,6 +27,12 @@ export declare class QpdfJsonValues {
|
|
|
26
27
|
/** Match the legacy reference grammar without collecting long zero padding. */
|
|
27
28
|
reference(position: number): Promise<PdfCosRef | undefined>;
|
|
28
29
|
private scalar;
|
|
30
|
+
validate(root: number): Promise<void>;
|
|
31
|
+
/** Look up a converted PDF dictionary name, after prefix decoding/collisions. */
|
|
32
|
+
property(root: number, name: string): Promise<number | undefined>;
|
|
33
|
+
private keyEquals;
|
|
34
|
+
/** Stream an imported stream dictionary with legacy filter/length handling. */
|
|
35
|
+
streamDictionary(root: number | undefined, length: number): AsyncGenerator<Uint8Array>;
|
|
29
36
|
chunks(root: number): AsyncGenerator<Uint8Array>;
|
|
30
37
|
close(): Promise<void>;
|
|
31
38
|
}
|
package/dist/pdf-ast/index.d.ts
CHANGED
|
@@ -75,3 +75,4 @@ export { retainedObjectOrder } from "./cos/retained-object-order.js";
|
|
|
75
75
|
export { encryptRetainedPdfChunks } from "./cos/retained-encryption.js";
|
|
76
76
|
export { replaceRetainedPdfName } from "./edit/retained-name-replacement.js";
|
|
77
77
|
export { QpdfJsonValues } from "./cos/qpdf-json-values.js";
|
|
78
|
+
export { QpdfJsonDocument, type ApplyQpdfJsonOptions } from "./cos/qpdf-json-document.js";
|