@venos-inc/venos 0.1.3 → 0.1.5

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 (70) hide show
  1. package/dist/index.js +82 -55
  2. package/etc/mcp-server/client.js +25 -2
  3. package/etc/mcp-server/node_modules/@eslint/eslintrc/node_modules/.bin/js-yaml +2 -2
  4. package/etc/mcp-server/node_modules/@eslint-community/eslint-utils/node_modules/.bin/eslint +2 -2
  5. package/etc/mcp-server/node_modules/@typescript-eslint/eslint-plugin/node_modules/.bin/eslint +2 -2
  6. package/etc/mcp-server/node_modules/@typescript-eslint/eslint-plugin/node_modules/.bin/tsc +2 -2
  7. package/etc/mcp-server/node_modules/@typescript-eslint/eslint-plugin/node_modules/.bin/tsserver +2 -2
  8. package/etc/mcp-server/node_modules/@typescript-eslint/parser/node_modules/.bin/eslint +2 -2
  9. package/etc/mcp-server/node_modules/@typescript-eslint/parser/node_modules/.bin/tsc +2 -2
  10. package/etc/mcp-server/node_modules/@typescript-eslint/parser/node_modules/.bin/tsserver +2 -2
  11. package/etc/mcp-server/node_modules/@typescript-eslint/project-service/node_modules/.bin/tsc +2 -2
  12. package/etc/mcp-server/node_modules/@typescript-eslint/project-service/node_modules/.bin/tsserver +2 -2
  13. package/etc/mcp-server/node_modules/@typescript-eslint/tsconfig-utils/node_modules/.bin/tsc +2 -2
  14. package/etc/mcp-server/node_modules/@typescript-eslint/tsconfig-utils/node_modules/.bin/tsserver +2 -2
  15. package/etc/mcp-server/node_modules/@typescript-eslint/type-utils/node_modules/.bin/eslint +2 -2
  16. package/etc/mcp-server/node_modules/@typescript-eslint/type-utils/node_modules/.bin/tsc +2 -2
  17. package/etc/mcp-server/node_modules/@typescript-eslint/type-utils/node_modules/.bin/tsserver +2 -2
  18. package/etc/mcp-server/node_modules/@typescript-eslint/typescript-estree/node_modules/.bin/semver +2 -2
  19. package/etc/mcp-server/node_modules/@typescript-eslint/typescript-estree/node_modules/.bin/tsc +2 -2
  20. package/etc/mcp-server/node_modules/@typescript-eslint/typescript-estree/node_modules/.bin/tsserver +2 -2
  21. package/etc/mcp-server/node_modules/@typescript-eslint/utils/node_modules/.bin/eslint +2 -2
  22. package/etc/mcp-server/node_modules/@typescript-eslint/utils/node_modules/.bin/tsc +2 -2
  23. package/etc/mcp-server/node_modules/@typescript-eslint/utils/node_modules/.bin/tsserver +2 -2
  24. package/etc/mcp-server/node_modules/@vitest/mocker/node_modules/.bin/vite +4 -4
  25. package/etc/mcp-server/node_modules/acorn-jsx/node_modules/.bin/acorn +2 -2
  26. package/etc/mcp-server/node_modules/cross-spawn/node_modules/.bin/node-which +2 -2
  27. package/etc/mcp-server/node_modules/espree/node_modules/.bin/acorn +2 -2
  28. package/etc/mcp-server/node_modules/node-addon-api/LICENSE.md +6 -2
  29. package/etc/mcp-server/node_modules/node-addon-api/README.md +10 -12
  30. package/etc/mcp-server/node_modules/node-addon-api/common.gypi +2 -1
  31. package/etc/mcp-server/node_modules/node-addon-api/index.js +1 -2
  32. package/etc/mcp-server/node_modules/node-addon-api/napi-inl.h +72 -91
  33. package/etc/mcp-server/node_modules/node-addon-api/napi.h +5 -15
  34. package/etc/mcp-server/node_modules/node-addon-api/package.json +2 -18
  35. package/etc/mcp-server/node_modules/postcss/node_modules/.bin/nanoid +2 -2
  36. package/etc/mcp-server/node_modules/sharp/node_modules/.bin/semver +2 -2
  37. package/etc/mcp-server/node_modules/source-map/LICENSE +28 -0
  38. package/etc/mcp-server/node_modules/source-map/README.md +837 -0
  39. package/etc/mcp-server/node_modules/source-map/lib/array-set.js +100 -0
  40. package/etc/mcp-server/node_modules/source-map/lib/base64-vlq.js +94 -0
  41. package/etc/mcp-server/node_modules/source-map/lib/base64.js +19 -0
  42. package/etc/mcp-server/node_modules/source-map/lib/binary-search.js +113 -0
  43. package/etc/mcp-server/node_modules/source-map/lib/mapping-list.js +83 -0
  44. package/etc/mcp-server/node_modules/source-map/lib/mappings.wasm +0 -0
  45. package/etc/mcp-server/node_modules/source-map/lib/read-wasm-browser.js +23 -0
  46. package/etc/mcp-server/node_modules/source-map/lib/read-wasm.js +27 -0
  47. package/etc/mcp-server/node_modules/source-map/lib/source-map-consumer.js +1081 -0
  48. package/etc/mcp-server/node_modules/source-map/lib/source-map-generator.js +439 -0
  49. package/etc/mcp-server/node_modules/source-map/lib/source-node.js +430 -0
  50. package/etc/mcp-server/node_modules/source-map/lib/url.js +13 -0
  51. package/etc/mcp-server/node_modules/source-map/lib/util.js +444 -0
  52. package/etc/mcp-server/node_modules/source-map/lib/wasm.js +138 -0
  53. package/etc/mcp-server/node_modules/source-map/package.json +79 -0
  54. package/etc/mcp-server/node_modules/source-map/source-map.d.ts +423 -0
  55. package/etc/mcp-server/node_modules/source-map/source-map.js +10 -0
  56. package/etc/mcp-server/node_modules/ts-api-utils/node_modules/.bin/tsc +2 -2
  57. package/etc/mcp-server/node_modules/ts-api-utils/node_modules/.bin/tsserver +2 -2
  58. package/etc/mcp-server/node_modules/typescript-eslint/node_modules/.bin/eslint +2 -2
  59. package/etc/mcp-server/node_modules/typescript-eslint/node_modules/.bin/tsc +2 -2
  60. package/etc/mcp-server/node_modules/typescript-eslint/node_modules/.bin/tsserver +2 -2
  61. package/etc/mcp-server/node_modules/vite/node_modules/.bin/esbuild +2 -2
  62. package/etc/mcp-server/node_modules/vite/node_modules/.bin/rollup +2 -2
  63. package/etc/mcp-server/node_modules/vite-node/node_modules/.bin/vite +2 -2
  64. package/etc/mcp-server/node_modules/vitest/node_modules/.bin/vite +2 -2
  65. package/etc/mcp-server/node_modules/vitest/node_modules/.bin/vite-node +2 -2
  66. package/etc/mcp-server/node_modules/vitest/node_modules/.bin/why-is-node-running +2 -2
  67. package/etc/mcp-server/skill-spector.js +104 -0
  68. package/etc/mcp-server/tools.js +157 -2
  69. package/package.json +1 -1
  70. package/etc/mcp-server/node_modules/node-addon-api/node_addon_api.gyp +0 -32
