spec-cat 0.1.0 → 0.1.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.
Files changed (110) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Bqlz6CoK.js → BE_75kPa.js} +1 -1
  3. package/.output/public/_nuxt/{B2wdmh_w.js → BJ7m4fRW.js} +53 -53
  4. package/.output/public/_nuxt/{KNuzSjk0.js → CCNYUZ9m.js} +1 -1
  5. package/.output/public/_nuxt/{BvosqTnx.js → DGtcdWVl.js} +1 -1
  6. package/.output/public/_nuxt/DxEx-kFx.js +1 -0
  7. package/.output/public/_nuxt/{BwcbSlWF.js → DyMq_cQC.js} +2 -2
  8. package/.output/public/_nuxt/{COTT6rNZ.js → _cj5lOdZ.js} +1 -1
  9. package/.output/public/_nuxt/builds/latest.json +1 -1
  10. package/.output/public/_nuxt/builds/meta/3a0aacc1-0bd1-4d15-8b8a-3cee48cbfc69.json +1 -0
  11. package/.output/public/_nuxt/{BUOk7wkI.js → gDut6QrP.js} +1 -1
  12. package/.output/public/_nuxt/{C5wk2twv.js → nJpWpjzg.js} +1 -1
  13. package/.output/public/_nuxt/{DBab5Zcv.js → waQ9fPC1.js} +1 -1
  14. package/.output/server/chunks/_/codexProvider.mjs +64 -18
  15. package/.output/server/chunks/_/codexProvider.mjs.map +1 -1
  16. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  17. package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
  18. package/.output/server/chunks/nitro/nitro.mjs +702 -703
  19. package/.output/server/chunks/routes/_ws.mjs +37 -7
  20. package/.output/server/chunks/routes/_ws.mjs.map +1 -1
  21. package/.output/server/node_modules/@huggingface/jinja/dist/index.js +1572 -0
  22. package/.output/server/node_modules/@huggingface/jinja/package.json +55 -0
  23. package/.output/server/node_modules/@xenova/transformers/package.json +84 -0
  24. package/.output/server/node_modules/@xenova/transformers/src/backends/onnx.js +50 -0
  25. package/.output/server/node_modules/@xenova/transformers/src/configs.js +107 -0
  26. package/.output/server/node_modules/@xenova/transformers/src/env.js +128 -0
  27. package/.output/server/node_modules/@xenova/transformers/src/models.js +6267 -0
  28. package/.output/server/node_modules/@xenova/transformers/src/pipelines.js +3287 -0
  29. package/.output/server/node_modules/@xenova/transformers/src/processors.js +2248 -0
  30. package/.output/server/node_modules/@xenova/transformers/src/tokenizers.js +4479 -0
  31. package/.output/server/node_modules/@xenova/transformers/src/transformers.js +24 -0
  32. package/.output/server/node_modules/@xenova/transformers/src/utils/audio.js +672 -0
  33. package/.output/server/node_modules/@xenova/transformers/src/utils/core.js +175 -0
  34. package/.output/server/node_modules/@xenova/transformers/src/utils/data-structures.js +415 -0
  35. package/.output/server/node_modules/@xenova/transformers/src/utils/generation.js +873 -0
  36. package/.output/server/node_modules/@xenova/transformers/src/utils/hub.js +658 -0
  37. package/.output/server/node_modules/@xenova/transformers/src/utils/image.js +731 -0
  38. package/.output/server/node_modules/@xenova/transformers/src/utils/maths.js +985 -0
  39. package/.output/server/node_modules/@xenova/transformers/src/utils/tensor.js +1239 -0
  40. package/.output/server/node_modules/color/index.js +496 -0
  41. package/.output/server/node_modules/color/package.json +47 -0
  42. package/.output/server/node_modules/color-convert/conversions.js +839 -0
  43. package/.output/server/node_modules/color-convert/index.js +81 -0
  44. package/.output/server/node_modules/color-convert/package.json +48 -0
  45. package/.output/server/node_modules/color-convert/route.js +97 -0
  46. package/.output/server/node_modules/color-name/index.js +152 -0
  47. package/.output/server/node_modules/color-name/package.json +28 -0
  48. package/.output/server/node_modules/color-string/index.js +242 -0
  49. package/.output/server/node_modules/color-string/package.json +39 -0
  50. package/.output/server/node_modules/detect-libc/lib/detect-libc.js +313 -0
  51. package/.output/server/node_modules/detect-libc/lib/elf.js +39 -0
  52. package/.output/server/node_modules/detect-libc/lib/filesystem.js +51 -0
  53. package/.output/server/node_modules/detect-libc/lib/process.js +24 -0
  54. package/.output/server/node_modules/detect-libc/package.json +44 -0
  55. package/.output/server/node_modules/is-arrayish/index.js +9 -0
  56. package/.output/server/node_modules/is-arrayish/package.json +45 -0
  57. package/.output/server/node_modules/onnxruntime-common/dist/ort-common.node.js +7 -0
  58. package/.output/server/node_modules/onnxruntime-common/package.json +31 -0
  59. package/.output/server/node_modules/onnxruntime-node/bin/napi-v3/darwin/arm64/onnxruntime_binding.node +0 -0
  60. package/.output/server/node_modules/onnxruntime-node/bin/napi-v3/darwin/x64/onnxruntime_binding.node +0 -0
  61. package/.output/server/node_modules/onnxruntime-node/bin/napi-v3/linux/arm64/libonnxruntime.so.1.14.0 +0 -0
  62. package/.output/server/node_modules/onnxruntime-node/bin/napi-v3/linux/arm64/onnxruntime_binding.node +0 -0
  63. package/.output/server/node_modules/onnxruntime-node/bin/napi-v3/linux/x64/libonnxruntime.so.1.14.0 +0 -0
  64. package/.output/server/node_modules/onnxruntime-node/bin/napi-v3/linux/x64/onnxruntime_binding.node +0 -0
  65. package/.output/server/node_modules/onnxruntime-node/bin/napi-v3/win32/arm64/onnxruntime_binding.node +0 -0
  66. package/.output/server/node_modules/onnxruntime-node/bin/napi-v3/win32/x64/onnxruntime_binding.node +0 -0
  67. package/.output/server/node_modules/onnxruntime-node/dist/backend.js +75 -0
  68. package/.output/server/node_modules/onnxruntime-node/dist/binding.js +10 -0
  69. package/.output/server/node_modules/onnxruntime-node/dist/index.js +23 -0
  70. package/.output/server/node_modules/onnxruntime-node/package.json +58 -0
  71. package/.output/server/node_modules/onnxruntime-web/dist/ort-web.node.js +7 -0
  72. package/.output/server/node_modules/onnxruntime-web/package.json +84 -0
  73. package/.output/server/node_modules/semver/classes/semver.js +333 -0
  74. package/.output/server/node_modules/semver/functions/coerce.js +62 -0
  75. package/.output/server/node_modules/semver/functions/compare.js +7 -0
  76. package/.output/server/node_modules/semver/functions/gte.js +5 -0
  77. package/.output/server/node_modules/semver/functions/parse.js +18 -0
  78. package/.output/server/node_modules/semver/internal/constants.js +37 -0
  79. package/.output/server/node_modules/semver/internal/debug.js +11 -0
  80. package/.output/server/node_modules/semver/internal/identifiers.js +29 -0
  81. package/.output/server/node_modules/semver/internal/parse-options.js +17 -0
  82. package/.output/server/node_modules/semver/internal/re.js +223 -0
  83. package/.output/server/node_modules/semver/package.json +78 -0
  84. package/.output/server/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
  85. package/.output/server/node_modules/sharp/lib/channel.js +174 -0
  86. package/.output/server/node_modules/sharp/lib/colour.js +184 -0
  87. package/.output/server/node_modules/sharp/lib/composite.js +210 -0
  88. package/.output/server/node_modules/sharp/lib/constructor.js +439 -0
  89. package/.output/server/node_modules/sharp/lib/index.js +16 -0
  90. package/.output/server/node_modules/sharp/lib/input.js +631 -0
  91. package/.output/server/node_modules/sharp/lib/is.js +155 -0
  92. package/.output/server/node_modules/sharp/lib/libvips.js +140 -0
  93. package/.output/server/node_modules/sharp/lib/operation.js +919 -0
  94. package/.output/server/node_modules/sharp/lib/output.js +1413 -0
  95. package/.output/server/node_modules/sharp/lib/platform.js +30 -0
  96. package/.output/server/node_modules/sharp/lib/resize.js +582 -0
  97. package/.output/server/node_modules/sharp/lib/sharp.js +38 -0
  98. package/.output/server/node_modules/sharp/lib/utility.js +287 -0
  99. package/.output/server/node_modules/sharp/package.json +204 -0
  100. package/.output/server/node_modules/sharp/vendor/8.14.5/linux-x64/THIRD-PARTY-NOTICES.md +43 -0
  101. package/.output/server/node_modules/sharp/vendor/8.14.5/linux-x64/lib/libvips-cpp.so.42 +0 -0
  102. package/.output/server/node_modules/sharp/vendor/8.14.5/linux-x64/platform.json +1 -0
  103. package/.output/server/node_modules/sharp/vendor/8.14.5/linux-x64/versions.json +31 -0
  104. package/.output/server/node_modules/simple-swizzle/index.js +29 -0
  105. package/.output/server/node_modules/simple-swizzle/package.json +36 -0
  106. package/.output/server/package.json +15 -1
  107. package/README.md +2 -0
  108. package/package.json +12 -19
  109. package/.output/public/_nuxt/5FxpIoe_.js +0 -1
  110. package/.output/public/_nuxt/builds/meta/21578a05-1b7e-4847-a8ff-7480800ea4a6.json +0 -1
