taglib-wasm 2.2.3 → 2.3.0

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 (60) hide show
  1. package/README.md +192 -13
  2. package/dist/index.browser.d.ts +24 -4
  3. package/dist/index.browser.d.ts.map +1 -1
  4. package/dist/index.browser.js +1123 -208
  5. package/dist/index.d.ts +2 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +2 -0
  8. package/dist/simple.browser.js +527 -202
  9. package/dist/src/errors/base.d.ts +17 -2
  10. package/dist/src/errors/base.d.ts.map +1 -1
  11. package/dist/src/errors/base.js +18 -0
  12. package/dist/src/runtime/wasi-adapter/adapter.d.ts +13 -1
  13. package/dist/src/runtime/wasi-adapter/adapter.d.ts.map +1 -1
  14. package/dist/src/runtime/wasi-adapter/adapter.js +17 -0
  15. package/dist/src/runtime/wasi-adapter/audio-properties.d.ts +4 -1
  16. package/dist/src/runtime/wasi-adapter/audio-properties.d.ts.map +1 -1
  17. package/dist/src/runtime/wasi-adapter/audio-properties.js +23 -6
  18. package/dist/src/runtime/wasi-adapter/path-open.d.ts +68 -0
  19. package/dist/src/runtime/wasi-adapter/path-open.d.ts.map +1 -0
  20. package/dist/src/runtime/wasi-adapter/path-open.js +76 -0
  21. package/dist/src/runtime/wasi-adapter/wasm-io.d.ts.map +1 -1
  22. package/dist/src/runtime/wasi-adapter/wasm-io.js +36 -28
  23. package/dist/src/runtime/wasi-host-loader.js +8 -3
  24. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts +13 -0
  25. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts.map +1 -1
  26. package/dist/src/simple/checksum-operations.d.ts +25 -0
  27. package/dist/src/simple/checksum-operations.d.ts.map +1 -0
  28. package/dist/src/simple/checksum-operations.js +7 -0
  29. package/dist/src/simple/index.d.ts +2 -0
  30. package/dist/src/simple/index.d.ts.map +1 -1
  31. package/dist/src/simple/index.js +2 -0
  32. package/dist/src/taglib/audio-file-checksum.d.ts +47 -0
  33. package/dist/src/taglib/audio-file-checksum.d.ts.map +1 -0
  34. package/dist/src/taglib/audio-file-checksum.js +77 -0
  35. package/dist/src/taglib/audio-file-impl.d.ts +4 -0
  36. package/dist/src/taglib/audio-file-impl.d.ts.map +1 -1
  37. package/dist/src/taglib/audio-file-impl.js +32 -0
  38. package/dist/src/taglib/audio-file-interface.d.ts +17 -0
  39. package/dist/src/taglib/audio-file-interface.d.ts.map +1 -1
  40. package/dist/src/taglib/media-ranges.d.ts +85 -0
  41. package/dist/src/taglib/media-ranges.d.ts.map +1 -0
  42. package/dist/src/taglib/media-ranges.js +192 -0
  43. package/dist/src/taglib/metadata-extent.d.ts +55 -0
  44. package/dist/src/taglib/metadata-extent.d.ts.map +1 -1
  45. package/dist/src/taglib/metadata-extent.js +24 -6
  46. package/dist/src/taglib/taglib-class.d.ts.map +1 -1
  47. package/dist/src/taglib/taglib-class.js +13 -24
  48. package/dist/src/utils/path.d.ts +12 -0
  49. package/dist/src/utils/path.d.ts.map +1 -1
  50. package/dist/src/utils/path.js +19 -0
  51. package/dist/src/version.d.ts +1 -1
  52. package/dist/src/version.js +1 -1
  53. package/dist/src/wasm.d.ts +9 -0
  54. package/dist/src/wasm.d.ts.map +1 -1
  55. package/dist/taglib-wasi.wasm +0 -0
  56. package/dist/taglib-web.wasm +0 -0
  57. package/dist/web.browser.d.ts +13 -0
  58. package/dist/web.browser.d.ts.map +1 -0
  59. package/dist/web.browser.js +3630 -0
  60. package/package.json +12 -4
