@agentdocumentformat/cli 0.7.2
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/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/adf.mjs +162 -0
- package/dist/chunks/APEv2Parser-2CNNHMXV.mjs +22 -0
- package/dist/chunks/AiffParser-7BR4RL6G.mjs +162 -0
- package/dist/chunks/App-L5L37JI5.mjs +16747 -0
- package/dist/chunks/AsfParser-VVRSLFOM.mjs +538 -0
- package/dist/chunks/DsdiffParser-CMD4AX7A.mjs +156 -0
- package/dist/chunks/DsfParser-UOGZDS2M.mjs +94 -0
- package/dist/chunks/FlacParser-HB3T3CD4.mjs +23 -0
- package/dist/chunks/MP4Parser-66HBRUSX.mjs +973 -0
- package/dist/chunks/MatroskaParser-J3HUIMEW.mjs +579 -0
- package/dist/chunks/MpegParser-YW6LIUEW.mjs +442 -0
- package/dist/chunks/MusepackParser-PAUSXP7D.mjs +252 -0
- package/dist/chunks/OggParser-NUBV3GWC.mjs +359 -0
- package/dist/chunks/WavPackParser-WQAGT7TC.mjs +171 -0
- package/dist/chunks/WaveParser-EWLQVDX4.mjs +238 -0
- package/dist/chunks/adf-schema-JRU2BTOG.mjs +62 -0
- package/dist/chunks/build-QF5W473T.mjs +60 -0
- package/dist/chunks/chatgpt-subscription-BQGWYZXE.mjs +23 -0
- package/dist/chunks/chunk-2DIECGFL.mjs +6 -0
- package/dist/chunks/chunk-2NAP2ZF7.mjs +60 -0
- package/dist/chunks/chunk-3AT7IIP7.mjs +25696 -0
- package/dist/chunks/chunk-3GNIDM53.mjs +35 -0
- package/dist/chunks/chunk-3M4ZPOA3.mjs +1477 -0
- package/dist/chunks/chunk-4MQPTCXY.mjs +510 -0
- package/dist/chunks/chunk-5PO5PKRV.mjs +366 -0
- package/dist/chunks/chunk-5QU5VY7N.mjs +52 -0
- package/dist/chunks/chunk-5W7KES6P.mjs +436 -0
- package/dist/chunks/chunk-62NE4LG4.mjs +61 -0
- package/dist/chunks/chunk-64OKE4X3.mjs +45 -0
- package/dist/chunks/chunk-6GJ4QHRI.mjs +1278 -0
- package/dist/chunks/chunk-6VQEXLE2.mjs +144 -0
- package/dist/chunks/chunk-6XUV6EK6.mjs +41 -0
- package/dist/chunks/chunk-776TSXEP.mjs +43 -0
- package/dist/chunks/chunk-7CV2SA3H.mjs +285 -0
- package/dist/chunks/chunk-7MTRVW2U.mjs +3103 -0
- package/dist/chunks/chunk-7N2R2VCG.mjs +1434 -0
- package/dist/chunks/chunk-7T2YMTWL.mjs +374 -0
- package/dist/chunks/chunk-7XYNI52E.mjs +149 -0
- package/dist/chunks/chunk-APHX6HSV.mjs +7731 -0
- package/dist/chunks/chunk-APRU6PHC.mjs +40 -0
- package/dist/chunks/chunk-AUYKRQPJ.mjs +499 -0
- package/dist/chunks/chunk-DXWDD5XJ.mjs +136 -0
- package/dist/chunks/chunk-EWL5FG4I.mjs +39 -0
- package/dist/chunks/chunk-EYX2YLJW.mjs +117 -0
- package/dist/chunks/chunk-F5ELW46V.mjs +27 -0
- package/dist/chunks/chunk-G426FACA.mjs +49 -0
- package/dist/chunks/chunk-GEKSJHIV.mjs +2472 -0
- package/dist/chunks/chunk-HBUENVQL.mjs +570 -0
- package/dist/chunks/chunk-HPVFJYXR.mjs +112 -0
- package/dist/chunks/chunk-HWLWPXQ7.mjs +721 -0
- package/dist/chunks/chunk-I2HJYHFT.mjs +665 -0
- package/dist/chunks/chunk-I3UYSITV.mjs +68 -0
- package/dist/chunks/chunk-IC4JDZCI.mjs +3864 -0
- package/dist/chunks/chunk-IHDDCZBS.mjs +112 -0
- package/dist/chunks/chunk-IIGMZHQQ.mjs +10416 -0
- package/dist/chunks/chunk-KWFOS5WC.mjs +41 -0
- package/dist/chunks/chunk-LAZIXV2F.mjs +5290 -0
- package/dist/chunks/chunk-LFMB4PAA.mjs +10814 -0
- package/dist/chunks/chunk-M2RX3S2T.mjs +49 -0
- package/dist/chunks/chunk-M3WPIJYM.mjs +65 -0
- package/dist/chunks/chunk-NBTUWMGP.mjs +263 -0
- package/dist/chunks/chunk-NGK6PVSF.mjs +2676 -0
- package/dist/chunks/chunk-NZ7JTHEO.mjs +85 -0
- package/dist/chunks/chunk-OQN33RGQ.mjs +52 -0
- package/dist/chunks/chunk-RIX34QHC.mjs +2935 -0
- package/dist/chunks/chunk-SGUTYISF.mjs +16 -0
- package/dist/chunks/chunk-SLJ5L7PY.mjs +1473 -0
- package/dist/chunks/chunk-SLUKGXKH.mjs +68 -0
- package/dist/chunks/chunk-TMT32MXT.mjs +419 -0
- package/dist/chunks/chunk-UYY5M2PB.mjs +151 -0
- package/dist/chunks/chunk-VAUOM3IN.mjs +298 -0
- package/dist/chunks/chunk-VMHTYDH4.mjs +172 -0
- package/dist/chunks/chunk-VZS54AA5.mjs +200 -0
- package/dist/chunks/chunk-WFQUVXML.mjs +295 -0
- package/dist/chunks/chunk-X34PDRUH.mjs +809 -0
- package/dist/chunks/chunk-XNPZBLYL.mjs +33 -0
- package/dist/chunks/chunk-XX7OSWTO.mjs +157 -0
- package/dist/chunks/chunk-XYTWGHFS.mjs +600 -0
- package/dist/chunks/chunk-XYV3VCIX.mjs +336 -0
- package/dist/chunks/chunk-Y5ZLKFLE.mjs +1469 -0
- package/dist/chunks/chunk-ZJKXHM4Q.mjs +230 -0
- package/dist/chunks/cli-TCMBNZF6.mjs +1030 -0
- package/dist/chunks/commands-DTEKM4ZL.mjs +20 -0
- package/dist/chunks/daemon-ZC3FZ2P4.mjs +112449 -0
- package/dist/chunks/daemon-control-WDX7PMTC.mjs +300 -0
- package/dist/chunks/daemon-token-WRSULP7G.mjs +23 -0
- package/dist/chunks/devtools-H7CI2ZVG.mjs +85 -0
- package/dist/chunks/discord-IWDQJA7A.mjs +70588 -0
- package/dist/chunks/dist-C57KYFS2.mjs +4952 -0
- package/dist/chunks/dist-I3XBAGDL.mjs +11 -0
- package/dist/chunks/email-V4Q4VJON.mjs +58679 -0
- package/dist/chunks/environment-NX277MQG.mjs +15 -0
- package/dist/chunks/grok-subscription-4PYX7TBF.mjs +19 -0
- package/dist/chunks/layout-EPJQNFAI.mjs +22 -0
- package/dist/chunks/lib-N7FCZWKH.mjs +4038 -0
- package/dist/chunks/open-OTQDGDH5.mjs +36 -0
- package/dist/chunks/parser-JVY2PWSM.mjs +19 -0
- package/dist/chunks/pipeline-executor-BHBSJX2K.mjs +19 -0
- package/dist/chunks/react-IUIDQ5LX.mjs +11 -0
- package/dist/chunks/screen-54BUTYCW.mjs +27 -0
- package/dist/chunks/slack-3L5QTDZX.mjs +8113 -0
- package/dist/chunks/store-WR7TZJZS.mjs +32 -0
- package/dist/chunks/telegram-5ISVFBV3.mjs +14918 -0
- package/dist/chunks/terminal-O5WO7C5U.mjs +48 -0
- package/dist/chunks/theme-NORU4J74.mjs +20 -0
- package/dist/chunks/themes-F2FKU7CP.mjs +23 -0
- package/dist/chunks/token-6G3HCMNX.mjs +54 -0
- package/dist/chunks/token-util-UXYSDQIW.mjs +12 -0
- package/dist/chunks/tui-ODVYUIMT.mjs +197 -0
- package/dist/chunks/welcome-XHXFV7SH.mjs +32 -0
- package/dist/chunks/whatsapp-XSAMNGPJ.mjs +85412 -0
- package/dist/chunks/xterm-headless-YF53XWXE.mjs +3353 -0
- package/package.json +53 -0
- package/resources/wasm/coreutils.LICENSE +18 -0
- package/resources/wasm/coreutils.wasm +0 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
import { createRequire as __adfCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __adfFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __adfDirname } from 'node:path';
|
|
4
|
+
const require = __adfCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __adfFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __adfDirname(__filename);
|
|
7
|
+
|
|
8
|
+
// node_modules/strtok3/lib/stream/Errors.js
|
|
9
|
+
var defaultMessages = "End-Of-Stream", EndOfStreamError = class extends Error {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(defaultMessages), this.name = "EndOfStreamError";
|
|
12
|
+
}
|
|
13
|
+
}, AbortError = class extends Error {
|
|
14
|
+
constructor(message = "The operation was aborted") {
|
|
15
|
+
super(message), this.name = "AbortError";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// node_modules/strtok3/lib/stream/Deferred.js
|
|
20
|
+
var Deferred = class {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.resolve = () => null, this.reject = () => null, this.promise = new Promise((resolve, reject) => {
|
|
23
|
+
this.reject = reject, this.resolve = resolve;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// node_modules/strtok3/lib/stream/AbstractStreamReader.js
|
|
29
|
+
var AbstractStreamReader = class {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.endOfStream = !1, this.interrupted = !1, this.peekQueue = [];
|
|
32
|
+
}
|
|
33
|
+
async peek(uint8Array, mayBeLess = !1) {
|
|
34
|
+
let bytesRead = await this.read(uint8Array, mayBeLess);
|
|
35
|
+
return this.peekQueue.push(uint8Array.subarray(0, bytesRead)), bytesRead;
|
|
36
|
+
}
|
|
37
|
+
async read(buffer, mayBeLess = !1) {
|
|
38
|
+
if (buffer.length === 0)
|
|
39
|
+
return 0;
|
|
40
|
+
let bytesRead = this.readFromPeekBuffer(buffer);
|
|
41
|
+
if (this.endOfStream || (bytesRead += await this.readRemainderFromStream(buffer.subarray(bytesRead), mayBeLess)), bytesRead === 0 && !mayBeLess)
|
|
42
|
+
throw new EndOfStreamError();
|
|
43
|
+
return bytesRead;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Read chunk from stream
|
|
47
|
+
* @param buffer - Target Uint8Array (or Buffer) to store data read from stream in
|
|
48
|
+
* @returns Number of bytes read
|
|
49
|
+
*/
|
|
50
|
+
readFromPeekBuffer(buffer) {
|
|
51
|
+
let remaining = buffer.length, bytesRead = 0;
|
|
52
|
+
for (; this.peekQueue.length > 0 && remaining > 0; ) {
|
|
53
|
+
let peekData = this.peekQueue.pop();
|
|
54
|
+
if (!peekData)
|
|
55
|
+
throw new Error("peekData should be defined");
|
|
56
|
+
let lenCopy = Math.min(peekData.length, remaining);
|
|
57
|
+
buffer.set(peekData.subarray(0, lenCopy), bytesRead), bytesRead += lenCopy, remaining -= lenCopy, lenCopy < peekData.length && this.peekQueue.push(peekData.subarray(lenCopy));
|
|
58
|
+
}
|
|
59
|
+
return bytesRead;
|
|
60
|
+
}
|
|
61
|
+
async readRemainderFromStream(buffer, mayBeLess) {
|
|
62
|
+
let bytesRead = 0;
|
|
63
|
+
for (; bytesRead < buffer.length && !this.endOfStream; ) {
|
|
64
|
+
if (this.interrupted)
|
|
65
|
+
throw new AbortError();
|
|
66
|
+
let chunkLen = await this.readFromStream(buffer.subarray(bytesRead), mayBeLess);
|
|
67
|
+
if (chunkLen === 0)
|
|
68
|
+
break;
|
|
69
|
+
bytesRead += chunkLen;
|
|
70
|
+
}
|
|
71
|
+
if (!mayBeLess && bytesRead < buffer.length)
|
|
72
|
+
throw new EndOfStreamError();
|
|
73
|
+
return bytesRead;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// node_modules/strtok3/lib/stream/StreamReader.js
|
|
78
|
+
var StreamReader = class extends AbstractStreamReader {
|
|
79
|
+
constructor(s) {
|
|
80
|
+
if (super(), this.s = s, this.deferred = null, !s.read || !s.once)
|
|
81
|
+
throw new Error("Expected an instance of stream.Readable");
|
|
82
|
+
this.s.once("end", () => {
|
|
83
|
+
this.endOfStream = !0, this.deferred && this.deferred.resolve(0);
|
|
84
|
+
}), this.s.once("error", (err) => this.reject(err)), this.s.once("close", () => this.abort());
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Read chunk from stream
|
|
88
|
+
* @param buffer Target Uint8Array (or Buffer) to store data read from stream in
|
|
89
|
+
* @param mayBeLess - If true, may fill the buffer partially
|
|
90
|
+
* @returns Number of bytes read
|
|
91
|
+
*/
|
|
92
|
+
async readFromStream(buffer, mayBeLess) {
|
|
93
|
+
if (buffer.length === 0)
|
|
94
|
+
return 0;
|
|
95
|
+
let readBuffer = this.s.read(buffer.length);
|
|
96
|
+
if (readBuffer)
|
|
97
|
+
return buffer.set(readBuffer), readBuffer.length;
|
|
98
|
+
let request = {
|
|
99
|
+
buffer,
|
|
100
|
+
mayBeLess,
|
|
101
|
+
deferred: new Deferred()
|
|
102
|
+
};
|
|
103
|
+
return this.deferred = request.deferred, this.s.once("readable", () => {
|
|
104
|
+
this.readDeferred(request);
|
|
105
|
+
}), request.deferred.promise;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Process deferred read request
|
|
109
|
+
* @param request Deferred read request
|
|
110
|
+
*/
|
|
111
|
+
readDeferred(request) {
|
|
112
|
+
let readBuffer = this.s.read(request.buffer.length);
|
|
113
|
+
readBuffer ? (request.buffer.set(readBuffer), request.deferred.resolve(readBuffer.length), this.deferred = null) : this.s.once("readable", () => {
|
|
114
|
+
this.readDeferred(request);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
reject(err) {
|
|
118
|
+
this.interrupted = !0, this.deferred && (this.deferred.reject(err), this.deferred = null);
|
|
119
|
+
}
|
|
120
|
+
async abort() {
|
|
121
|
+
this.reject(new AbortError());
|
|
122
|
+
}
|
|
123
|
+
async close() {
|
|
124
|
+
return this.abort();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// node_modules/strtok3/lib/stream/WebStreamReader.js
|
|
129
|
+
var WebStreamReader = class extends AbstractStreamReader {
|
|
130
|
+
constructor(reader) {
|
|
131
|
+
super(), this.reader = reader;
|
|
132
|
+
}
|
|
133
|
+
async abort() {
|
|
134
|
+
return this.close();
|
|
135
|
+
}
|
|
136
|
+
async close() {
|
|
137
|
+
this.reader.releaseLock();
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// node_modules/strtok3/lib/stream/WebStreamByobReader.js
|
|
142
|
+
var WebStreamByobReader = class extends WebStreamReader {
|
|
143
|
+
/**
|
|
144
|
+
* Read from stream
|
|
145
|
+
* @param buffer - Target Uint8Array (or Buffer) to store data read from stream in
|
|
146
|
+
* @param mayBeLess - If true, may fill the buffer partially
|
|
147
|
+
* @protected Bytes read
|
|
148
|
+
*/
|
|
149
|
+
async readFromStream(buffer, mayBeLess) {
|
|
150
|
+
if (buffer.length === 0)
|
|
151
|
+
return 0;
|
|
152
|
+
let result = await this.reader.read(new Uint8Array(buffer.length), { min: mayBeLess ? void 0 : buffer.length });
|
|
153
|
+
return result.done && (this.endOfStream = result.done), result.value ? (buffer.set(result.value), result.value.length) : 0;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// node_modules/strtok3/lib/stream/WebStreamDefaultReader.js
|
|
158
|
+
var WebStreamDefaultReader = class extends AbstractStreamReader {
|
|
159
|
+
constructor(reader) {
|
|
160
|
+
super(), this.reader = reader, this.buffer = null;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Copy chunk to target, and store the remainder in this.buffer
|
|
164
|
+
*/
|
|
165
|
+
writeChunk(target, chunk) {
|
|
166
|
+
let written = Math.min(chunk.length, target.length);
|
|
167
|
+
return target.set(chunk.subarray(0, written)), written < chunk.length ? this.buffer = chunk.subarray(written) : this.buffer = null, written;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Read from stream
|
|
171
|
+
* @param buffer - Target Uint8Array (or Buffer) to store data read from stream in
|
|
172
|
+
* @param mayBeLess - If true, may fill the buffer partially
|
|
173
|
+
* @protected Bytes read
|
|
174
|
+
*/
|
|
175
|
+
async readFromStream(buffer, mayBeLess) {
|
|
176
|
+
if (buffer.length === 0)
|
|
177
|
+
return 0;
|
|
178
|
+
let totalBytesRead = 0;
|
|
179
|
+
for (this.buffer && (totalBytesRead += this.writeChunk(buffer, this.buffer)); totalBytesRead < buffer.length && !this.endOfStream; ) {
|
|
180
|
+
let result = await this.reader.read();
|
|
181
|
+
if (result.done) {
|
|
182
|
+
this.endOfStream = !0;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
result.value && (totalBytesRead += this.writeChunk(buffer.subarray(totalBytesRead), result.value));
|
|
186
|
+
}
|
|
187
|
+
if (!mayBeLess && totalBytesRead === 0 && this.endOfStream)
|
|
188
|
+
throw new EndOfStreamError();
|
|
189
|
+
return totalBytesRead;
|
|
190
|
+
}
|
|
191
|
+
abort() {
|
|
192
|
+
return this.interrupted = !0, this.reader.cancel();
|
|
193
|
+
}
|
|
194
|
+
async close() {
|
|
195
|
+
await this.abort(), this.reader.releaseLock();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// node_modules/strtok3/lib/stream/WebStreamReaderFactory.js
|
|
200
|
+
function makeWebStreamReader(stream) {
|
|
201
|
+
try {
|
|
202
|
+
let reader = stream.getReader({ mode: "byob" });
|
|
203
|
+
return reader instanceof ReadableStreamDefaultReader ? new WebStreamDefaultReader(reader) : new WebStreamByobReader(reader);
|
|
204
|
+
} catch (error) {
|
|
205
|
+
if (error instanceof TypeError)
|
|
206
|
+
return new WebStreamDefaultReader(stream.getReader());
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// node_modules/strtok3/lib/AbstractTokenizer.js
|
|
212
|
+
var AbstractTokenizer = class {
|
|
213
|
+
/**
|
|
214
|
+
* Constructor
|
|
215
|
+
* @param options Tokenizer options
|
|
216
|
+
* @protected
|
|
217
|
+
*/
|
|
218
|
+
constructor(options) {
|
|
219
|
+
this.numBuffer = new Uint8Array(8), this.position = 0, this.onClose = options?.onClose, options?.abortSignal && options.abortSignal.addEventListener("abort", () => {
|
|
220
|
+
this.abort();
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Read a token from the tokenizer-stream
|
|
225
|
+
* @param token - The token to read
|
|
226
|
+
* @param position - If provided, the desired position in the tokenizer-stream
|
|
227
|
+
* @returns Promise with token data
|
|
228
|
+
*/
|
|
229
|
+
async readToken(token, position = this.position) {
|
|
230
|
+
let uint8Array = new Uint8Array(token.len);
|
|
231
|
+
if (await this.readBuffer(uint8Array, { position }) < token.len)
|
|
232
|
+
throw new EndOfStreamError();
|
|
233
|
+
return token.get(uint8Array, 0);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Peek a token from the tokenizer-stream.
|
|
237
|
+
* @param token - Token to peek from the tokenizer-stream.
|
|
238
|
+
* @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
|
|
239
|
+
* @returns Promise with token data
|
|
240
|
+
*/
|
|
241
|
+
async peekToken(token, position = this.position) {
|
|
242
|
+
let uint8Array = new Uint8Array(token.len);
|
|
243
|
+
if (await this.peekBuffer(uint8Array, { position }) < token.len)
|
|
244
|
+
throw new EndOfStreamError();
|
|
245
|
+
return token.get(uint8Array, 0);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Read a numeric token from the stream
|
|
249
|
+
* @param token - Numeric token
|
|
250
|
+
* @returns Promise with number
|
|
251
|
+
*/
|
|
252
|
+
async readNumber(token) {
|
|
253
|
+
if (await this.readBuffer(this.numBuffer, { length: token.len }) < token.len)
|
|
254
|
+
throw new EndOfStreamError();
|
|
255
|
+
return token.get(this.numBuffer, 0);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Read a numeric token from the stream
|
|
259
|
+
* @param token - Numeric token
|
|
260
|
+
* @returns Promise with number
|
|
261
|
+
*/
|
|
262
|
+
async peekNumber(token) {
|
|
263
|
+
if (await this.peekBuffer(this.numBuffer, { length: token.len }) < token.len)
|
|
264
|
+
throw new EndOfStreamError();
|
|
265
|
+
return token.get(this.numBuffer, 0);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Ignore number of bytes, advances the pointer in under tokenizer-stream.
|
|
269
|
+
* @param length - Number of bytes to ignore. Must be ≥ 0.
|
|
270
|
+
* @return resolves the number of bytes ignored, equals length if this available, otherwise the number of bytes available
|
|
271
|
+
*/
|
|
272
|
+
async ignore(length) {
|
|
273
|
+
if (length < 0)
|
|
274
|
+
throw new RangeError("ignore length must be \u2265 0 bytes");
|
|
275
|
+
if (this.fileInfo.size !== void 0) {
|
|
276
|
+
let bytesLeft = this.fileInfo.size - this.position;
|
|
277
|
+
if (length > bytesLeft)
|
|
278
|
+
return this.position += bytesLeft, bytesLeft;
|
|
279
|
+
}
|
|
280
|
+
return this.position += length, length;
|
|
281
|
+
}
|
|
282
|
+
async close() {
|
|
283
|
+
await this.abort(), await this.onClose?.();
|
|
284
|
+
}
|
|
285
|
+
normalizeOptions(uint8Array, options) {
|
|
286
|
+
if (!this.supportsRandomAccess() && options && options.position !== void 0 && options.position < this.position)
|
|
287
|
+
throw new Error("`options.position` must be equal or greater than `tokenizer.position`");
|
|
288
|
+
return {
|
|
289
|
+
mayBeLess: !1,
|
|
290
|
+
offset: 0,
|
|
291
|
+
length: uint8Array.length,
|
|
292
|
+
position: this.position,
|
|
293
|
+
...options
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
abort() {
|
|
297
|
+
return Promise.resolve();
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// node_modules/strtok3/lib/ReadStreamTokenizer.js
|
|
302
|
+
var maxBufferSize = 256e3, ReadStreamTokenizer = class extends AbstractTokenizer {
|
|
303
|
+
/**
|
|
304
|
+
* Constructor
|
|
305
|
+
* @param streamReader stream-reader to read from
|
|
306
|
+
* @param options Tokenizer options
|
|
307
|
+
*/
|
|
308
|
+
constructor(streamReader, options) {
|
|
309
|
+
super(options), this.streamReader = streamReader, this.fileInfo = options?.fileInfo ?? {};
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Read buffer from tokenizer
|
|
313
|
+
* @param uint8Array - Target Uint8Array to fill with data read from the tokenizer-stream
|
|
314
|
+
* @param options - Read behaviour options
|
|
315
|
+
* @returns Promise with number of bytes read
|
|
316
|
+
*/
|
|
317
|
+
async readBuffer(uint8Array, options) {
|
|
318
|
+
let normOptions = this.normalizeOptions(uint8Array, options), skipBytes = normOptions.position - this.position;
|
|
319
|
+
if (skipBytes > 0)
|
|
320
|
+
return await this.ignore(skipBytes), this.readBuffer(uint8Array, options);
|
|
321
|
+
if (skipBytes < 0)
|
|
322
|
+
throw new Error("`options.position` must be equal or greater than `tokenizer.position`");
|
|
323
|
+
if (normOptions.length === 0)
|
|
324
|
+
return 0;
|
|
325
|
+
let bytesRead = await this.streamReader.read(uint8Array.subarray(0, normOptions.length), normOptions.mayBeLess);
|
|
326
|
+
if (this.position += bytesRead, (!options || !options.mayBeLess) && bytesRead < normOptions.length)
|
|
327
|
+
throw new EndOfStreamError();
|
|
328
|
+
return bytesRead;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Peek (read ahead) buffer from tokenizer
|
|
332
|
+
* @param uint8Array - Uint8Array (or Buffer) to write data to
|
|
333
|
+
* @param options - Read behaviour options
|
|
334
|
+
* @returns Promise with number of bytes peeked
|
|
335
|
+
*/
|
|
336
|
+
async peekBuffer(uint8Array, options) {
|
|
337
|
+
let normOptions = this.normalizeOptions(uint8Array, options), bytesRead = 0;
|
|
338
|
+
if (normOptions.position) {
|
|
339
|
+
let skipBytes = normOptions.position - this.position;
|
|
340
|
+
if (skipBytes > 0) {
|
|
341
|
+
let skipBuffer = new Uint8Array(normOptions.length + skipBytes);
|
|
342
|
+
return bytesRead = await this.peekBuffer(skipBuffer, { mayBeLess: normOptions.mayBeLess }), uint8Array.set(skipBuffer.subarray(skipBytes)), bytesRead - skipBytes;
|
|
343
|
+
}
|
|
344
|
+
if (skipBytes < 0)
|
|
345
|
+
throw new Error("Cannot peek from a negative offset in a stream");
|
|
346
|
+
}
|
|
347
|
+
if (normOptions.length > 0) {
|
|
348
|
+
try {
|
|
349
|
+
bytesRead = await this.streamReader.peek(uint8Array.subarray(0, normOptions.length), normOptions.mayBeLess);
|
|
350
|
+
} catch (err) {
|
|
351
|
+
if (options?.mayBeLess && err instanceof EndOfStreamError)
|
|
352
|
+
return 0;
|
|
353
|
+
throw err;
|
|
354
|
+
}
|
|
355
|
+
if (!normOptions.mayBeLess && bytesRead < normOptions.length)
|
|
356
|
+
throw new EndOfStreamError();
|
|
357
|
+
}
|
|
358
|
+
return bytesRead;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* @param length Number of bytes to ignore. Must be ≥ 0.
|
|
362
|
+
*/
|
|
363
|
+
async ignore(length) {
|
|
364
|
+
if (length < 0)
|
|
365
|
+
throw new RangeError("ignore length must be \u2265 0 bytes");
|
|
366
|
+
let bufSize = Math.min(maxBufferSize, length), buf = new Uint8Array(bufSize), totBytesRead = 0;
|
|
367
|
+
for (; totBytesRead < length; ) {
|
|
368
|
+
let remaining = length - totBytesRead, bytesRead = await this.readBuffer(buf, { length: Math.min(bufSize, remaining) });
|
|
369
|
+
if (bytesRead < 0)
|
|
370
|
+
return bytesRead;
|
|
371
|
+
totBytesRead += bytesRead;
|
|
372
|
+
}
|
|
373
|
+
return totBytesRead;
|
|
374
|
+
}
|
|
375
|
+
abort() {
|
|
376
|
+
return this.streamReader.abort();
|
|
377
|
+
}
|
|
378
|
+
async close() {
|
|
379
|
+
return this.streamReader.close();
|
|
380
|
+
}
|
|
381
|
+
supportsRandomAccess() {
|
|
382
|
+
return !1;
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
// node_modules/strtok3/lib/BufferTokenizer.js
|
|
387
|
+
var BufferTokenizer = class extends AbstractTokenizer {
|
|
388
|
+
/**
|
|
389
|
+
* Construct BufferTokenizer
|
|
390
|
+
* @param uint8Array - Uint8Array to tokenize
|
|
391
|
+
* @param options Tokenizer options
|
|
392
|
+
*/
|
|
393
|
+
constructor(uint8Array, options) {
|
|
394
|
+
super(options), this.uint8Array = uint8Array, this.fileInfo = { ...options?.fileInfo ?? {}, size: uint8Array.length };
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Read buffer from tokenizer
|
|
398
|
+
* @param uint8Array - Uint8Array to tokenize
|
|
399
|
+
* @param options - Read behaviour options
|
|
400
|
+
* @returns {Promise<number>}
|
|
401
|
+
*/
|
|
402
|
+
async readBuffer(uint8Array, options) {
|
|
403
|
+
options?.position && (this.position = options.position);
|
|
404
|
+
let bytesRead = await this.peekBuffer(uint8Array, options);
|
|
405
|
+
return this.position += bytesRead, bytesRead;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Peek (read ahead) buffer from tokenizer
|
|
409
|
+
* @param uint8Array
|
|
410
|
+
* @param options - Read behaviour options
|
|
411
|
+
* @returns {Promise<number>}
|
|
412
|
+
*/
|
|
413
|
+
async peekBuffer(uint8Array, options) {
|
|
414
|
+
let normOptions = this.normalizeOptions(uint8Array, options), bytes2read = Math.min(this.uint8Array.length - normOptions.position, normOptions.length);
|
|
415
|
+
if (!normOptions.mayBeLess && bytes2read < normOptions.length)
|
|
416
|
+
throw new EndOfStreamError();
|
|
417
|
+
return uint8Array.set(this.uint8Array.subarray(normOptions.position, normOptions.position + bytes2read)), bytes2read;
|
|
418
|
+
}
|
|
419
|
+
close() {
|
|
420
|
+
return super.close();
|
|
421
|
+
}
|
|
422
|
+
supportsRandomAccess() {
|
|
423
|
+
return !0;
|
|
424
|
+
}
|
|
425
|
+
setPosition(position) {
|
|
426
|
+
this.position = position;
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
// node_modules/strtok3/lib/BlobTokenizer.js
|
|
431
|
+
var BlobTokenizer = class extends AbstractTokenizer {
|
|
432
|
+
/**
|
|
433
|
+
* Construct BufferTokenizer
|
|
434
|
+
* @param blob - Uint8Array to tokenize
|
|
435
|
+
* @param options Tokenizer options
|
|
436
|
+
*/
|
|
437
|
+
constructor(blob, options) {
|
|
438
|
+
super(options), this.blob = blob, this.fileInfo = { ...options?.fileInfo ?? {}, size: blob.size, mimeType: blob.type };
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Read buffer from tokenizer
|
|
442
|
+
* @param uint8Array - Uint8Array to tokenize
|
|
443
|
+
* @param options - Read behaviour options
|
|
444
|
+
* @returns {Promise<number>}
|
|
445
|
+
*/
|
|
446
|
+
async readBuffer(uint8Array, options) {
|
|
447
|
+
options?.position && (this.position = options.position);
|
|
448
|
+
let bytesRead = await this.peekBuffer(uint8Array, options);
|
|
449
|
+
return this.position += bytesRead, bytesRead;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Peek (read ahead) buffer from tokenizer
|
|
453
|
+
* @param buffer
|
|
454
|
+
* @param options - Read behaviour options
|
|
455
|
+
* @returns {Promise<number>}
|
|
456
|
+
*/
|
|
457
|
+
async peekBuffer(buffer, options) {
|
|
458
|
+
let normOptions = this.normalizeOptions(buffer, options), bytes2read = Math.min(this.blob.size - normOptions.position, normOptions.length);
|
|
459
|
+
if (!normOptions.mayBeLess && bytes2read < normOptions.length)
|
|
460
|
+
throw new EndOfStreamError();
|
|
461
|
+
let arrayBuffer = await this.blob.slice(normOptions.position, normOptions.position + bytes2read).arrayBuffer();
|
|
462
|
+
return buffer.set(new Uint8Array(arrayBuffer)), bytes2read;
|
|
463
|
+
}
|
|
464
|
+
close() {
|
|
465
|
+
return super.close();
|
|
466
|
+
}
|
|
467
|
+
supportsRandomAccess() {
|
|
468
|
+
return !0;
|
|
469
|
+
}
|
|
470
|
+
setPosition(position) {
|
|
471
|
+
this.position = position;
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
// node_modules/strtok3/lib/core.js
|
|
476
|
+
function fromStream(stream, options) {
|
|
477
|
+
let streamReader = new StreamReader(stream), _options = options ?? {}, chainedClose = _options.onClose;
|
|
478
|
+
return _options.onClose = async () => {
|
|
479
|
+
if (await streamReader.close(), chainedClose)
|
|
480
|
+
return chainedClose();
|
|
481
|
+
}, new ReadStreamTokenizer(streamReader, _options);
|
|
482
|
+
}
|
|
483
|
+
function fromWebStream(webStream, options) {
|
|
484
|
+
let webStreamReader = makeWebStreamReader(webStream), _options = options ?? {}, chainedClose = _options.onClose;
|
|
485
|
+
return _options.onClose = async () => {
|
|
486
|
+
if (await webStreamReader.close(), chainedClose)
|
|
487
|
+
return chainedClose();
|
|
488
|
+
}, new ReadStreamTokenizer(webStreamReader, _options);
|
|
489
|
+
}
|
|
490
|
+
function fromBuffer(uint8Array, options) {
|
|
491
|
+
return new BufferTokenizer(uint8Array, options);
|
|
492
|
+
}
|
|
493
|
+
function fromBlob(blob, options) {
|
|
494
|
+
return new BlobTokenizer(blob, options);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// node_modules/strtok3/lib/index.js
|
|
498
|
+
import { stat as fsStat } from "node:fs/promises";
|
|
499
|
+
|
|
500
|
+
// node_modules/strtok3/lib/FileTokenizer.js
|
|
501
|
+
import { open as fsOpen } from "node:fs/promises";
|
|
502
|
+
var FileTokenizer = class _FileTokenizer extends AbstractTokenizer {
|
|
503
|
+
/**
|
|
504
|
+
* Create tokenizer from provided file path
|
|
505
|
+
* @param sourceFilePath File path
|
|
506
|
+
*/
|
|
507
|
+
static async fromFile(sourceFilePath) {
|
|
508
|
+
let fileHandle = await fsOpen(sourceFilePath, "r"), stat = await fileHandle.stat();
|
|
509
|
+
return new _FileTokenizer(fileHandle, { fileInfo: { path: sourceFilePath, size: stat.size } });
|
|
510
|
+
}
|
|
511
|
+
constructor(fileHandle, options) {
|
|
512
|
+
super(options), this.fileHandle = fileHandle, this.fileInfo = options.fileInfo;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Read buffer from file
|
|
516
|
+
* @param uint8Array - Uint8Array to write result to
|
|
517
|
+
* @param options - Read behaviour options
|
|
518
|
+
* @returns Promise number of bytes read
|
|
519
|
+
*/
|
|
520
|
+
async readBuffer(uint8Array, options) {
|
|
521
|
+
let normOptions = this.normalizeOptions(uint8Array, options);
|
|
522
|
+
if (this.position = normOptions.position, normOptions.length === 0)
|
|
523
|
+
return 0;
|
|
524
|
+
let res = await this.fileHandle.read(uint8Array, 0, normOptions.length, normOptions.position);
|
|
525
|
+
if (this.position += res.bytesRead, res.bytesRead < normOptions.length && (!options || !options.mayBeLess))
|
|
526
|
+
throw new EndOfStreamError();
|
|
527
|
+
return res.bytesRead;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Peek buffer from file
|
|
531
|
+
* @param uint8Array - Uint8Array (or Buffer) to write data to
|
|
532
|
+
* @param options - Read behaviour options
|
|
533
|
+
* @returns Promise number of bytes read
|
|
534
|
+
*/
|
|
535
|
+
async peekBuffer(uint8Array, options) {
|
|
536
|
+
let normOptions = this.normalizeOptions(uint8Array, options), res = await this.fileHandle.read(uint8Array, 0, normOptions.length, normOptions.position);
|
|
537
|
+
if (!normOptions.mayBeLess && res.bytesRead < normOptions.length)
|
|
538
|
+
throw new EndOfStreamError();
|
|
539
|
+
return res.bytesRead;
|
|
540
|
+
}
|
|
541
|
+
async close() {
|
|
542
|
+
return await this.fileHandle.close(), super.close();
|
|
543
|
+
}
|
|
544
|
+
setPosition(position) {
|
|
545
|
+
this.position = position;
|
|
546
|
+
}
|
|
547
|
+
supportsRandomAccess() {
|
|
548
|
+
return !0;
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
// node_modules/strtok3/lib/index.js
|
|
553
|
+
async function fromStream2(stream, options) {
|
|
554
|
+
let rst = fromStream(stream, options);
|
|
555
|
+
if (stream.path) {
|
|
556
|
+
let stat = await fsStat(stream.path);
|
|
557
|
+
rst.fileInfo.path = stream.path, rst.fileInfo.size = stat.size;
|
|
558
|
+
}
|
|
559
|
+
return rst;
|
|
560
|
+
}
|
|
561
|
+
var fromFile = FileTokenizer.fromFile;
|
|
562
|
+
|
|
563
|
+
export {
|
|
564
|
+
EndOfStreamError,
|
|
565
|
+
fromWebStream,
|
|
566
|
+
fromBuffer,
|
|
567
|
+
fromBlob,
|
|
568
|
+
fromStream2 as fromStream,
|
|
569
|
+
fromFile
|
|
570
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { createRequire as __adfCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __adfFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __adfDirname } from 'node:path';
|
|
4
|
+
const require = __adfCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __adfFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __adfDirname(__filename);
|
|
7
|
+
|
|
8
|
+
// src/main/tools/shell/executor/environment.ts
|
|
9
|
+
var EnvironmentResolver = class {
|
|
10
|
+
systemVars;
|
|
11
|
+
eventVars = {};
|
|
12
|
+
exportedVars = {};
|
|
13
|
+
/** Command-scoped vars from `VAR=val cmd` prefixes (see withOverlay) */
|
|
14
|
+
overlayVars = {};
|
|
15
|
+
/** Exit code of the last executed command, exposed as $? */
|
|
16
|
+
lastExitCode = 0;
|
|
17
|
+
workspace;
|
|
18
|
+
constructor(config, workspace) {
|
|
19
|
+
this.workspace = workspace, this.systemVars = {
|
|
20
|
+
AGENT_NAME: config.name ?? "",
|
|
21
|
+
AGENT_STATE: config.state ?? "active",
|
|
22
|
+
PWD: "/"
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Set event context variables from AdfEventDispatch */
|
|
26
|
+
setTriggerContext(dispatch) {
|
|
27
|
+
this.eventVars = {};
|
|
28
|
+
let { event } = dispatch;
|
|
29
|
+
if (this.eventVars.EVENT_TYPE = event.type, event.type === "inbox" && event.data) {
|
|
30
|
+
let d = event.data;
|
|
31
|
+
this.eventVars.MSG_ID = d.message.id, this.eventVars.MSG_FROM = d.message.from, d.message.source && (this.eventVars.MSG_CHANNEL = d.message.source);
|
|
32
|
+
} else if (event.type === "timer" && event.data) {
|
|
33
|
+
let d = event.data;
|
|
34
|
+
this.eventVars.TIMER_ID = String(d.timer.id), d.timer.payload && (this.eventVars.TIMER_PAYLOAD = d.timer.payload);
|
|
35
|
+
} else if (event.type === "task_create" && event.data) {
|
|
36
|
+
let d = event.data;
|
|
37
|
+
this.eventVars.TASK_ID = d.task.id, this.eventVars.TASK_TOOL = d.task.tool, this.eventVars.TASK_STATUS = d.task.status;
|
|
38
|
+
} else if (event.type === "task_complete" && event.data) {
|
|
39
|
+
let d = event.data;
|
|
40
|
+
this.eventVars.TASK_ID = d.task.id, this.eventVars.TASK_STATUS = d.task.status;
|
|
41
|
+
} else if (event.type === "tool_call" && event.data) {
|
|
42
|
+
let d = event.data;
|
|
43
|
+
this.eventVars.TASK_ID = "";
|
|
44
|
+
} else if (event.type === "file_change" && event.data) {
|
|
45
|
+
let d = event.data;
|
|
46
|
+
this.eventVars.CHANGED_PATH = d.path;
|
|
47
|
+
} else if (event.type === "llm_call" && event.data) {
|
|
48
|
+
let d = event.data;
|
|
49
|
+
this.eventVars.LLM_PROVIDER = d.provider, this.eventVars.LLM_MODEL = d.model, this.eventVars.LLM_SOURCE = d.source, this.eventVars.LLM_INPUT_TOKENS = String(d.input_tokens), this.eventVars.LLM_OUTPUT_TOKENS = String(d.output_tokens), this.eventVars.LLM_DURATION_MS = String(d.duration_ms), this.eventVars.LLM_STOP_REASON = d.stop_reason, d.cost_usd !== void 0 && (this.eventVars.LLM_COST_USD = String(d.cost_usd));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Set a variable via export KEY=VALUE */
|
|
53
|
+
export(key, value) {
|
|
54
|
+
this.exportedVars[key] = value;
|
|
55
|
+
}
|
|
56
|
+
/** Record the exit code of the last executed command ($?) */
|
|
57
|
+
setLastExitCode(code) {
|
|
58
|
+
this.lastExitCode = code;
|
|
59
|
+
}
|
|
60
|
+
/** Create a command-scoped view where `vars` shadow everything else
|
|
61
|
+
* (`VAR=val cmd`). The view shares all other state with this resolver. */
|
|
62
|
+
withOverlay(vars) {
|
|
63
|
+
let child = Object.create(this);
|
|
64
|
+
return child.overlayVars = { ...this.overlayVars, ...vars }, child;
|
|
65
|
+
}
|
|
66
|
+
/** Whether a variable is set — distinct from empty (`${VAR-def}` semantics) */
|
|
67
|
+
has(name) {
|
|
68
|
+
return name === "?" || name in this.overlayVars || name in this.exportedVars || name in this.eventVars || name in this.systemVars ? !0 : this.resolve(name) !== "";
|
|
69
|
+
}
|
|
70
|
+
/** Resolve a variable name to its value */
|
|
71
|
+
resolve(name) {
|
|
72
|
+
if (name === "?") return String(this.lastExitCode);
|
|
73
|
+
if (name in this.overlayVars) return this.overlayVars[name];
|
|
74
|
+
if (name in this.exportedVars) return this.exportedVars[name];
|
|
75
|
+
if (name in this.eventVars) return this.eventVars[name];
|
|
76
|
+
if (name in this.systemVars) return this.systemVars[name];
|
|
77
|
+
if (name === "AGENT_DID")
|
|
78
|
+
try {
|
|
79
|
+
return this.workspace.getDid?.() ?? this.workspace.getIdentity("did") ?? "";
|
|
80
|
+
} catch {
|
|
81
|
+
return "";
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
let val = this.workspace.getIdentity(name.toLowerCase());
|
|
85
|
+
if (val) return val;
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
return "";
|
|
89
|
+
}
|
|
90
|
+
/** List all environment variables (for `env` command). Redacts sensitive values. */
|
|
91
|
+
listAll() {
|
|
92
|
+
let result = [];
|
|
93
|
+
for (let [k, v] of Object.entries(this.systemVars))
|
|
94
|
+
result.push({ key: k, value: v, source: "system" });
|
|
95
|
+
for (let [k, v] of Object.entries(this.eventVars))
|
|
96
|
+
result.push({ key: k, value: v, source: "event" });
|
|
97
|
+
for (let [k, v] of Object.entries(this.exportedVars))
|
|
98
|
+
result.push({ key: k, value: v, source: "export" });
|
|
99
|
+
for (let [k, v] of Object.entries(this.overlayVars))
|
|
100
|
+
result.push({ key: k, value: v, source: "command" });
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
function resolveWithDefault(env, name, op, word) {
|
|
105
|
+
let value = env.resolve(name);
|
|
106
|
+
return op === void 0 ? value : op === ":-" ? value !== "" ? value : word ?? "" : op === "-" ? env.has(name) ? value : word ?? "" : value;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
EnvironmentResolver,
|
|
111
|
+
resolveWithDefault
|
|
112
|
+
};
|