@ampt/ai 1.0.0

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.
@@ -0,0 +1,202 @@
1
+ import { createRequire as topLevelCreateRequire } from 'module'
2
+ const require = topLevelCreateRequire(import.meta.url || __dirname)
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined")
13
+ return require.apply(this, arguments);
14
+ throw new Error('Dynamic require of "' + x + '" is not supported');
15
+ });
16
+ var __esm = (fn, res) => function __init() {
17
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
18
+ };
19
+ var __commonJS = (cb, mod) => function __require2() {
20
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
+ };
22
+ var __export = (target, all) => {
23
+ for (var name in all)
24
+ __defProp(target, name, { get: all[name], enumerable: true });
25
+ };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from === "object" || typeof from === "function") {
28
+ for (let key of __getOwnPropNames(from))
29
+ if (!__hasOwnProp.call(to, key) && key !== except)
30
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
+ }
32
+ return to;
33
+ };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
35
+ // If the importer is in node compatibility mode or this is not an ESM
36
+ // file that has been converted to a CommonJS file using a Babel-
37
+ // compatible transform (i.e. "__esModule" has not been set), then set
38
+ // "default" to the CommonJS "module.exports" for node compatibility.
39
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
40
+ mod
41
+ ));
42
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
43
+
44
+ // ../../node_modules/strnum/strnum.js
45
+ var require_strnum = __commonJS({
46
+ "../../node_modules/strnum/strnum.js"(exports, module) {
47
+ var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
48
+ var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
49
+ if (!Number.parseInt && window.parseInt) {
50
+ Number.parseInt = window.parseInt;
51
+ }
52
+ if (!Number.parseFloat && window.parseFloat) {
53
+ Number.parseFloat = window.parseFloat;
54
+ }
55
+ var consider = {
56
+ hex: true,
57
+ leadingZeros: true,
58
+ decimalPoint: ".",
59
+ eNotation: true
60
+ //skipLike: /regex/
61
+ };
62
+ function toNumber(str, options = {}) {
63
+ options = Object.assign({}, consider, options);
64
+ if (!str || typeof str !== "string")
65
+ return str;
66
+ let trimmedStr = str.trim();
67
+ if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr))
68
+ return str;
69
+ else if (options.hex && hexRegex.test(trimmedStr)) {
70
+ return Number.parseInt(trimmedStr, 16);
71
+ } else {
72
+ const match = numRegex.exec(trimmedStr);
73
+ if (match) {
74
+ const sign = match[1];
75
+ const leadingZeros = match[2];
76
+ let numTrimmedByZeros = trimZeros(match[3]);
77
+ const eNotation = match[4] || match[6];
78
+ if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".")
79
+ return str;
80
+ else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".")
81
+ return str;
82
+ else {
83
+ const num = Number(trimmedStr);
84
+ const numStr = "" + num;
85
+ if (numStr.search(/[eE]/) !== -1) {
86
+ if (options.eNotation)
87
+ return num;
88
+ else
89
+ return str;
90
+ } else if (eNotation) {
91
+ if (options.eNotation)
92
+ return num;
93
+ else
94
+ return str;
95
+ } else if (trimmedStr.indexOf(".") !== -1) {
96
+ if (numStr === "0" && numTrimmedByZeros === "")
97
+ return num;
98
+ else if (numStr === numTrimmedByZeros)
99
+ return num;
100
+ else if (sign && numStr === "-" + numTrimmedByZeros)
101
+ return num;
102
+ else
103
+ return str;
104
+ }
105
+ if (leadingZeros) {
106
+ if (numTrimmedByZeros === numStr)
107
+ return num;
108
+ else if (sign + numTrimmedByZeros === numStr)
109
+ return num;
110
+ else
111
+ return str;
112
+ }
113
+ if (trimmedStr === numStr)
114
+ return num;
115
+ else if (trimmedStr === sign + numStr)
116
+ return num;
117
+ return str;
118
+ }
119
+ } else {
120
+ return str;
121
+ }
122
+ }
123
+ }
124
+ function trimZeros(numStr) {
125
+ if (numStr && numStr.indexOf(".") !== -1) {
126
+ numStr = numStr.replace(/0+$/, "");
127
+ if (numStr === ".")
128
+ numStr = "0";
129
+ else if (numStr[0] === ".")
130
+ numStr = "0" + numStr;
131
+ else if (numStr[numStr.length - 1] === ".")
132
+ numStr = numStr.substr(0, numStr.length - 1);
133
+ return numStr;
134
+ }
135
+ return numStr;
136
+ }
137
+ module.exports = toNumber;
138
+ }
139
+ });
140
+
141
+ // ../../node_modules/uuid/dist/esm-node/rng.js
142
+ import crypto from "crypto";
143
+ var rnds8Pool = new Uint8Array(256);
144
+ var poolPtr = rnds8Pool.length;
145
+ function rng() {
146
+ if (poolPtr > rnds8Pool.length - 16) {
147
+ crypto.randomFillSync(rnds8Pool);
148
+ poolPtr = 0;
149
+ }
150
+ return rnds8Pool.slice(poolPtr, poolPtr += 16);
151
+ }
152
+
153
+ // ../../node_modules/uuid/dist/esm-node/regex.js
154
+ var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
155
+
156
+ // ../../node_modules/uuid/dist/esm-node/validate.js
157
+ function validate(uuid) {
158
+ return typeof uuid === "string" && regex_default.test(uuid);
159
+ }
160
+ var validate_default = validate;
161
+
162
+ // ../../node_modules/uuid/dist/esm-node/stringify.js
163
+ var byteToHex = [];
164
+ for (let i = 0; i < 256; ++i) {
165
+ byteToHex.push((i + 256).toString(16).substr(1));
166
+ }
167
+ function stringify(arr, offset = 0) {
168
+ const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
169
+ if (!validate_default(uuid)) {
170
+ throw TypeError("Stringified UUID is invalid");
171
+ }
172
+ return uuid;
173
+ }
174
+ var stringify_default = stringify;
175
+
176
+ // ../../node_modules/uuid/dist/esm-node/v4.js
177
+ function v4(options, buf, offset) {
178
+ options = options || {};
179
+ const rnds = options.random || (options.rng || rng)();
180
+ rnds[6] = rnds[6] & 15 | 64;
181
+ rnds[8] = rnds[8] & 63 | 128;
182
+ if (buf) {
183
+ offset = offset || 0;
184
+ for (let i = 0; i < 16; ++i) {
185
+ buf[offset + i] = rnds[i];
186
+ }
187
+ return buf;
188
+ }
189
+ return stringify_default(rnds);
190
+ }
191
+ var v4_default = v4;
192
+
193
+ export {
194
+ __require,
195
+ __esm,
196
+ __commonJS,
197
+ __export,
198
+ __toESM,
199
+ __toCommonJS,
200
+ v4_default,
201
+ require_strnum
202
+ };