exoproc-accessors 0.1.0 → 0.6.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 -235
- package/dist/accessors.d.ts +186 -0
- package/dist/accessors.d.ts.map +1 -0
- package/dist/accessors.js +363 -0
- package/dist/accessors.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +725 -109
- package/dist/index.js.map +1 -1
- package/dist/indirect-nthread-host-accessor.d.ts +127 -0
- package/dist/indirect-nthread-host-accessor.d.ts.map +1 -0
- package/dist/indirect-nthread-host-accessor.js +288 -0
- package/dist/indirect-nthread-host-accessor.js.map +1 -0
- package/dist/middleware-accessor.d.ts +82 -14
- package/dist/middleware-accessor.d.ts.map +1 -1
- package/dist/middleware-accessor.js +336 -108
- package/dist/middleware-accessor.js.map +1 -1
- package/dist/stealth-java.d.ts +21 -0
- package/dist/stealth-java.d.ts.map +1 -0
- package/dist/stealth-java.js +119 -0
- package/dist/stealth-java.js.map +1 -0
- package/package.json +20 -10
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { Thread, Module } from 'bun-winapi';
|
|
2
|
+
import { Kernel32Impl } from 'bun-xffi';
|
|
3
|
+
import { CallThreadDiedError, NThread } from 'bun-nthread';
|
|
4
|
+
import { NShm } from 'bun-nshm';
|
|
5
|
+
import { attachNJava, findNJava, getNJava, getReflection, findReflection, getJavaClass, } from 'bun-njava';
|
|
6
|
+
import { HostAccessor, RedirectorHostAccessor, } from './middleware-accessor.js';
|
|
7
|
+
import { IndirectNThreadHostAccessor, NThreadRaceAccessor, } from './indirect-nthread-host-accessor.js';
|
|
8
|
+
import { createStealthJavaAccessor, spawnStealthWorkerThread, } from './stealth-java.js';
|
|
9
|
+
export { createStealthJavaAccessor, spawnStealthWorkerThread, attachNJava, findNJava, getNJava, getReflection, findReflection, getJavaClass, };
|
|
10
|
+
/**
|
|
11
|
+
* Default for {@link AccessorOptions.idType} when omitted -- `id` is treated
|
|
12
|
+
* as a pid and every one of its threads races for the hijack (see
|
|
13
|
+
* {@link NThreadRaceAccessor}), so callers don't have to pick a thread
|
|
14
|
+
* themselves.
|
|
15
|
+
*/
|
|
16
|
+
const DEFAULT_ID_TYPE = 'processAllThreadIds';
|
|
17
|
+
/** Resolves `id` (a raw thread id) to its owning `{ pid, threadId }` pair. */
|
|
18
|
+
function resolveFromThreadId(id) {
|
|
19
|
+
// pid=0 means "all processes" -- a bare thread id doesn't tell us which
|
|
20
|
+
// process owns it, so the system-wide snapshot has to be searched.
|
|
21
|
+
const entry = Thread.getThreads(0).find((t) => t.tid === id);
|
|
22
|
+
if (!entry) {
|
|
23
|
+
throw new Error(`createAccessor: no thread with id ${id} found`);
|
|
24
|
+
}
|
|
25
|
+
return { pid: entry.ownerPid, threadId: id };
|
|
26
|
+
}
|
|
27
|
+
/** Resolves `id` (a process id) to `{ pid, threadId }` via its first enumerable thread. */
|
|
28
|
+
function resolveFromProcessId(id) {
|
|
29
|
+
const threadId = Thread.getThreads(id)[0]?.tid;
|
|
30
|
+
if (threadId === undefined) {
|
|
31
|
+
throw new Error(`createAccessor: process ${id} has no threads to redirect`);
|
|
32
|
+
}
|
|
33
|
+
return { pid: id, threadId };
|
|
34
|
+
}
|
|
35
|
+
/** The default chain or `options.backend`, before any `sharedMemory` wrapping. */
|
|
36
|
+
function resolveBaseAccessor(id, options) {
|
|
37
|
+
if (options.backend) {
|
|
38
|
+
return options.backend;
|
|
39
|
+
}
|
|
40
|
+
const Host = options.host ?? IndirectNThreadHostAccessor;
|
|
41
|
+
const idType = options.idType ?? DEFAULT_ID_TYPE;
|
|
42
|
+
if (idType === 'processAllThreadIds') {
|
|
43
|
+
if (Host !== IndirectNThreadHostAccessor) {
|
|
44
|
+
throw new Error('createAccessor: idType "processAllThreadIds" is only supported ' +
|
|
45
|
+
"with the default host (IndirectNThreadHostAccessor) -- there's " +
|
|
46
|
+
"no generic way to race across an arbitrary host class's threads.");
|
|
47
|
+
}
|
|
48
|
+
return new IndirectNThreadHostAccessor(new NThreadRaceAccessor(id, options.hostOptions));
|
|
49
|
+
}
|
|
50
|
+
const { pid, threadId } = idType === 'thread' ? resolveFromThreadId(id) : resolveFromProcessId(id);
|
|
51
|
+
return new Host(pid, threadId, options.hostOptions);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Builds the same accessor {@link createAccessor} does, without initializing
|
|
55
|
+
* it -- the result still lazily initializes on its first real operation
|
|
56
|
+
* (every {@link InittableMiddlewareAccessor} op is guarded by
|
|
57
|
+
* `!isInitializing -> await this.init()`), it's just not pre-initialized up
|
|
58
|
+
* front. Defaults to {@link IndirectNThreadHostAccessor} (thread redirection
|
|
59
|
+
* -- no `CreateRemoteThread` and no remote allocation for the call mechanism
|
|
60
|
+
* itself); pass `options.backend` to use a different strategy instead.
|
|
61
|
+
*
|
|
62
|
+
* Always returns a real {@link HostAccessor} -- `init`/`deinit`/etc. are
|
|
63
|
+
* directly callable on the result, `sharedMemory: true` included. Rather
|
|
64
|
+
* than wrapping the resolved base accessor in a new outer `HostAccessor`,
|
|
65
|
+
* `sharedMemory: true` splices the shared-memory middleware ({@link NShm} by
|
|
66
|
+
* default, a plain non-inittable `MiddlewareAccessor`) directly into the
|
|
67
|
+
* base accessor's own `backend` chain (`base.backend` becomes the
|
|
68
|
+
* middleware, whose own `backend` becomes whatever `base.backend` used to
|
|
69
|
+
* be) and returns `base` itself -- so the result is still the concrete
|
|
70
|
+
* class `resolveBaseAccessor` produced (e.g. `IndirectNThreadHostAccessor`,
|
|
71
|
+
* `.nthread` and all), just with allocations transparently intercepted.
|
|
72
|
+
* `HostAccessor.init()`/`.deinit()` skip over non-inittable middleware
|
|
73
|
+
* layers when walking the chain (see `InittableMiddlewareAccessor.initNext()`
|
|
74
|
+
* in bun-xffi), so this still reaches down and initializes/deinitializes
|
|
75
|
+
* the spliced-in middleware's own backend correctly.
|
|
76
|
+
*
|
|
77
|
+
* `options.idType` defaults to `'processAllThreadIds'`, which races every
|
|
78
|
+
* thread of the process via a {@link NThreadRaceAccessor} nested inside the
|
|
79
|
+
* built `IndirectNThreadHostAccessor` -- see {@link AccessorOptions.idType}.
|
|
80
|
+
* Building it still doesn't touch the target process (beyond a local
|
|
81
|
+
* `Thread.getThreads` snapshot to discover candidates) -- the actual hijack
|
|
82
|
+
* attempts, and picking a winner among them, only happen once `init()` runs,
|
|
83
|
+
* whether that's this function's caller doing it lazily on first real use,
|
|
84
|
+
* or {@link createAccessor} doing it eagerly.
|
|
85
|
+
*/
|
|
86
|
+
export function createAccessorWithoutInit(id, options = {}) {
|
|
87
|
+
const base = resolveBaseAccessor(id, options);
|
|
88
|
+
base._options = options;
|
|
89
|
+
if (!options.sharedMemory) {
|
|
90
|
+
return base;
|
|
91
|
+
}
|
|
92
|
+
// Splice the shared-memory middleware into `base`'s own backend chain
|
|
93
|
+
// (base.backend -> middleware -> base's original backend) and return
|
|
94
|
+
// `base` itself, rather than allocating a new outer HostAccessor to wrap
|
|
95
|
+
// it -- this keeps `base`'s concrete class/identity intact (e.g. an
|
|
96
|
+
// IndirectNThreadHostAccessor's `.nthread` stays reachable) while every op
|
|
97
|
+
// still gets intercepted by the middleware, since `base`'s own ops already
|
|
98
|
+
// forward to `base.backend`.
|
|
99
|
+
base.backend = new (options.sharedMemoryMiddleware ?? NShm)(base.backend, base, options.sharedMemoryOptions);
|
|
100
|
+
return base;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* {@link createAccessorWithoutInit}, followed by `await`ing the result's
|
|
104
|
+
* `init()` so the accessor is already initialized by the time this resolves,
|
|
105
|
+
* instead of initializing lazily on its first real operation. Same
|
|
106
|
+
* always-`HostAccessor` return type as {@link createAccessorWithoutInit}.
|
|
107
|
+
*
|
|
108
|
+
* For `options.idType === 'processAllThreadIds'` (see
|
|
109
|
+
* {@link AccessorOptions.idType}), this `init()` call is what actually runs
|
|
110
|
+
* the race ({@link NThreadRaceAccessor.onInit}, nested inside the resolved
|
|
111
|
+
* {@link IndirectNThreadHostAccessor}'s own chain) -- picking a winner,
|
|
112
|
+
* aborting the rest, and (when `sharedMemory: true`) initializing the
|
|
113
|
+
* shared-memory middleware on top, all as part of this one `await`. The
|
|
114
|
+
* result is always a genuine `IndirectNThreadHostAccessor` for every
|
|
115
|
+
* `idType`, `processAllThreadIds` included -- `NThreadRaceAccessor` never
|
|
116
|
+
* surfaces to callers; see its own doc comment.
|
|
117
|
+
*/
|
|
118
|
+
async function remoteGetModuleHandleA(accessor, name) {
|
|
119
|
+
const buf = Buffer.from(`${name}\0`);
|
|
120
|
+
const ptr = await accessor.alloc(buf.length);
|
|
121
|
+
try {
|
|
122
|
+
await accessor.write(ptr, buf);
|
|
123
|
+
return BigInt(await accessor.call(Kernel32Impl.GetModuleHandleA, ptr));
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
await accessor.free(ptr).catch(() => { });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function isThreadDiedError(err) {
|
|
130
|
+
if (!(err instanceof Error))
|
|
131
|
+
return false;
|
|
132
|
+
return (err instanceof CallThreadDiedError ||
|
|
133
|
+
err.name === 'CallThreadDiedError' ||
|
|
134
|
+
err.constructor?.name === 'CallThreadDiedError' ||
|
|
135
|
+
/Thread died/i.test(err.message));
|
|
136
|
+
}
|
|
137
|
+
export async function createAccessor(idOrPath, options = {}) {
|
|
138
|
+
if (typeof idOrPath === 'string') {
|
|
139
|
+
return await HostAccessor.load(idOrPath, options);
|
|
140
|
+
}
|
|
141
|
+
const id = idOrPath;
|
|
142
|
+
const initOne = async (targetId, opt) => {
|
|
143
|
+
const accessor = createAccessorWithoutInit(targetId, opt);
|
|
144
|
+
accessor._options = opt;
|
|
145
|
+
try {
|
|
146
|
+
await accessor.init();
|
|
147
|
+
const njavaOpt = opt.njava ?? 'auto';
|
|
148
|
+
if (njavaOpt === true) {
|
|
149
|
+
await attachNJava(accessor);
|
|
150
|
+
}
|
|
151
|
+
else if (njavaOpt === 'auto') {
|
|
152
|
+
try {
|
|
153
|
+
let hJvm = await remoteGetModuleHandleA(accessor, 'jvm.dll');
|
|
154
|
+
if (hJvm === 0n) {
|
|
155
|
+
const modules = Module.getModules(accessor.processId);
|
|
156
|
+
const isJavaLauncher = modules.some((m) => /java(\.exe|w\.exe|\.dll)/i.test(m.name));
|
|
157
|
+
if (isJavaLauncher) {
|
|
158
|
+
const deadline = Date.now() + 10000;
|
|
159
|
+
while (hJvm === 0n && Date.now() < deadline) {
|
|
160
|
+
await Bun.sleep(100);
|
|
161
|
+
hJvm = await remoteGetModuleHandleA(accessor, 'jvm.dll');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (hJvm !== 0n) {
|
|
166
|
+
await attachNJava(accessor);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
if (isThreadDiedError(err)) {
|
|
171
|
+
accessor.close();
|
|
172
|
+
throw err;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return accessor;
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
accessor.close();
|
|
180
|
+
throw err;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
if (options.njava === 'stealth') {
|
|
184
|
+
return await createStealthJavaAccessor(id, options);
|
|
185
|
+
}
|
|
186
|
+
if (options.backend || options.idType === 'thread') {
|
|
187
|
+
return await initOne(id, options);
|
|
188
|
+
}
|
|
189
|
+
// If the target is a Java process and no specific idType was requested,
|
|
190
|
+
// iterate threads sequentially prioritizing HotSpot worker threads first
|
|
191
|
+
// to avoid racing onto a short-lived launcher / helper thread that exits.
|
|
192
|
+
if (!options.idType) {
|
|
193
|
+
try {
|
|
194
|
+
const modules = Module.getModules(id);
|
|
195
|
+
const isJava = modules.some((m) => /java(\.exe|w\.exe|\.dll)/i.test(m.name));
|
|
196
|
+
if (isJava) {
|
|
197
|
+
const threads = Thread.getThreads(id);
|
|
198
|
+
const candidateThreads = threads.length > 1 ? [...threads.slice(1), threads[0]] : threads;
|
|
199
|
+
for (const t of candidateThreads) {
|
|
200
|
+
try {
|
|
201
|
+
return await initOne(t.tid, {
|
|
202
|
+
...options,
|
|
203
|
+
idType: 'thread',
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
// Try next candidate thread
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
// Fall through to standard race
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
return await initOne(id, options);
|
|
218
|
+
}
|
|
219
|
+
catch (err) {
|
|
220
|
+
if (isThreadDiedError(err)) {
|
|
221
|
+
const threads = Thread.getThreads(id);
|
|
222
|
+
for (const t of threads) {
|
|
223
|
+
try {
|
|
224
|
+
return await initOne(t.tid, {
|
|
225
|
+
...options,
|
|
226
|
+
idType: 'thread',
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// Candidate thread didn't work, try next
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
throw err;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const AGGRESSIVENESS_PRESETS = {
|
|
238
|
+
1: {
|
|
239
|
+
hostOptions: { timeoutMs: 20000, pollIntervalMs: 2 },
|
|
240
|
+
sharedMemory: false,
|
|
241
|
+
},
|
|
242
|
+
2: {
|
|
243
|
+
hostOptions: { timeoutMs: 5000, pollIntervalMs: 2 },
|
|
244
|
+
sharedMemory: true,
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Returns a ready-made {@link AccessorOptions} template tuned for the given
|
|
249
|
+
* {@link AccessorAggressiveness} level -- pass it straight to
|
|
250
|
+
* {@link createAccessor}, or spread/extend it (e.g. to also set `idType`).
|
|
251
|
+
*/
|
|
252
|
+
export function createAccessorOptions(aggressiveness = 1) {
|
|
253
|
+
const preset = AGGRESSIVENESS_PRESETS[aggressiveness];
|
|
254
|
+
return {
|
|
255
|
+
hostOptions: { ...preset.hostOptions },
|
|
256
|
+
sharedMemory: preset.sharedMemory,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Restores an active {@link HostAccessor} from a previously saved {@link HostAccessorSession}.
|
|
261
|
+
*
|
|
262
|
+
* If `session.threadId` is recorded and that thread is still alive in the target process,
|
|
263
|
+
* it attempts direct re-attachment (`idType: 'thread'`), resuming access in milliseconds
|
|
264
|
+
* without re-racing thread candidates. If the thread died or is unavailable, it falls back
|
|
265
|
+
* to process-wide attachment (`idType: 'processAllThreadIds'`).
|
|
266
|
+
*
|
|
267
|
+
* @param session Parsed session object.
|
|
268
|
+
* @param overrideOptions Optional options to merge with or override the saved options.
|
|
269
|
+
* @returns Initialized HostAccessor instance.
|
|
270
|
+
*/
|
|
271
|
+
export async function restoreAccessorFromSession(session, overrideOptions = {}) {
|
|
272
|
+
const baseOptions = {
|
|
273
|
+
...session.options,
|
|
274
|
+
...overrideOptions,
|
|
275
|
+
};
|
|
276
|
+
const nthreadLayer = session.pipeline?.find((p) => p.type === 'NThread');
|
|
277
|
+
if (nthreadLayer?.state && nthreadLayer.state.threadId) {
|
|
278
|
+
try {
|
|
279
|
+
const testThread = Thread.open(nthreadLayer.state.threadId);
|
|
280
|
+
const isAlive = testThread.isValid() && testThread.getExitCode() === 259;
|
|
281
|
+
testThread.close();
|
|
282
|
+
if (isAlive) {
|
|
283
|
+
const redirector = new RedirectorHostAccessor(session.processId);
|
|
284
|
+
const nthread = new NThread(session.processId, nthreadLayer.state.threadId, baseOptions.hostOptions ?? {}, redirector);
|
|
285
|
+
nthread.resumeFromHibernation(nthreadLayer.state);
|
|
286
|
+
const accessor = new IndirectNThreadHostAccessor(nthread);
|
|
287
|
+
redirector.target = accessor;
|
|
288
|
+
const hasNShm = session.pipeline?.some((p) => p.type === 'NShm') ||
|
|
289
|
+
baseOptions.sharedMemory;
|
|
290
|
+
if (hasNShm) {
|
|
291
|
+
accessor.backend = new (baseOptions.sharedMemoryMiddleware ?? NShm)(accessor.backend, accessor, baseOptions.sharedMemoryOptions);
|
|
292
|
+
}
|
|
293
|
+
await accessor.init();
|
|
294
|
+
const hasNJava = session.pipeline?.some((p) => p.type === 'NJavaAccessor') ||
|
|
295
|
+
Boolean(baseOptions.njava);
|
|
296
|
+
if (hasNJava) {
|
|
297
|
+
await attachNJava(accessor);
|
|
298
|
+
}
|
|
299
|
+
accessor._options = baseOptions;
|
|
300
|
+
if (session.metadata) {
|
|
301
|
+
for (const [key, value] of Object.entries(session.metadata)) {
|
|
302
|
+
accessor.setSessionMetadata(key, value);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return accessor;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
// Hibernated resume failed; fall through to normal reconnection
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
let targetId = session.processId;
|
|
313
|
+
let useThread = false;
|
|
314
|
+
try {
|
|
315
|
+
const threads = Thread.getThreads(session.processId);
|
|
316
|
+
if (threads.length === 0) {
|
|
317
|
+
throw new Error(`Cannot restore accessor: process ${session.processId} is not running (no threads found).`);
|
|
318
|
+
}
|
|
319
|
+
if (session.threadId !== undefined &&
|
|
320
|
+
threads.some((t) => t.tid === session.threadId)) {
|
|
321
|
+
targetId = session.threadId;
|
|
322
|
+
useThread = true;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
catch (err) {
|
|
326
|
+
if (err.message?.includes('Cannot restore accessor:')) {
|
|
327
|
+
throw err;
|
|
328
|
+
}
|
|
329
|
+
// If thread snapshot query threw, fall back to process-level attach
|
|
330
|
+
}
|
|
331
|
+
const finalOptions = {
|
|
332
|
+
...baseOptions,
|
|
333
|
+
idType: useThread
|
|
334
|
+
? 'thread'
|
|
335
|
+
: (baseOptions.idType ?? 'processAllThreadIds'),
|
|
336
|
+
};
|
|
337
|
+
const accessor = await createAccessor(targetId, finalOptions);
|
|
338
|
+
// Restore saved session metadata
|
|
339
|
+
if (session.metadata) {
|
|
340
|
+
for (const [key, value] of Object.entries(session.metadata)) {
|
|
341
|
+
accessor.setSessionMetadata(key, value);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return accessor;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Convenience helper to restore an accessor directly from a saved JSON session file.
|
|
348
|
+
*
|
|
349
|
+
* @param filePath Path to the saved session JSON file.
|
|
350
|
+
* @param overrideOptions Optional options to merge with or override the saved options.
|
|
351
|
+
* @returns Initialized HostAccessor instance.
|
|
352
|
+
*/
|
|
353
|
+
export async function createAccessorFromFile(filePath, overrideOptions) {
|
|
354
|
+
return await HostAccessor.restoreFromFile(filePath, overrideOptions);
|
|
355
|
+
}
|
|
356
|
+
// Register default restorers with HostAccessor
|
|
357
|
+
HostAccessor.registerRestorer('IndirectNThreadHostAccessor', async (session, overrideOptions) => {
|
|
358
|
+
return await restoreAccessorFromSession(session, overrideOptions);
|
|
359
|
+
});
|
|
360
|
+
HostAccessor.registerRestorer('default', async (session, overrideOptions) => {
|
|
361
|
+
return await restoreAccessorFromSession(session, overrideOptions);
|
|
362
|
+
});
|
|
363
|
+
//# sourceMappingURL=accessors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessors.js","sourceRoot":"","sources":["../src/accessors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAoC,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAuB,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,aA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IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,QAAgB,EAChB,eAAiC;IAEjC,OAAO,MAAM,YAAY,CAAC,eAAe,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;AACvE,CAAC;AAED,+CAA+C;AAC/C,YAAY,CAAC,gBAAgB,CAC3B,6BAA6B,EAC7B,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE;IACjC,OAAO,MAAM,0BAA0B,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AACpE,CAAC,CACF,CAAC;AAEF,YAAY,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE;IAC1E,OAAO,MAAM,0BAA0B,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AACpE,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gBAAgB,CAAC"}
|