@@ -9,7 +9,7 @@ function startsWith(bytes, magic, at = 0) {
9
9
  return true;
10
10
  }
11
11
  function id3v2End(bytes) {
12
- if (bytes.length < 10) return void 0;
12
+ if (!startsWith(bytes, "ID3") || bytes.length < 10) return void 0;
13
13
  const size = bytes[6] << 21 | bytes[7] << 14 | bytes[8] << 7 | bytes[9];
14
14
  const hasFooter = (bytes[5] & 16) !== 0;
15
15
  return 10 + size + (hasFooter ? 10 : 0);
@@ -25,6 +25,16 @@ function flacEnd(bytes, limit, start) {
25
25
  if (isLast) return offset;
26
26
  }
27
27
  }
28
+ function flacMarkerOffset(bytes) {
29
+ const at = startsWith(bytes, "ID3") ? id3v2End(bytes) : 0;
30
+ if (at === void 0) return void 0;
31
+ return startsWith(bytes, "fLaC", at) ? at : void 0;
32
+ }
33
+ function flacAudioStart(bytes) {
34
+ const at = flacMarkerOffset(bytes);
35
+ if (at === void 0) return void 0;
36
+ return flacEnd(bytes, bytes.length, at);
37
+ }
28
38
  function mp4MoovEnd(bytes, limit, start) {
29
39
  let offset = start;
30
40
  const readable = Math.min(bytes.length, limit);
@@ -97,16 +107,16 @@ const MPEG_SAMPLE_RATES = [
97
107
  [11025, 12e3, 8e3]
98
108
  // MPEG-2.5
99
109
  ];
100
- function isMpegFrameSync(bytes, at = 0) {
101
- if (bytes.length < at + 4) return false;
102
- if (bytes[at] !== 255 || (bytes[at + 1] & 224) !== 224) return false;
110
+ function mpegFrameLength(bytes, at) {
111
+ if (bytes.length < at + 4) return 0;
112
+ if (bytes[at] !== 255 || (bytes[at + 1] & 224) !== 224) return 0;
103
113
  const version = bytes[at + 1] >> 3 & 3;
104
114
  const layer = bytes[at + 1] >> 1 & 3;
105
- if (version === 1 || layer === 0) return false;
115
+ if (version === 1 || layer === 0) return 0;
106
116
  const bitrateIndex = bytes[at + 2] >> 4 & 15;
107
117
  const sampleRateIndex = bytes[at + 2] >> 2 & 3;
108
118
  if (bitrateIndex === 0 || bitrateIndex === 15 || sampleRateIndex === 3) {
109
- return false;
119
+ return 0;
110
120
  }
111
121
  const mpeg1 = version === 3;
112
122
  const layerIndex = layer ^ 3;
@@ -116,6 +126,10 @@ function isMpegFrameSync(bytes, at = 0) {
116
126
  const samplesPerFrame = layerIndex === 2 ? mpeg1 ? 1152 : 576 : layerIndex === 1 ? 1152 : 384;
117
127
  let frameLength = Math.floor(samplesPerFrame * bitrate * 125 / sampleRate);
118
128
  if ((bytes[at + 2] & 2) !== 0) frameLength += layerIndex === 0 ? 4 : 1;
129
+ return frameLength === 0 ? 0 : frameLength;
130
+ }
131
+ function isMpegFrameSync(bytes, at = 0) {
132
+ const frameLength = mpegFrameLength(bytes, at);
119
133
  if (frameLength === 0) return false;
120
134
  const next = at + frameLength;
121
135
  if (bytes.length < next + 4) return false;
@@ -166,6 +180,10 @@ function trailerFitsInFooter(tail, footerSize) {
166
180
  return true;
167
181
  }
168
182
  export {
183
+ flacAudioStart,
184
+ flacMarkerOffset,
185
+ id3v2End,
169
186
  metadataFitsInHeader,
187
+ mpegFrameLength,
170
188
  trailerFitsInFooter
171
189
  };
@@ -1 +1 @@
1
- {"version":3,"file":"taglib-class.d.ts","sourceRoot":"","sources":["../../../src/taglib/taglib-class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgC,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AA4C3D;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAE1B,MAAM,EAAE,UAAU;IAI9B;;;;;OAKG;WACU,UAAU,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAMrE;;;;;;;OAOG;IACG,IAAI,CACR,KAAK,EAAE,cAAc,EACrB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,CAAC;IAmGrB;;;;;;;;;OASG;IACG,IAAI,CACR,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC5C,O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AAM,CAAC;IAMrE;;;;;;;OAOG;IACG,IAAI,CACR,KAAK,EAAE,cAAc,EACrB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,CAAC;IA0FrB;;;;;;;;;OASG;IACG,IAAI,CACR,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC5C,OAAO,CAAC,IAAI,CAAC;IACV,IAAI,CACR,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,eAAe,EACxD,EAAE,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC5C,OAAO,CAAC,UAAU,CAAC;IAmBtB;;;;;;OAMG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAUtE;;;;;;;OAOG;IACG,YAAY,CAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,IAAI,CAAC;IAUhB,oEAAoE;IACpE,OAAO,IAAI,MAAM;IAIjB,OAAO,CAAC,aAAa;CAStB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtE"}
@@ -69,30 +69,19 @@ class TagLib {
69
69
  const actualInput = isNamedAudioInput(input) ? input.data : input;
70
70
  const sourcePath = typeof actualInput === "string" ? actualInput : void 0;
71
71
  if (typeof actualInput === "string" && this.module.isWasi) {
72
- const fileHandle2 = this.module.createFileHandle();
73
- try {
74
- const fh = fileHandle2;
75
- if (fh.loadFromPath) {
76
- const wasiPath = toWasiPath(actualInput);
77
- const success = fh.loadFromPath(wasiPath);
78
- if (!success) {
79
- throw new InvalidFormatError(
80
- `Failed to load audio file. Path: ${actualInput}`
81
- );
82
- }
83
- return new AudioFileImpl(
84
- this.module,
85
- fileHandle2,
86
- sourcePath,
87
- actualInput,
88
- false
89
- );
90
- }
91
- } catch (error) {
92
- if (typeof fileHandle2.destroy === "function") {
93
- fileHandle2.destroy();
94
- }
95
- throw error;
72
+ const wasiPath = toWasiPath(actualInput);
73
+ if (this.module.loadAudioPath) {
74
+ const fileHandle2 = await this.module.loadAudioPath(
75
+ wasiPath,
76
+ actualInput
77
+ );
78
+ return new AudioFileImpl(
79
+ this.module,
80
+ fileHandle2,
81
+ sourcePath,
82
+ actualInput,
83
+ false
84
+ );
96
85
  }
97
86
  }
98
87
  const opts = {
@@ -11,4 +11,16 @@ export declare function fileUrlToPath(url: URL): string;
11
11
  export declare function basename(path: string): string;
12
12
  /** Join path segments with the OS-appropriate separator. */
13
13
  export declare function joinPath(...segments: string[]): string;
14
+ /**
15
+ * The host path behind a WASI path, given the preopen map the guest was started
16
+ * with (`WasiHostLoaderConfig.preopens`): the inverse of the virtual-path
17
+ * mapping the host resolves `path_open` through, and the only way host-side code
18
+ * can read the same file the guest reads. On Windows the map is the drive list
19
+ * (`{"/C": "C:\\"}`), so `/C/music/a.mp3` is `C:\music\a.mp3`; on POSIX it is
20
+ * the identity (`{"/": "/"}`).
21
+ *
22
+ * Returns undefined for a path no preopen covers — the guest cannot open that
23
+ * path either, so there is nothing on the host side to read.
24
+ */
25
+ export declare function hostPathForPreopens(wasiPath: string, preopens: Record<string, string>): string | undefined;
14
26
  //# sourceMappingURL=path.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/utils/path.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAK9C;AAED,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED,4DAA4D;AAC5D,wBAAgB,QAAQ,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAKtD"}
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/utils/path.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAK9C;AAED,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED,4DAA4D;AAC5D,wBAAgB,QAAQ,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAKtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,MAAM,GAAG,SAAS,CAqBpB"}
@@ -10,8 +10,27 @@ function basename(path) {
10
10
  function joinPath(...segments) {
11
11
  return segments.filter(Boolean).join("/").replaceAll(/\/+/g, "/");
12
12
  }
13
+ function hostPathForPreopens(wasiPath, preopens) {
14
+ let best;
15
+ for (const [virtualPath, realPath] of Object.entries(preopens)) {
16
+ const prefix = virtualPath.replace(/\/+$/, "");
17
+ if (wasiPath === prefix) {
18
+ return realPath;
19
+ }
20
+ if (!wasiPath.startsWith(`${prefix}/`)) continue;
21
+ if (best && prefix.length <= best.prefixLength) continue;
22
+ best = {
23
+ realPath,
24
+ rest: wasiPath.slice(prefix.length + 1),
25
+ prefixLength: prefix.length
26
+ };
27
+ }
28
+ if (!best) return void 0;
29
+ return joinPath(best.realPath, best.rest);
30
+ }
13
31
  export {
14
32
  basename,
15
33
  fileUrlToPath,
34
+ hostPathForPreopens,
16
35
  joinPath
17
36
  };
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.2.3";
1
+ export declare const VERSION = "2.3.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
- const VERSION = "2.2.3";
1
+ const VERSION = "2.3.0";
2
2
  export {
3
3
  VERSION
4
4
  };
@@ -158,6 +158,15 @@ export interface TagLibModule extends Omit<EmscriptenModule, "then"> {
158
158
  getVersion?(): string;
159
159
  /** @internal WASI adapter: returns TagLib version (e.g. "2.2.1") */
160
160
  version?(): string;
161
+ /**
162
+ * @internal WASI path mode: load an audio file by path, refusing content the
163
+ * boundary opened only because its extension named a format. A path resolves
164
+ * by extension first and upstream's `MPEG::File` calls any bytes valid, so the
165
+ * open alone cannot say whether anything was there, where a buffer of the same
166
+ * bytes is refused (taglib-j9ld). Absent on Emscripten, which reads a path into
167
+ * memory and validates it as a buffer.
168
+ */
169
+ loadAudioPath?(wasiPath: string, displayPath: string): Promise<WasmFileHandle>;
161
170
  }
162
171
  export interface WasmModule extends EmscriptenModule {
163
172
  FileHandle?: new () => FileHandle;
@@ -1 +1 @@
1
- {"version":3,"file":"wasm.d.ts","sourceRoot":"","sources":["../../src/wasm.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,wDA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AC;IACjC,yEAAyE;IACzE,gBAAgB,IAAI,UAAU,CAAC;IAE/B,uEAAuE;IACvE,UAAU,CAAC,IAAI,MAAM,CAAC;IAEtB,oEAAoE;IACpE,OAAO,CAAC,IAAI,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,aAAa,CAAC,CACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAElD,UAAU,CAAC,EAAE,UAAU,UAAU,CAAC;IAClC,gBAAgB,CAAC,IAAI,UAAU,CAAC;CACjC"}
Binary file
Binary file
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Browser entry point for the `taglib-wasm/web` subpath.
3
+ *
4
+ * Same surface as `web.ts`; the difference is the graph it bundles. The
5
+ * esbuild redirect plugin swaps the unified loader for the Emscripten-only one
6
+ * and stubs the platform filesystem layer, so a browser build of this entry
7
+ * carries no WASI loader and references `taglib-web.wasm` alone
8
+ * (tests/browser-entry-surface.test.ts walks the graph to prove it).
9
+ *
10
+ * @module taglib-wasm/web/browser
11
+ */
12
+ export * from "./src/web-utils/index.js";
13
+ //# sourceMappingURL=web.browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.browser.d.ts","sourceRoot":"","sources":["../web.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,0BAA0B,CAAC"}