@@ -0,0 +1,313 @@
1
+ // Copyright 2017 Lovell Fuller and others.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ 'use strict';
5
+
6
+ const childProcess = require('child_process');
7
+ const { isLinux, getReport } = require('./process');
8
+ const { LDD_PATH, SELF_PATH, readFile, readFileSync } = require('./filesystem');
9
+ const { interpreterPath } = require('./elf');
10
+
11
+ let cachedFamilyInterpreter;
12
+ let cachedFamilyFilesystem;
13
+ let cachedVersionFilesystem;
14
+
15
+ const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true';
16
+ let commandOut = '';
17
+
18
+ const safeCommand = () => {
19
+ if (!commandOut) {
20
+ return new Promise((resolve) => {
21
+ childProcess.exec(command, (err, out) => {
22
+ commandOut = err ? ' ' : out;
23
+ resolve(commandOut);
24
+ });
25
+ });
26
+ }
27
+ return commandOut;
28
+ };
29
+
30
+ const safeCommandSync = () => {
31
+ if (!commandOut) {
32
+ try {
33
+ commandOut = childProcess.execSync(command, { encoding: 'utf8' });
34
+ } catch (_err) {
35
+ commandOut = ' ';
36
+ }
37
+ }
38
+ return commandOut;
39
+ };
40
+
41
+ /**
42
+ * A String constant containing the value `glibc`.
43
+ * @type {string}
44
+ * @public
45
+ */
46
+ const GLIBC = 'glibc';
47
+
48
+ /**
49
+ * A Regexp constant to get the GLIBC Version.
50
+ * @type {string}
51
+ */
52
+ const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
53
+
54
+ /**
55
+ * A String constant containing the value `musl`.
56
+ * @type {string}
57
+ * @public
58
+ */
59
+ const MUSL = 'musl';
60
+
61
+ const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-');
62
+
63
+ const familyFromReport = () => {
64
+ const report = getReport();
65
+ if (report.header && report.header.glibcVersionRuntime) {
66
+ return GLIBC;
67
+ }
68
+ if (Array.isArray(report.sharedObjects)) {
69
+ if (report.sharedObjects.some(isFileMusl)) {
70
+ return MUSL;
71
+ }
72
+ }
73
+ return null;
74
+ };
75
+
76
+ const familyFromCommand = (out) => {
77
+ const [getconf, ldd1] = out.split(/[\r\n]+/);
78
+ if (getconf && getconf.includes(GLIBC)) {
79
+ return GLIBC;
80
+ }
81
+ if (ldd1 && ldd1.includes(MUSL)) {
82
+ return MUSL;
83
+ }
84
+ return null;
85
+ };
86
+
87
+ const familyFromInterpreterPath = (path) => {
88
+ if (path) {
89
+ if (path.includes('/ld-musl-')) {
90
+ return MUSL;
91
+ } else if (path.includes('/ld-linux-')) {
92
+ return GLIBC;
93
+ }
94
+ }
95
+ return null;
96
+ };
97
+
98
+ const getFamilyFromLddContent = (content) => {
99
+ content = content.toString();
100
+ if (content.includes('musl')) {
101
+ return MUSL;
102
+ }
103
+ if (content.includes('GNU C Library')) {
104
+ return GLIBC;
105
+ }
106
+ return null;
107
+ };
108
+
109
+ const familyFromFilesystem = async () => {
110
+ if (cachedFamilyFilesystem !== undefined) {
111
+ return cachedFamilyFilesystem;
112
+ }
113
+ cachedFamilyFilesystem = null;
114
+ try {
115
+ const lddContent = await readFile(LDD_PATH);
116
+ cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
117
+ } catch (e) {}
118
+ return cachedFamilyFilesystem;
119
+ };
120
+
121
+ const familyFromFilesystemSync = () => {
122
+ if (cachedFamilyFilesystem !== undefined) {
123
+ return cachedFamilyFilesystem;
124
+ }
125
+ cachedFamilyFilesystem = null;
126
+ try {
127
+ const lddContent = readFileSync(LDD_PATH);
128
+ cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
129
+ } catch (e) {}
130
+ return cachedFamilyFilesystem;
131
+ };
132
+
133
+ const familyFromInterpreter = async () => {
134
+ if (cachedFamilyInterpreter !== undefined) {
135
+ return cachedFamilyInterpreter;
136
+ }
137
+ cachedFamilyInterpreter = null;
138
+ try {
139
+ const selfContent = await readFile(SELF_PATH);
140
+ const path = interpreterPath(selfContent);
141
+ cachedFamilyInterpreter = familyFromInterpreterPath(path);
142
+ } catch (e) {}
143
+ return cachedFamilyInterpreter;
144
+ };
145
+
146
+ const familyFromInterpreterSync = () => {
147
+ if (cachedFamilyInterpreter !== undefined) {
148
+ return cachedFamilyInterpreter;
149
+ }
150
+ cachedFamilyInterpreter = null;
151
+ try {
152
+ const selfContent = readFileSync(SELF_PATH);
153
+ const path = interpreterPath(selfContent);
154
+ cachedFamilyInterpreter = familyFromInterpreterPath(path);
155
+ } catch (e) {}
156
+ return cachedFamilyInterpreter;
157
+ };
158
+
159
+ /**
160
+ * Resolves with the libc family when it can be determined, `null` otherwise.
161
+ * @returns {Promise<?string>}
162
+ */
163
+ const family = async () => {
164
+ let family = null;
165
+ if (isLinux()) {
166
+ family = await familyFromInterpreter();
167
+ if (!family) {
168
+ family = await familyFromFilesystem();
169
+ if (!family) {
170
+ family = familyFromReport();
171
+ }
172
+ if (!family) {
173
+ const out = await safeCommand();
174
+ family = familyFromCommand(out);
175
+ }
176
+ }
177
+ }
178
+ return family;
179
+ };
180
+
181
+ /**
182
+ * Returns the libc family when it can be determined, `null` otherwise.
183
+ * @returns {?string}
184
+ */
185
+ const familySync = () => {
186
+ let family = null;
187
+ if (isLinux()) {
188
+ family = familyFromInterpreterSync();
189
+ if (!family) {
190
+ family = familyFromFilesystemSync();
191
+ if (!family) {
192
+ family = familyFromReport();
193
+ }
194
+ if (!family) {
195
+ const out = safeCommandSync();
196
+ family = familyFromCommand(out);
197
+ }
198
+ }
199
+ }
200
+ return family;
201
+ };
202
+
203
+ /**
204
+ * Resolves `true` only when the platform is Linux and the libc family is not `glibc`.
205
+ * @returns {Promise<boolean>}
206
+ */
207
+ const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;
208
+
209
+ /**
210
+ * Returns `true` only when the platform is Linux and the libc family is not `glibc`.
211
+ * @returns {boolean}
212
+ */
213
+ const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
214
+
215
+ const versionFromFilesystem = async () => {
216
+ if (cachedVersionFilesystem !== undefined) {
217
+ return cachedVersionFilesystem;
218
+ }
219
+ cachedVersionFilesystem = null;
220
+ try {
221
+ const lddContent = await readFile(LDD_PATH);
222
+ const versionMatch = lddContent.match(RE_GLIBC_VERSION);
223
+ if (versionMatch) {
224
+ cachedVersionFilesystem = versionMatch[1];
225
+ }
226
+ } catch (e) {}
227
+ return cachedVersionFilesystem;
228
+ };
229
+
230
+ const versionFromFilesystemSync = () => {
231
+ if (cachedVersionFilesystem !== undefined) {
232
+ return cachedVersionFilesystem;
233
+ }
234
+ cachedVersionFilesystem = null;
235
+ try {
236
+ const lddContent = readFileSync(LDD_PATH);
237
+ const versionMatch = lddContent.match(RE_GLIBC_VERSION);
238
+ if (versionMatch) {
239
+ cachedVersionFilesystem = versionMatch[1];
240
+ }
241
+ } catch (e) {}
242
+ return cachedVersionFilesystem;
243
+ };
244
+
245
+ const versionFromReport = () => {
246
+ const report = getReport();
247
+ if (report.header && report.header.glibcVersionRuntime) {
248
+ return report.header.glibcVersionRuntime;
249
+ }
250
+ return null;
251
+ };
252
+
253
+ const versionSuffix = (s) => s.trim().split(/\s+/)[1];
254
+
255
+ const versionFromCommand = (out) => {
256
+ const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/);
257
+ if (getconf && getconf.includes(GLIBC)) {
258
+ return versionSuffix(getconf);
259
+ }
260
+ if (ldd1 && ldd2 && ldd1.includes(MUSL)) {
261
+ return versionSuffix(ldd2);
262
+ }
263
+ return null;
264
+ };
265
+
266
+ /**
267
+ * Resolves with the libc version when it can be determined, `null` otherwise.
268
+ * @returns {Promise<?string>}
269
+ */
270
+ const version = async () => {
271
+ let version = null;
272
+ if (isLinux()) {
273
+ version = await versionFromFilesystem();
274
+ if (!version) {
275
+ version = versionFromReport();
276
+ }
277
+ if (!version) {
278
+ const out = await safeCommand();
279
+ version = versionFromCommand(out);
280
+ }
281
+ }
282
+ return version;
283
+ };
284
+
285
+ /**
286
+ * Returns the libc version when it can be determined, `null` otherwise.
287
+ * @returns {?string}
288
+ */
289
+ const versionSync = () => {
290
+ let version = null;
291
+ if (isLinux()) {
292
+ version = versionFromFilesystemSync();
293
+ if (!version) {
294
+ version = versionFromReport();
295
+ }
296
+ if (!version) {
297
+ const out = safeCommandSync();
298
+ version = versionFromCommand(out);
299
+ }
300
+ }
301
+ return version;
302
+ };
303
+
304
+ module.exports = {
305
+ GLIBC,
306
+ MUSL,
307
+ family,
308
+ familySync,
309
+ isNonGlibcLinux,
310
+ isNonGlibcLinuxSync,
311
+ version,
312
+ versionSync
313
+ };
@@ -0,0 +1,39 @@
1
+ // Copyright 2017 Lovell Fuller and others.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ 'use strict';
5
+
6
+ const interpreterPath = (elf) => {
7
+ if (elf.length < 64) {
8
+ return null;
9
+ }
10
+ if (elf.readUInt32BE(0) !== 0x7F454C46) {
11
+ // Unexpected magic bytes
12
+ return null;
13
+ }
14
+ if (elf.readUInt8(4) !== 2) {
15
+ // Not a 64-bit ELF
16
+ return null;
17
+ }
18
+ if (elf.readUInt8(5) !== 1) {
19
+ // Not little-endian
20
+ return null;
21
+ }
22
+ const offset = elf.readUInt32LE(32);
23
+ const size = elf.readUInt16LE(54);
24
+ const count = elf.readUInt16LE(56);
25
+ for (let i = 0; i < count; i++) {
26
+ const headerOffset = offset + (i * size);
27
+ const type = elf.readUInt32LE(headerOffset);
28
+ if (type === 3) {
29
+ const fileOffset = elf.readUInt32LE(headerOffset + 8);
30
+ const fileSize = elf.readUInt32LE(headerOffset + 32);
31
+ return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, '');
32
+ }
33
+ }
34
+ return null;
35
+ };
36
+
37
+ module.exports = {
38
+ interpreterPath
39
+ };
@@ -0,0 +1,51 @@
1
+ // Copyright 2017 Lovell Fuller and others.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ 'use strict';
5
+
6
+ const fs = require('fs');
7
+
8
+ const LDD_PATH = '/usr/bin/ldd';
9
+ const SELF_PATH = '/proc/self/exe';
10
+ const MAX_LENGTH = 2048;
11
+
12
+ /**
13
+ * Read the content of a file synchronous
14
+ *
15
+ * @param {string} path
16
+ * @returns {Buffer}
17
+ */
18
+ const readFileSync = (path) => {
19
+ const fd = fs.openSync(path, 'r');
20
+ const buffer = Buffer.alloc(MAX_LENGTH);
21
+ const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0);
22
+ fs.close(fd, () => {});
23
+ return buffer.subarray(0, bytesRead);
24
+ };
25
+
26
+ /**
27
+ * Read the content of a file
28
+ *
29
+ * @param {string} path
30
+ * @returns {Promise<Buffer>}
31
+ */
32
+ const readFile = (path) => new Promise((resolve, reject) => {
33
+ fs.open(path, 'r', (err, fd) => {
34
+ if (err) {
35
+ reject(err);
36
+ } else {
37
+ const buffer = Buffer.alloc(MAX_LENGTH);
38
+ fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
39
+ resolve(buffer.subarray(0, bytesRead));
40
+ fs.close(fd, () => {});
41
+ });
42
+ }
43
+ });
44
+ });
45
+
46
+ module.exports = {
47
+ LDD_PATH,
48
+ SELF_PATH,
49
+ readFileSync,
50
+ readFile
51
+ };
@@ -0,0 +1,24 @@
1
+ // Copyright 2017 Lovell Fuller and others.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ 'use strict';
5
+
6
+ const isLinux = () => process.platform === 'linux';
7
+
8
+ let report = null;
9
+ const getReport = () => {
10
+ if (!report) {
11
+ /* istanbul ignore next */
12
+ if (isLinux() && process.report) {
13
+ const orig = process.report.excludeNetwork;
14
+ process.report.excludeNetwork = true;
15
+ report = process.report.getReport();
16
+ process.report.excludeNetwork = orig;
17
+ } else {
18
+ report = {};
19
+ }
20
+ }
21
+ return report;
22
+ };
23
+
24
+ module.exports = { isLinux, getReport };
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "detect-libc",
3
+ "version": "2.1.2",
4
+ "description": "Node.js module to detect the C standard library (libc) implementation family and version",
5
+ "main": "lib/detect-libc.js",
6
+ "files": [
7
+ "lib/",
8
+ "index.d.ts"
9
+ ],
10
+ "scripts": {
11
+ "test": "semistandard && nyc --reporter=text --check-coverage --branches=100 ava test/unit.js",
12
+ "changelog": "conventional-changelog -i CHANGELOG.md -s",
13
+ "bench": "node benchmark/detect-libc",
14
+ "bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git://github.com/lovell/detect-libc.git"
19
+ },
20
+ "keywords": [
21
+ "libc",
22
+ "glibc",
23
+ "musl"
24
+ ],
25
+ "author": "Lovell Fuller <npm@lovell.info>",
26
+ "contributors": [
27
+ "Niklas Salmoukas <niklas@salmoukas.com>",
28
+ "Vinícius Lourenço <vinyygamerlol@gmail.com>"
29
+ ],
30
+ "license": "Apache-2.0",
31
+ "devDependencies": {
32
+ "ava": "^2.4.0",
33
+ "benchmark": "^2.1.4",
34
+ "conventional-changelog-cli": "^5.0.0",
35
+ "eslint-config-standard": "^13.0.1",
36
+ "nyc": "^15.1.0",
37
+ "proxyquire": "^2.1.3",
38
+ "semistandard": "^14.2.3"
39
+ },
40
+ "engines": {
41
+ "node": ">=8"
42
+ },
43
+ "types": "index.d.ts"
44
+ }
@@ -0,0 +1,9 @@
1
+ module.exports = function isArrayish(obj) {
2
+ if (!obj || typeof obj === 'string') {
3
+ return false;
4
+ }
5
+
6
+ return obj instanceof Array || Array.isArray(obj) ||
7
+ (obj.length >= 0 && (obj.splice instanceof Function ||
8
+ (Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));
9
+ };
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "is-arrayish",
3
+ "description": "Determines if an object can be used as an array",
4
+ "version": "0.3.4",
5
+ "author": "Qix (http://github.com/qix-)",
6
+ "keywords": [
7
+ "is",
8
+ "array",
9
+ "duck",
10
+ "type",
11
+ "arrayish",
12
+ "similar",
13
+ "proto",
14
+ "prototype",
15
+ "type"
16
+ ],
17
+ "license": "MIT",
18
+ "scripts": {
19
+ "test": "mocha --require coffeescript/register ./test/**/*.coffee",
20
+ "lint": "zeit-eslint --ext .jsx,.js .",
21
+ "lint-staged": "git diff --diff-filter=ACMRT --cached --name-only '*.js' '*.jsx' | xargs zeit-eslint"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/qix-/node-is-arrayish.git"
26
+ },
27
+ "devDependencies": {
28
+ "@zeit/eslint-config-node": "^0.3.0",
29
+ "@zeit/git-hooks": "^0.1.4",
30
+ "coffeescript": "^2.3.1",
31
+ "coveralls": "^3.0.1",
32
+ "eslint": "^4.19.1",
33
+ "istanbul": "^0.4.5",
34
+ "mocha": "^5.2.0",
35
+ "should": "^13.2.1"
36
+ },
37
+ "eslintConfig": {
38
+ "extends": [
39
+ "@zeit/eslint-config-node"
40
+ ]
41
+ },
42
+ "git": {
43
+ "pre-commit": "lint-staged"
44
+ }
45
+ }
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * ONNX Runtime Common v1.14.0
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ (()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{InferenceSession:()=>c,Tensor:()=>g,env:()=>i,registerBackend:()=>o});const r={},n=[],o=(e,t,o)=>{if(!t||"function"!=typeof t.init||"function"!=typeof t.createSessionHandler)throw new TypeError("not a valid backend");{const i=r[e];if(void 0===i)r[e]={backend:t,priority:o};else{if(i.priority>o)return;if(i.priority===o&&i.backend!==t)throw new Error(`cannot register backend "${e}" using priority ${o}`)}if(o>=0){const t=n.indexOf(e);-1!==t&&n.splice(t,1);for(let t=0;t<n.length;t++)if(r[n[t]].priority<=o)return void n.splice(t,0,e);n.push(e)}}},i=new class{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(e){if(void 0!==e){if("string"!=typeof e||-1===["verbose","info","warning","error","fatal"].indexOf(e))throw new Error(`Unsupported logging level: ${e}`);this.logLevelInternal=e}}get logLevel(){return this.logLevelInternal}},a="undefined"!=typeof BigInt64Array&&"function"==typeof BigInt64Array.from,s="undefined"!=typeof BigUint64Array&&"function"==typeof BigUint64Array.from,d=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),f=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);a&&(d.set("int64",BigInt64Array),f.set(BigInt64Array,"int64")),s&&(d.set("uint64",BigUint64Array),f.set(BigUint64Array,"uint64"));class h{constructor(e,t,r){let n,o,i;if("string"==typeof e)if(n=e,i=r,"string"===e){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");o=t}else{const r=d.get(e);if(void 0===r)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t))o=r.from(t);else{if(!(t instanceof r))throw new TypeError(`A ${n} tensor's data must be type of ${r}`);o=t}}else if(i=t,Array.isArray(e)){if(0===e.length)throw new TypeError("Tensor type cannot be inferred from an empty array.");const t=typeof e[0];if("string"===t)n="string",o=e;else{if("boolean"!==t)throw new TypeError(`Invalid element type of data array: ${t}.`);n="bool",o=Uint8Array.from(e)}}else{const t=f.get(e.constructor);if(void 0===t)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);n=t,o=e}if(void 0===i)i=[o.length];else if(!Array.isArray(i))throw new TypeError("A tensor's dims must be a number array");const a=(e=>{let t=1;for(let r=0;r<e.length;r++){const n=e[r];if("number"!=typeof n||!Number.isSafeInteger(n))throw new TypeError(`dims[${r}] must be an integer, got: ${n}`);if(n<0)throw new RangeError(`dims[${r}] must be a non-negative integer, got: ${n}`);t*=n}return t})(i);if(a!==o.length)throw new Error(`Tensor's size(${a}) does not match data length(${o.length}).`);this.dims=i,this.type=n,this.data=o,this.size=a}static bufferToTensor(e,t){if(void 0===e)throw new Error("Image buffer must be defined");if(void 0===t.height||void 0===t.width)throw new Error("Image height and width must be defined");const{height:r,width:n}=t,o=t.norm;let i,a;i=void 0===o||void 0===o.mean?255:o.mean,a=void 0===o||void 0===o.bias?0:o.bias;const s=void 0!==t.bitmapFormat?t.bitmapFormat:"RGBA",d=void 0!==t.tensorFormat&&void 0!==t.tensorFormat?t.tensorFormat:"RGB",f=r*n,g="RGBA"===d?new Float32Array(4*f):new Float32Array(3*f);let m=4,c=0,l=1,w=2,u=3,p=0,y=f,b=2*f,v=-1;"RGB"===s&&(m=3,c=0,l=1,w=2,u=-1),"RGBA"===d?v=3*f:"RBG"===d?(p=0,b=f,y=2*f):"BGR"===d&&(b=0,y=f,p=2*f);for(let t=0;t<f;t++,c+=m,w+=m,l+=m,u+=m)g[p++]=(e[c]+a)/i,g[y++]=(e[l]+a)/i,g[b++]=(e[w]+a)/i,-1!==v&&-1!==u&&(g[v++]=(e[u]+a)/i);return new h("float32",g,"RGBA"===d?[1,4,r,n]:[1,3,r,n])}static async fromImage(e,t){const r="undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement,n="undefined"!=typeof ImageData&&e instanceof ImageData,o="undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap,i="undefined"!=typeof String&&(e instanceof String||"string"==typeof e);let a,s={};if(r){const r=document.createElement("canvas"),n=r.getContext("2d");if(null==n)throw new Error("Can not access image data");{let o=e.naturalHeight,i=e.naturalWidth;if(void 0!==t&&void 0!==t.resizedHeight&&void 0!==t.resizedWidth&&(o=t.resizedHeight,i=t.resizedWidth),void 0!==t){if(s=t,void 0!==t.tensorFormat)throw new Error("Image input config format must be RGBA for HTMLImageElement");if(s.tensorFormat="RGBA",void 0!==t.height&&t.height!==o)throw new Error("Image input config height doesn't match HTMLImageElement height");if(s.height=o,void 0!==t.width&&t.width!==i)throw new Error("Image input config width doesn't match HTMLImageElement width");s.width=i}else s.tensorFormat="RGBA",s.height=o,s.width=i;r.width=i,r.height=o,n.drawImage(e,0,0,i,o),a=n.getImageData(0,0,i,o).data}}else{if(!n){if(o){if(void 0===t)throw new Error("Please provide image config with format for Imagebitmap");if(void 0!==t.bitmapFormat)throw new Error("Image input config format must be defined for ImageBitmap");const r=document.createElement("canvas").getContext("2d");if(null!=r){const n=e.height,o=e.width;if(r.drawImage(e,0,0,o,n),a=r.getImageData(0,0,o,n).data,void 0!==t){if(void 0!==t.height&&t.height!==n)throw new Error("Image input config height doesn't match ImageBitmap height");if(s.height=n,void 0!==t.width&&t.width!==o)throw new Error("Image input config width doesn't match ImageBitmap width");s.width=o}else s.height=n,s.width=o;return h.bufferToTensor(a,s)}throw new Error("Can not access image data")}if(i)return new Promise(((r,n)=>{const o=document.createElement("canvas"),i=o.getContext("2d");if(!e||!i)return n();const a=new Image;a.crossOrigin="Anonymous",a.src=e,a.onload=()=>{o.width=a.width,o.height=a.height,i.drawImage(a,0,0,o.width,o.height);const e=i.getImageData(0,0,o.width,o.height);if(void 0!==t){if(void 0!==t.height&&t.height!==o.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(s.height=o.height,void 0!==t.width&&t.width!==o.width)throw new Error("Image input config width doesn't match ImageBitmap width");s.width=o.width}else s.height=o.height,s.width=o.width;r(h.bufferToTensor(e.data,s))}}));throw new Error("Input data provided is not supported - aborted tensor creation")}{const r="RGBA";let n,o;if(void 0!==t&&void 0!==t.resizedWidth&&void 0!==t.resizedHeight?(n=t.resizedHeight,o=t.resizedWidth):(n=e.height,o=e.width),void 0!==t){if(s=t,void 0!==t.bitmapFormat&&t.bitmapFormat!==r)throw new Error("Image input config format must be RGBA for ImageData");s.bitmapFormat="RGBA"}else s.bitmapFormat="RGBA";if(s.height=n,s.width=o,void 0!==t){const t=document.createElement("canvas");t.width=o,t.height=n;const r=t.getContext("2d");if(null==r)throw new Error("Can not access image data");r.putImageData(e,0,0),a=r.getImageData(0,0,o,n).data}else a=e.data}}if(void 0!==a)return h.bufferToTensor(a,s);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(e){var t,r;const n=document.createElement("canvas").getContext("2d");let o;if(null==n)throw new Error("Can not access image data");{const i=this.dims[3],a=this.dims[2],s=this.dims[1],d=void 0!==e&&void 0!==e.format?e.format:"RGB",f=void 0!==e&&void 0!==(null===(t=e.norm)||void 0===t?void 0:t.mean)?e.norm.mean:255,h=void 0!==e&&void 0!==(null===(r=e.norm)||void 0===r?void 0:r.bias)?e.norm.bias:0,g=a*i;if(void 0!==e){if(void 0!==e.height&&e.height!==a)throw new Error("Image output config height doesn't match tensor height");if(void 0!==e.width&&e.width!==i)throw new Error("Image output config width doesn't match tensor width");if(void 0!==e.format&&4===s&&"RGBA"!==e.format||3===s&&"RGB"!==e.format&&"BGR"!==e.format)throw new Error("Tensor format doesn't match input tensor dims")}const m=4;let c=0,l=1,w=2,u=3,p=0,y=g,b=2*g,v=-1;"RGBA"===d?(p=0,y=g,b=2*g,v=3*g):"RGB"===d?(p=0,y=g,b=2*g):"RBG"===d&&(p=0,b=g,y=2*g),o=n.createImageData(i,a);for(let e=0;e<a*i;c+=m,l+=m,w+=m,u+=m,e++)o.data[c]=(this.data[p++]-h)*f,o.data[l]=(this.data[y++]-h)*f,o.data[w]=(this.data[b++]-h)*f,o.data[u]=-1===v?255:(this.data[v++]-h)*f}return o}reshape(e){return new h(this.type,this.data,e)}}const g=h;class m{constructor(e){this.handler=e}async run(e,t,r){const n={};let o={};if("object"!=typeof e||null===e||e instanceof g||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if("object"==typeof t){if(null===t)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof g)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(0===t.length)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const e of t){if("string"!=typeof e)throw new TypeError("'fetches' must be a string array or an object.");if(-1===this.outputNames.indexOf(e))throw new RangeError(`'fetches' contains invalid output name: ${e}.`);n[e]=null}if("object"==typeof r&&null!==r)o=r;else if(void 0!==r)throw new TypeError("'options' must be an object.")}else{let e=!1;const a=Object.getOwnPropertyNames(t);for(const r of this.outputNames)if(-1!==a.indexOf(r)){const o=t[r];(null===o||o instanceof g)&&(e=!0,i=!1,n[r]=o)}if(e){if("object"==typeof r&&null!==r)o=r;else if(void 0!==r)throw new TypeError("'options' must be an object.")}else o=t}}else if(void 0!==t)throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const t of this.inputNames)if(void 0===e[t])throw new Error(`input '${t}' is missing in 'feeds'.`);if(i)for(const e of this.outputNames)n[e]=null;const a=await this.handler.run(e,n,o),s={};for(const e in a)Object.hasOwnProperty.call(a,e)&&(s[e]=new g(a[e].type,a[e].data,a[e].dims));return s}static async create(e,t,o,i){let a,s={};if("string"==typeof e){if(a=e,"object"==typeof t&&null!==t)s=t;else if(void 0!==t)throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if(a=e,"object"==typeof t&&null!==t)s=t;else if(void 0!==t)throw new TypeError("'options' must be an object.")}else{if(!(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer))throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");{const r=e;let n=0,d=e.byteLength;if("object"==typeof t&&null!==t)s=t;else if("number"==typeof t){if(n=t,!Number.isSafeInteger(n))throw new RangeError("'byteOffset' must be an integer.");if(n<0||n>=r.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${r.byteLength}).`);if(d=e.byteLength-n,"number"==typeof o){if(d=o,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||n+d>r.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${r.byteLength-n}].`);if("object"==typeof i&&null!==i)s=i;else if(void 0!==i)throw new TypeError("'options' must be an object.")}else if(void 0!==o)throw new TypeError("'byteLength' must be a number.")}else if(void 0!==t)throw new TypeError("'options' must be an object.");a=new Uint8Array(r,n,d)}}const d=(s.executionProviders||[]).map((e=>"string"==typeof e?e:e.name)),f=await(async e=>{const t=0===e.length?n:e,o=[];for(const e of t){const t=r[e];if(t){if(t.initialized)return t.backend;if(t.aborted)continue;const r=!!t.initPromise;try{return r||(t.initPromise=t.backend.init()),await t.initPromise,t.initialized=!0,t.backend}catch(n){r||o.push({name:e,err:n}),t.aborted=!0}finally{delete t.initPromise}}}throw new Error(`no available backend found. ERR: ${o.map((e=>`[${e.name}] ${e.err}`)).join(", ")}`)})(d),h=await f.createSessionHandler(a,s);return new m(h)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}const c=m;var l=exports;for(var w in t)l[w]=t[w];t.__esModule&&Object.defineProperty(l,"__esModule",{value:!0})})();
7
+ //# sourceMappingURL=ort-common.node.js.map
@@ -0,0 +1,31 @@
1
+ {
2
+ "license": "MIT",
3
+ "unpkg": "dist/ort-common.min.js",
4
+ "name": "onnxruntime-common",
5
+ "repository": {
6
+ "url": "https://github.com/Microsoft/onnxruntime.git",
7
+ "type": "git"
8
+ },
9
+ "author": "fs-eire",
10
+ "module": "dist/lib/index.js",
11
+ "version": "1.14.0",
12
+ "jsdelivr": "dist/ort-common.min.js",
13
+ "scripts": {
14
+ "prepare": "tsc && webpack"
15
+ },
16
+ "keywords": [
17
+ "ONNX",
18
+ "ONNXRuntime",
19
+ "ONNX Runtime"
20
+ ],
21
+ "devDependencies": {
22
+ "ts-loader": "^9.4.2",
23
+ "typedoc": "^0.23.22",
24
+ "typescript": "^4.9.4",
25
+ "webpack": "^5.75.0",
26
+ "webpack-cli": "^5.0.1"
27
+ },
28
+ "main": "dist/ort-common.node.js",
29
+ "types": "dist/lib/index.d.ts",
30
+ "description": "ONNXRuntime JavaScript API library"
31
+ }