agdi 3.3.6 → 3.3.7

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 (36) hide show
  1. package/README.md +13 -0
  2. package/dist/APEv2Parser-EU45AV6X.js +14 -0
  3. package/dist/AiffParser-FOX7GQ42.js +189 -0
  4. package/dist/AsfParser-HD5CSGIO.js +610 -0
  5. package/dist/DsdiffParser-OJREDMBI.js +188 -0
  6. package/dist/DsfParser-2YL4ARJ7.js +110 -0
  7. package/dist/FlacParser-IVV4RYF6.js +15 -0
  8. package/dist/MP4Parser-NLX4A2YN.js +1140 -0
  9. package/dist/MatroskaParser-4OEK43GF.js +654 -0
  10. package/dist/MpegParser-PXKEUF2B.js +642 -0
  11. package/dist/MusepackParser-54QGYRLY.js +322 -0
  12. package/dist/OggParser-KRV5QCGZ.js +435 -0
  13. package/dist/WavPackParser-XPZSQFVS.js +203 -0
  14. package/dist/WaveParser-27IS2RAI.js +294 -0
  15. package/dist/chunk-2B4QMSZW.js +311 -0
  16. package/dist/chunk-3JKZUGPJ.js +70 -0
  17. package/dist/chunk-4VNS5WPM.js +42 -0
  18. package/dist/chunk-65JVFJ3X.js +729 -0
  19. package/dist/chunk-6OKLAJRQ.js +0 -0
  20. package/dist/chunk-AGSFUVRG.js +439 -0
  21. package/dist/chunk-GD35BJSH.js +177 -0
  22. package/dist/chunk-HNLU36CC.js +702 -0
  23. package/dist/{chunk-M2FF7ETI.js → chunk-J6OLLWVT.js} +1 -1
  24. package/dist/chunk-LREP5CZP.js +146 -0
  25. package/dist/chunk-M54HVABG.js +34 -0
  26. package/dist/{chunk-S45VXJEO.js → chunk-OPFFFAQC.js} +19 -1
  27. package/dist/chunk-VGOIHW7D.js +1529 -0
  28. package/dist/chunk-YIHDW7JC.js +314 -0
  29. package/dist/config-D3QBUN2Y.js +13 -0
  30. package/dist/{config-ZFU7TSU2.js → config-K2XM6D4Z.js} +3 -2
  31. package/dist/{event-bus-Q3WCETQQ.js → event-bus-MO5SFUME.js} +1 -0
  32. package/dist/index.js +3251 -1199
  33. package/dist/lib-2XISBYT3.js +144950 -0
  34. package/dist/lib-HCGLI2GJ.js +4161 -0
  35. package/dist/{telemetry-service-OHU5NKON.js → telemetry-service-76YPOPDM.js} +8 -4
  36. package/package.json +5 -2
package/README.md CHANGED
@@ -114,6 +114,19 @@ Enable telemetry to help us debug crashes (fully anonymous):
114
114
  agdi config telemetry --enable