@@ -0,0 +1,100 @@
1
+ /* -*- Mode: js; js-indent-level: 2; -*- */
2
+ /*
3
+ * Copyright 2011 Mozilla Foundation and contributors
4
+ * Licensed under the New BSD license. See LICENSE or:
5
+ * http://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ /**
9
+ * A data structure which is a combination of an array and a set. Adding a new
10
+ * member is O(1), testing for membership is O(1), and finding the index of an
11
+ * element is O(1). Removing elements from the set is not supported. Only
12
+ * strings are supported for membership.
13
+ */
14
+ class ArraySet {
15
+ constructor() {
16
+ this._array = [];
17
+ this._set = new Map();
18
+ }
19
+
20
+ /**
21
+ * Static method for creating ArraySet instances from an existing array.
22
+ */
23
+ static fromArray(aArray, aAllowDuplicates) {
24
+ const set = new ArraySet();
25
+ for (let i = 0, len = aArray.length; i < len; i++) {
26
+ set.add(aArray[i], aAllowDuplicates);
27
+ }
28
+ return set;
29
+ }
30
+
31
+ /**
32
+ * Return how many unique items are in this ArraySet. If duplicates have been
33
+ * added, than those do not count towards the size.
34
+ *
35
+ * @returns Number
36
+ */
37
+ size() {
38
+ return this._set.size;
39
+ }
40
+
41
+ /**
42
+ * Add the given string to this set.
43
+ *
44
+ * @param String aStr
45
+ */
46
+ add(aStr, aAllowDuplicates) {
47
+ const isDuplicate = this.has(aStr);
48
+ const idx = this._array.length;
49
+ if (!isDuplicate || aAllowDuplicates) {
50
+ this._array.push(aStr);
51
+ }
52
+ if (!isDuplicate) {
53
+ this._set.set(aStr, idx);
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Is the given string a member of this set?
59
+ *
60
+ * @param String aStr
61
+ */
62
+ has(aStr) {
63
+ return this._set.has(aStr);
64
+ }
65
+
66
+ /**
67
+ * What is the index of the given string in the array?
68
+ *
69
+ * @param String aStr
70
+ */
71
+ indexOf(aStr) {
72
+ const idx = this._set.get(aStr);
73
+ if (idx >= 0) {
74
+ return idx;
75
+ }
76
+ throw new Error('"' + aStr + '" is not in the set.');
77
+ }
78
+
79
+ /**
80
+ * What is the element at the given index?
81
+ *
82
+ * @param Number aIdx
83
+ */
84
+ at(aIdx) {
85
+ if (aIdx >= 0 && aIdx < this._array.length) {
86
+ return this._array[aIdx];
87
+ }
88
+ throw new Error("No element indexed by " + aIdx);
89
+ }
90
+
91
+ /**
92
+ * Returns the array representation of this set (which has the proper indices
93
+ * indicated by indexOf). Note that this is a copy of the internal array used
94
+ * for storing the members so that no one can mess with internal state.
95
+ */
96
+ toArray() {
97
+ return this._array.slice();
98
+ }
99
+ }
100
+ exports.ArraySet = ArraySet;
@@ -0,0 +1,94 @@
1
+ /* -*- Mode: js; js-indent-level: 2; -*- */
2
+ /*
3
+ * Copyright 2011 Mozilla Foundation and contributors
4
+ * Licensed under the New BSD license. See LICENSE or:
5
+ * http://opensource.org/licenses/BSD-3-Clause
6
+ *
7
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
8
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
9
+ *
10
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
11
+ * Redistribution and use in source and binary forms, with or without
12
+ * modification, are permitted provided that the following conditions are
13
+ * met:
14
+ *
15
+ * * Redistributions of source code must retain the above copyright
16
+ * notice, this list of conditions and the following disclaimer.
17
+ * * Redistributions in binary form must reproduce the above
18
+ * copyright notice, this list of conditions and the following
19
+ * disclaimer in the documentation and/or other materials provided
20
+ * with the distribution.
21
+ * * Neither the name of Google Inc. nor the names of its
22
+ * contributors may be used to endorse or promote products derived
23
+ * from this software without specific prior written permission.
24
+ *
25
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+ */
37
+
38
+ const base64 = require("./base64");
39
+
40
+ // A single base 64 digit can contain 6 bits of data. For the base 64 variable
41
+ // length quantities we use in the source map spec, the first bit is the sign,
42
+ // the next four bits are the actual value, and the 6th bit is the
43
+ // continuation bit. The continuation bit tells us whether there are more
44
+ // digits in this value following this digit.
45
+ //
46
+ // Continuation
47
+ // | Sign
48
+ // | |
49
+ // V V
50
+ // 101011
51
+
52
+ const VLQ_BASE_SHIFT = 5;
53
+
54
+ // binary: 100000
55
+ const VLQ_BASE = 1 << VLQ_BASE_SHIFT;
56
+
57
+ // binary: 011111
58
+ const VLQ_BASE_MASK = VLQ_BASE - 1;
59
+
60
+ // binary: 100000
61
+ const VLQ_CONTINUATION_BIT = VLQ_BASE;
62
+
63
+ /**
64
+ * Converts from a two-complement value to a value where the sign bit is
65
+ * placed in the least significant bit. For example, as decimals:
66
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
67
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
68
+ */
69
+ function toVLQSigned(aValue) {
70
+ return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
71
+ }
72
+
73
+ /**
74
+ * Returns the base 64 VLQ encoded value.
75
+ */
76
+ exports.encode = function base64VLQ_encode(aValue) {
77
+ let encoded = "";
78
+ let digit;
79
+
80
+ let vlq = toVLQSigned(aValue);
81
+
82
+ do {
83
+ digit = vlq & VLQ_BASE_MASK;
84
+ vlq >>>= VLQ_BASE_SHIFT;
85
+ if (vlq > 0) {
86
+ // There are still more digits in this value, so we must make sure the
87
+ // continuation bit is marked.
88
+ digit |= VLQ_CONTINUATION_BIT;
89
+ }
90
+ encoded += base64.encode(digit);
91
+ } while (vlq > 0);
92
+
93
+ return encoded;
94
+ };
@@ -0,0 +1,19 @@
1
+ /* -*- Mode: js; js-indent-level: 2; -*- */
2
+ /*
3
+ * Copyright 2011 Mozilla Foundation and contributors
4
+ * Licensed under the New BSD license. See LICENSE or:
5
+ * http://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ const intToCharMap =
9
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
10
+
11
+ /**
12
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
13
+ */
14
+ exports.encode = function (number) {
15
+ if (0 <= number && number < intToCharMap.length) {
16
+ return intToCharMap[number];
17
+ }
18
+ throw new TypeError("Must be between 0 and 63: " + number);
19
+ };
@@ -0,0 +1,113 @@
1
+ /* -*- Mode: js; js-indent-level: 2; -*- */
2
+ /*
3
+ * Copyright 2011 Mozilla Foundation and contributors
4
+ * Licensed under the New BSD license. See LICENSE or:
5
+ * http://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ exports.GREATEST_LOWER_BOUND = 1;
9
+ exports.LEAST_UPPER_BOUND = 2;
10
+
11
+ /**
12
+ * Recursive implementation of binary search.
13
+ *
14
+ * @param aLow Indices here and lower do not contain the needle.
15
+ * @param aHigh Indices here and higher do not contain the needle.
16
+ * @param aNeedle The element being searched for.
17
+ * @param aHaystack The non-empty array being searched.
18
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
19
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
20
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
21
+ * closest element that is smaller than or greater than the one we are
22
+ * searching for, respectively, if the exact element cannot be found.
23
+ */
24
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
25
+ // This function terminates when one of the following is true:
26
+ //
27
+ // 1. We find the exact element we are looking for.
28
+ //
29
+ // 2. We did not find the exact element, but we can return the index of
30
+ // the next-closest element.
31
+ //
32
+ // 3. We did not find the exact element, and there is no next-closest
33
+ // element than the one we are searching for, so we return -1.
34
+ const mid = Math.floor((aHigh - aLow) / 2) + aLow;
35
+ const cmp = aCompare(aNeedle, aHaystack[mid], true);
36
+ if (cmp === 0) {
37
+ // Found the element we are looking for.
38
+ return mid;
39
+ } else if (cmp > 0) {
40
+ // Our needle is greater than aHaystack[mid].
41
+ if (aHigh - mid > 1) {
42
+ // The element is in the upper half.
43
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
44
+ }
45
+
46
+ // The exact needle element was not found in this haystack. Determine if
47
+ // we are in termination case (3) or (2) and return the appropriate thing.
48
+ if (aBias === exports.LEAST_UPPER_BOUND) {
49
+ return aHigh < aHaystack.length ? aHigh : -1;
50
+ }
51
+ return mid;
52
+ }
53
+
54
+ // Our needle is less than aHaystack[mid].
55
+ if (mid - aLow > 1) {
56
+ // The element is in the lower half.
57
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
58
+ }
59
+
60
+ // we are in termination case (3) or (2) and return the appropriate thing.
61
+ if (aBias == exports.LEAST_UPPER_BOUND) {
62
+ return mid;
63
+ }
64
+ return aLow < 0 ? -1 : aLow;
65
+ }
66
+
67
+ /**
68
+ * This is an implementation of binary search which will always try and return
69
+ * the index of the closest element if there is no exact hit. This is because
70
+ * mappings between original and generated line/col pairs are single points,
71
+ * and there is an implicit region between each of them, so a miss just means
72
+ * that you aren't on the very start of a region.
73
+ *
74
+ * @param aNeedle The element you are looking for.
75
+ * @param aHaystack The array that is being searched.
76
+ * @param aCompare A function which takes the needle and an element in the
77
+ * array and returns -1, 0, or 1 depending on whether the needle is less
78
+ * than, equal to, or greater than the element, respectively.
79
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
80
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
81
+ * closest element that is smaller than or greater than the one we are
82
+ * searching for, respectively, if the exact element cannot be found.
83
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
84
+ */
85
+ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
86
+ if (aHaystack.length === 0) {
87
+ return -1;
88
+ }
89
+
90
+ let index = recursiveSearch(
91
+ -1,
92
+ aHaystack.length,
93
+ aNeedle,
94
+ aHaystack,
95
+ aCompare,
96
+ aBias || exports.GREATEST_LOWER_BOUND
97
+ );
98
+ if (index < 0) {
99
+ return -1;
100
+ }
101
+
102
+ // We have found either the exact element, or the next-closest element to
103
+ // the one we are searching for. However, there may be more than one such
104
+ // element. Make sure we always return the smallest of these.
105
+ while (index - 1 >= 0) {
106
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
107
+ break;
108
+ }
109
+ --index;
110
+ }
111
+
112
+ return index;
113
+ };
@@ -0,0 +1,83 @@
1
+ /* -*- Mode: js; js-indent-level: 2; -*- */
2
+ /*
3
+ * Copyright 2014 Mozilla Foundation and contributors
4
+ * Licensed under the New BSD license. See LICENSE or:
5
+ * http://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ const util = require("./util");
9
+
10
+ /**
11
+ * Determine whether mappingB is after mappingA with respect to generated
12
+ * position.
13
+ */
14
+ function generatedPositionAfter(mappingA, mappingB) {
15
+ // Optimized for most common case
16
+ const lineA = mappingA.generatedLine;
17
+ const lineB = mappingB.generatedLine;
18
+ const columnA = mappingA.generatedColumn;
19
+ const columnB = mappingB.generatedColumn;
20
+ return (
21
+ lineB > lineA ||
22
+ (lineB == lineA && columnB >= columnA) ||
23
+ util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0
24
+ );
25
+ }
26
+
27
+ /**
28
+ * A data structure to provide a sorted view of accumulated mappings in a
29
+ * performance conscious manner. It trades a negligible overhead in general
30
+ * case for a large speedup in case of mappings being added in order.
31
+ */
32
+ class MappingList {
33
+ constructor() {
34
+ this._array = [];
35
+ this._sorted = true;
36
+ // Serves as infimum
37
+ this._last = { generatedLine: -1, generatedColumn: 0 };
38
+ }
39
+
40
+ /**
41
+ * Iterate through internal items. This method takes the same arguments that
42
+ * `Array.prototype.forEach` takes.
43
+ *
44
+ * NOTE: The order of the mappings is NOT guaranteed.
45
+ */
46
+ unsortedForEach(aCallback, aThisArg) {
47
+ this._array.forEach(aCallback, aThisArg);
48
+ }
49
+
50
+ /**
51
+ * Add the given source mapping.
52
+ *
53
+ * @param Object aMapping
54
+ */
55
+ add(aMapping) {
56
+ if (generatedPositionAfter(this._last, aMapping)) {
57
+ this._last = aMapping;
58
+ this._array.push(aMapping);
59
+ } else {
60
+ this._sorted = false;
61
+ this._array.push(aMapping);
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
67
+ * generated position.
68
+ *
69
+ * WARNING: This method returns internal data without copying, for
70
+ * performance. The return value must NOT be mutated, and should be treated as
71
+ * an immutable borrow. If you want to take ownership, you must make your own
72
+ * copy.
73
+ */
74
+ toArray() {
75
+ if (!this._sorted) {
76
+ this._array.sort(util.compareByGeneratedPositionsInflated);
77
+ this._sorted = true;
78
+ }
79
+ return this._array;
80
+ }
81
+ }
82
+
83
+ exports.MappingList = MappingList;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ let mappingsWasm = null;
4
+
5
+ module.exports = function readWasm() {
6
+ if (typeof mappingsWasm === "string") {
7
+ return fetch(mappingsWasm).then(response => response.arrayBuffer());
8
+ }
9
+ if (mappingsWasm instanceof ArrayBuffer) {
10
+ return Promise.resolve(mappingsWasm);
11
+ }
12
+
13
+ throw new Error(
14
+ "You must provide the string URL or ArrayBuffer contents " +
15
+ "of lib/mappings.wasm by calling " +
16
+ "SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) " +
17
+ "before using SourceMapConsumer"
18
+ );
19
+ };
20
+
21
+ module.exports.initialize = input => {
22
+ mappingsWasm = input;
23
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ // Note: This file is replaced with "read-wasm-browser.js" when this module is
4
+ // bundled with a packager that takes package.json#browser fields into account.
5
+
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+
9
+ module.exports = function readWasm() {
10
+ return new Promise((resolve, reject) => {
11
+ const wasmPath = path.join(__dirname, "mappings.wasm");
12
+ fs.readFile(wasmPath, null, (error, data) => {
13
+ if (error) {
14
+ reject(error);
15
+ return;
16
+ }
17
+
18
+ resolve(data.buffer);
19
+ });
20
+ });
21
+ };
22
+
23
+ module.exports.initialize = _ => {
24
+ console.debug(
25
+ "SourceMapConsumer.initialize is a no-op when running in node.js"
26
+ );
27
+ };