115
115
  ```
116
116
 
117
+ ### Semantic Search (Optional)
118
+ Agdi can optionally enable local semantic embeddings for smarter context retrieval.
119
+
120
+ Enable via environment variable:
121
+ ```bash
122
+ AGDI_SEMANTIC_SEARCH=1 agdi
123
+ ```
124
+
125
+ Or enable permanently in `~/.agdi/config.json`:
126
+ ```json
127
+ { "semanticSearchEnabled": true }
128
+ ```
129
+
117
130
  ---
118
131
 
119
132
  ## 🛡️ Security
@@ -0,0 +1,14 @@
1
+ import {
2
+ APEv2Parser,
3
+ ApeContentError,
4
+ tryParseApeHeader
5
+ } from "./chunk-YIHDW7JC.js";
6
+ import "./chunk-HNLU36CC.js";
7
+ import "./chunk-GD35BJSH.js";
8
+ import "./chunk-VGOIHW7D.js";
9
+ import "./chunk-4VNS5WPM.js";
10
+ export {
11
+ APEv2Parser,
12
+ ApeContentError,
13
+ tryParseApeHeader
14
+ };
@@ -0,0 +1,189 @@
1
+ import {
2
+ ID3v2Parser
3
+ } from "./chunk-65JVFJ3X.js";
4
+ import "./chunk-2B4QMSZW.js";
5
+ import {
6
+ FourCcToken
7
+ } from "./chunk-YIHDW7JC.js";
8
+ import {
9
+ EndOfStreamError,
10
+ fromBuffer
11
+ } from "./chunk-HNLU36CC.js";
12
+ import "./chunk-LREP5CZP.js";
13
+ import "./chunk-GD35BJSH.js";
14
+ import {
15
+ BasicParser,
16
+ StringType,
17
+ UINT16_BE,
18
+ UINT32_BE,
19
+ UINT8,
20
+ Uint8ArrayType,
21
+ makeUnexpectedFileContentError,
22
+ require_src
23
+ } from "./chunk-VGOIHW7D.js";
24
+ import {
25
+ __toESM
26
+ } from "./chunk-4VNS5WPM.js";
27
+
28
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/aiff/AiffParser.js
29
+ var import_debug = __toESM(require_src(), 1);
30
+
31
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/aiff/AiffToken.js
32
+ var compressionTypes = {
33
+ NONE: "not compressed PCM Apple Computer",
34
+ sowt: "PCM (byte swapped)",
35
+ fl32: "32-bit floating point IEEE 32-bit float",
36
+ fl64: "64-bit floating point IEEE 64-bit float Apple Computer",
37
+ alaw: "ALaw 2:1 8-bit ITU-T G.711 A-law",
38
+ ulaw: "\xB5Law 2:1 8-bit ITU-T G.711 \xB5-law Apple Computer",
39
+ ULAW: "CCITT G.711 u-law 8-bit ITU-T G.711 \xB5-law",
40
+ ALAW: "CCITT G.711 A-law 8-bit ITU-T G.711 A-law",
41
+ FL32: "Float 32 IEEE 32-bit float "
42
+ };
43
+ var AiffContentError = class extends makeUnexpectedFileContentError("AIFF") {
44
+ };
45
+ var Common = class {
46
+ constructor(header, isAifc) {
47
+ this.isAifc = isAifc;
48
+ const minimumChunkSize = isAifc ? 22 : 18;
49
+ if (header.chunkSize < minimumChunkSize)
50
+ throw new AiffContentError(`COMMON CHUNK size should always be at least ${minimumChunkSize}`);
51
+ this.len = header.chunkSize;
52
+ }
53
+ get(buf, off) {
54
+ const shift = UINT16_BE.get(buf, off + 8) - 16398;
55
+ const baseSampleRate = UINT16_BE.get(buf, off + 8 + 2);
56
+ const res = {
57
+ numChannels: UINT16_BE.get(buf, off),
58
+ numSampleFrames: UINT32_BE.get(buf, off + 2),
59
+ sampleSize: UINT16_BE.get(buf, off + 6),
60
+ sampleRate: shift < 0 ? baseSampleRate >> Math.abs(shift) : baseSampleRate << shift
61
+ };
62
+ if (this.isAifc) {
63
+ res.compressionType = FourCcToken.get(buf, off + 18);
64
+ if (this.len > 22) {
65
+ const strLen = UINT8.get(buf, off + 22);
66
+ if (strLen > 0) {
67
+ const padding = (strLen + 1) % 2;
68
+ if (23 + strLen + padding === this.len) {
69
+ res.compressionName = new StringType(strLen, "latin1").get(buf, off + 23);
70
+ } else {
71
+ throw new AiffContentError("Illegal pstring length");
72
+ }
73
+ } else {
74
+ res.compressionName = void 0;
75
+ }
76
+ }
77
+ } else {
78
+ res.compressionName = "PCM";
79
+ }
80
+ return res;
81
+ }
82
+ };
83
+
84
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/iff/index.js
85
+ var Header = {
86
+ len: 8,
87
+ get: (buf, off) => {
88
+ return {
89
+ // Chunk type ID
90
+ chunkID: FourCcToken.get(buf, off),
91
+ // Chunk size
92
+ chunkSize: Number(BigInt(UINT32_BE.get(buf, off + 4)))
93
+ };
94
+ }
95
+ };
96
+
97
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/aiff/AiffParser.js
98
+ var debug = (0, import_debug.default)("music-metadata:parser:aiff");
99
+ var AIFFParser = class extends BasicParser {
100
+ constructor() {
101
+ super(...arguments);
102
+ this.isCompressed = null;
103
+ }
104
+ async parse() {
105
+ const header = await this.tokenizer.readToken(Header);
106
+ if (header.chunkID !== "FORM")
107
+ throw new AiffContentError("Invalid Chunk-ID, expected 'FORM'");
108
+ const type = await this.tokenizer.readToken(FourCcToken);
109
+ switch (type) {
110
+ case "AIFF":
111
+ this.metadata.setFormat("container", type);
112
+ this.isCompressed = false;
113
+ break;
114
+ case "AIFC":
115
+ this.metadata.setFormat("container", "AIFF-C");
116
+ this.isCompressed = true;
117
+ break;
118
+ default:
119
+ throw new AiffContentError(`Unsupported AIFF type: ${type}`);
120
+ }
121
+ this.metadata.setFormat("lossless", !this.isCompressed);
122
+ this.metadata.setAudioOnly();
123
+ try {
124
+ while (!this.tokenizer.fileInfo.size || this.tokenizer.fileInfo.size - this.tokenizer.position >= Header.len) {
125
+ debug(`Reading AIFF chunk at offset=${this.tokenizer.position}`);
126
+ const chunkHeader = await this.tokenizer.readToken(Header);
127
+ const nextChunk = 2 * Math.round(chunkHeader.chunkSize / 2);
128
+ const bytesRead = await this.readData(chunkHeader);
129
+ await this.tokenizer.ignore(nextChunk - bytesRead);
130
+ }
131
+ } catch (err) {
132
+ if (err instanceof EndOfStreamError) {
133
+ debug("End-of-stream");
134
+ } else {
135
+ throw err;
136
+ }
137
+ }
138
+ }
139
+ async readData(header) {
140
+ switch (header.chunkID) {
141
+ case "COMM": {
142
+ if (this.isCompressed === null) {
143
+ throw new AiffContentError("Failed to parse AIFF.COMM chunk when compression type is unknown");
144
+ }
145
+ const common = await this.tokenizer.readToken(new Common(header, this.isCompressed));
146
+ this.metadata.setFormat("bitsPerSample", common.sampleSize);
147
+ this.metadata.setFormat("sampleRate", common.sampleRate);
148
+ this.metadata.setFormat("numberOfChannels", common.numChannels);
149
+ this.metadata.setFormat("numberOfSamples", common.numSampleFrames);
150
+ this.metadata.setFormat("duration", common.numSampleFrames / common.sampleRate);
151
+ if (common.compressionName || common.compressionType) {
152
+ this.metadata.setFormat("codec", common.compressionName ?? compressionTypes[common.compressionType]);
153
+ }
154
+ return header.chunkSize;
155
+ }
156
+ case "ID3 ": {
157
+ const id3_data = await this.tokenizer.readToken(new Uint8ArrayType(header.chunkSize));
158
+ const rst = fromBuffer(id3_data);
159
+ await new ID3v2Parser().parse(this.metadata, rst, this.options);
160
+ return header.chunkSize;
161
+ }
162
+ case "SSND":
163
+ if (this.metadata.format.duration) {
164
+ this.metadata.setFormat("bitrate", 8 * header.chunkSize / this.metadata.format.duration);
165
+ }
166
+ return 0;
167
+ case "NAME":
168
+ // Sample name chunk
169
+ case "AUTH":
170
+ // Author chunk
171
+ case "(c) ":
172
+ // Copyright chunk
173
+ case "ANNO":
174
+ return this.readTextChunk(header);
175
+ default:
176
+ debug(`Ignore chunk id=${header.chunkID}, size=${header.chunkSize}`);
177
+ return 0;
178
+ }
179
+ }
180
+ async readTextChunk(header) {
181
+ const value = await this.tokenizer.readToken(new StringType(header.chunkSize, "ascii"));
182
+ const values = value.split("\0").map((v) => v.trim()).filter((v) => v?.length);
183
+ await Promise.all(values.map((v) => this.metadata.addTag("AIFF", header.chunkID, v)));
184
+ return header.chunkSize;
185
+ }
186
+ };
187
+ export {
188
+ AIFFParser
189
+ };