@superatomai/sdk-node 0.0.9 → 0.0.10
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/README.md +942 -942
- package/dist/index.js +4 -405
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -434
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,9 +8,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
8
|
var __esm = (fn, res) => function __init() {
|
|
9
9
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
10
|
};
|
|
11
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
-
};
|
|
14
11
|
var __export = (target, all) => {
|
|
15
12
|
for (var name in all)
|
|
16
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -33,404 +30,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
30
|
));
|
|
34
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
32
|
|
|
36
|
-
// node_modules/dotenv/package.json
|
|
37
|
-
var require_package = __commonJS({
|
|
38
|
-
"node_modules/dotenv/package.json"(exports2, module2) {
|
|
39
|
-
module2.exports = {
|
|
40
|
-
name: "dotenv",
|
|
41
|
-
version: "17.2.3",
|
|
42
|
-
description: "Loads environment variables from .env file",
|
|
43
|
-
main: "lib/main.js",
|
|
44
|
-
types: "lib/main.d.ts",
|
|
45
|
-
exports: {
|
|
46
|
-
".": {
|
|
47
|
-
types: "./lib/main.d.ts",
|
|
48
|
-
require: "./lib/main.js",
|
|
49
|
-
default: "./lib/main.js"
|
|
50
|
-
},
|
|
51
|
-
"./config": "./config.js",
|
|
52
|
-
"./config.js": "./config.js",
|
|
53
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
54
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
55
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
56
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
57
|
-
"./package.json": "./package.json"
|
|
58
|
-
},
|
|
59
|
-
scripts: {
|
|
60
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
61
|
-
lint: "standard",
|
|
62
|
-
pretest: "npm run lint && npm run dts-check",
|
|
63
|
-
test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
64
|
-
"test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
|
|
65
|
-
prerelease: "npm test",
|
|
66
|
-
release: "standard-version"
|
|
67
|
-
},
|
|
68
|
-
repository: {
|
|
69
|
-
type: "git",
|
|
70
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
71
|
-
},
|
|
72
|
-
homepage: "https://github.com/motdotla/dotenv#readme",
|
|
73
|
-
funding: "https://dotenvx.com",
|
|
74
|
-
keywords: [
|
|
75
|
-
"dotenv",
|
|
76
|
-
"env",
|
|
77
|
-
".env",
|
|
78
|
-
"environment",
|
|
79
|
-
"variables",
|
|
80
|
-
"config",
|
|
81
|
-
"settings"
|
|
82
|
-
],
|
|
83
|
-
readmeFilename: "README.md",
|
|
84
|
-
license: "BSD-2-Clause",
|
|
85
|
-
devDependencies: {
|
|
86
|
-
"@types/node": "^18.11.3",
|
|
87
|
-
decache: "^4.6.2",
|
|
88
|
-
sinon: "^14.0.1",
|
|
89
|
-
standard: "^17.0.0",
|
|
90
|
-
"standard-version": "^9.5.0",
|
|
91
|
-
tap: "^19.2.0",
|
|
92
|
-
typescript: "^4.8.4"
|
|
93
|
-
},
|
|
94
|
-
engines: {
|
|
95
|
-
node: ">=12"
|
|
96
|
-
},
|
|
97
|
-
browser: {
|
|
98
|
-
fs: false
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// node_modules/dotenv/lib/main.js
|
|
105
|
-
var require_main = __commonJS({
|
|
106
|
-
"node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
107
|
-
"use strict";
|
|
108
|
-
var fs8 = require("fs");
|
|
109
|
-
var path7 = require("path");
|
|
110
|
-
var os4 = require("os");
|
|
111
|
-
var crypto2 = require("crypto");
|
|
112
|
-
var packageJson = require_package();
|
|
113
|
-
var version = packageJson.version;
|
|
114
|
-
var TIPS = [
|
|
115
|
-
"\u{1F510} encrypt with Dotenvx: https://dotenvx.com",
|
|
116
|
-
"\u{1F510} prevent committing .env to code: https://dotenvx.com/precommit",
|
|
117
|
-
"\u{1F510} prevent building .env in docker: https://dotenvx.com/prebuild",
|
|
118
|
-
"\u{1F4E1} add observability to secrets: https://dotenvx.com/ops",
|
|
119
|
-
"\u{1F465} sync secrets across teammates & machines: https://dotenvx.com/ops",
|
|
120
|
-
"\u{1F5C2}\uFE0F backup and recover secrets: https://dotenvx.com/ops",
|
|
121
|
-
"\u2705 audit secrets and track compliance: https://dotenvx.com/ops",
|
|
122
|
-
"\u{1F504} add secrets lifecycle management: https://dotenvx.com/ops",
|
|
123
|
-
"\u{1F511} add access controls to secrets: https://dotenvx.com/ops",
|
|
124
|
-
"\u{1F6E0}\uFE0F run anywhere with `dotenvx run -- yourcommand`",
|
|
125
|
-
"\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }",
|
|
126
|
-
"\u2699\uFE0F enable debug logging with { debug: true }",
|
|
127
|
-
"\u2699\uFE0F override existing env vars with { override: true }",
|
|
128
|
-
"\u2699\uFE0F suppress all logs with { quiet: true }",
|
|
129
|
-
"\u2699\uFE0F write to custom object with { processEnv: myObject }",
|
|
130
|
-
"\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }"
|
|
131
|
-
];
|
|
132
|
-
function _getRandomTip() {
|
|
133
|
-
return TIPS[Math.floor(Math.random() * TIPS.length)];
|
|
134
|
-
}
|
|
135
|
-
function parseBoolean(value) {
|
|
136
|
-
if (typeof value === "string") {
|
|
137
|
-
return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
|
|
138
|
-
}
|
|
139
|
-
return Boolean(value);
|
|
140
|
-
}
|
|
141
|
-
function supportsAnsi() {
|
|
142
|
-
return process.stdout.isTTY;
|
|
143
|
-
}
|
|
144
|
-
function dim(text) {
|
|
145
|
-
return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
|
|
146
|
-
}
|
|
147
|
-
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
148
|
-
function parse(src) {
|
|
149
|
-
const obj = {};
|
|
150
|
-
let lines = src.toString();
|
|
151
|
-
lines = lines.replace(/\r\n?/mg, "\n");
|
|
152
|
-
let match;
|
|
153
|
-
while ((match = LINE.exec(lines)) != null) {
|
|
154
|
-
const key = match[1];
|
|
155
|
-
let value = match[2] || "";
|
|
156
|
-
value = value.trim();
|
|
157
|
-
const maybeQuote = value[0];
|
|
158
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
159
|
-
if (maybeQuote === '"') {
|
|
160
|
-
value = value.replace(/\\n/g, "\n");
|
|
161
|
-
value = value.replace(/\\r/g, "\r");
|
|
162
|
-
}
|
|
163
|
-
obj[key] = value;
|
|
164
|
-
}
|
|
165
|
-
return obj;
|
|
166
|
-
}
|
|
167
|
-
function _parseVault(options) {
|
|
168
|
-
options = options || {};
|
|
169
|
-
const vaultPath = _vaultPath(options);
|
|
170
|
-
options.path = vaultPath;
|
|
171
|
-
const result = DotenvModule.configDotenv(options);
|
|
172
|
-
if (!result.parsed) {
|
|
173
|
-
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
174
|
-
err.code = "MISSING_DATA";
|
|
175
|
-
throw err;
|
|
176
|
-
}
|
|
177
|
-
const keys = _dotenvKey(options).split(",");
|
|
178
|
-
const length = keys.length;
|
|
179
|
-
let decrypted;
|
|
180
|
-
for (let i = 0; i < length; i++) {
|
|
181
|
-
try {
|
|
182
|
-
const key = keys[i].trim();
|
|
183
|
-
const attrs = _instructions(result, key);
|
|
184
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
185
|
-
break;
|
|
186
|
-
} catch (error) {
|
|
187
|
-
if (i + 1 >= length) {
|
|
188
|
-
throw error;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
return DotenvModule.parse(decrypted);
|
|
193
|
-
}
|
|
194
|
-
function _warn(message) {
|
|
195
|
-
console.error(`[dotenv@${version}][WARN] ${message}`);
|
|
196
|
-
}
|
|
197
|
-
function _debug(message) {
|
|
198
|
-
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
199
|
-
}
|
|
200
|
-
function _log(message) {
|
|
201
|
-
console.log(`[dotenv@${version}] ${message}`);
|
|
202
|
-
}
|
|
203
|
-
function _dotenvKey(options) {
|
|
204
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
205
|
-
return options.DOTENV_KEY;
|
|
206
|
-
}
|
|
207
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
208
|
-
return process.env.DOTENV_KEY;
|
|
209
|
-
}
|
|
210
|
-
return "";
|
|
211
|
-
}
|
|
212
|
-
function _instructions(result, dotenvKey) {
|
|
213
|
-
let uri;
|
|
214
|
-
try {
|
|
215
|
-
uri = new URL(dotenvKey);
|
|
216
|
-
} catch (error) {
|
|
217
|
-
if (error.code === "ERR_INVALID_URL") {
|
|
218
|
-
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
219
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
220
|
-
throw err;
|
|
221
|
-
}
|
|
222
|
-
throw error;
|
|
223
|
-
}
|
|
224
|
-
const key = uri.password;
|
|
225
|
-
if (!key) {
|
|
226
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
227
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
228
|
-
throw err;
|
|
229
|
-
}
|
|
230
|
-
const environment = uri.searchParams.get("environment");
|
|
231
|
-
if (!environment) {
|
|
232
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
233
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
234
|
-
throw err;
|
|
235
|
-
}
|
|
236
|
-
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
237
|
-
const ciphertext = result.parsed[environmentKey];
|
|
238
|
-
if (!ciphertext) {
|
|
239
|
-
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
240
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
241
|
-
throw err;
|
|
242
|
-
}
|
|
243
|
-
return { ciphertext, key };
|
|
244
|
-
}
|
|
245
|
-
function _vaultPath(options) {
|
|
246
|
-
let possibleVaultPath = null;
|
|
247
|
-
if (options && options.path && options.path.length > 0) {
|
|
248
|
-
if (Array.isArray(options.path)) {
|
|
249
|
-
for (const filepath of options.path) {
|
|
250
|
-
if (fs8.existsSync(filepath)) {
|
|
251
|
-
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
} else {
|
|
255
|
-
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
256
|
-
}
|
|
257
|
-
} else {
|
|
258
|
-
possibleVaultPath = path7.resolve(process.cwd(), ".env.vault");
|
|
259
|
-
}
|
|
260
|
-
if (fs8.existsSync(possibleVaultPath)) {
|
|
261
|
-
return possibleVaultPath;
|
|
262
|
-
}
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
function _resolveHome(envPath) {
|
|
266
|
-
return envPath[0] === "~" ? path7.join(os4.homedir(), envPath.slice(1)) : envPath;
|
|
267
|
-
}
|
|
268
|
-
function _configVault(options) {
|
|
269
|
-
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
270
|
-
const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
271
|
-
if (debug || !quiet) {
|
|
272
|
-
_log("Loading env from encrypted .env.vault");
|
|
273
|
-
}
|
|
274
|
-
const parsed = DotenvModule._parseVault(options);
|
|
275
|
-
let processEnv = process.env;
|
|
276
|
-
if (options && options.processEnv != null) {
|
|
277
|
-
processEnv = options.processEnv;
|
|
278
|
-
}
|
|
279
|
-
DotenvModule.populate(processEnv, parsed, options);
|
|
280
|
-
return { parsed };
|
|
281
|
-
}
|
|
282
|
-
function configDotenv(options) {
|
|
283
|
-
const dotenvPath = path7.resolve(process.cwd(), ".env");
|
|
284
|
-
let encoding = "utf8";
|
|
285
|
-
let processEnv = process.env;
|
|
286
|
-
if (options && options.processEnv != null) {
|
|
287
|
-
processEnv = options.processEnv;
|
|
288
|
-
}
|
|
289
|
-
let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
290
|
-
let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
291
|
-
if (options && options.encoding) {
|
|
292
|
-
encoding = options.encoding;
|
|
293
|
-
} else {
|
|
294
|
-
if (debug) {
|
|
295
|
-
_debug("No encoding is specified. UTF-8 is used by default");
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
let optionPaths = [dotenvPath];
|
|
299
|
-
if (options && options.path) {
|
|
300
|
-
if (!Array.isArray(options.path)) {
|
|
301
|
-
optionPaths = [_resolveHome(options.path)];
|
|
302
|
-
} else {
|
|
303
|
-
optionPaths = [];
|
|
304
|
-
for (const filepath of options.path) {
|
|
305
|
-
optionPaths.push(_resolveHome(filepath));
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
let lastError;
|
|
310
|
-
const parsedAll = {};
|
|
311
|
-
for (const path8 of optionPaths) {
|
|
312
|
-
try {
|
|
313
|
-
const parsed = DotenvModule.parse(fs8.readFileSync(path8, { encoding }));
|
|
314
|
-
DotenvModule.populate(parsedAll, parsed, options);
|
|
315
|
-
} catch (e) {
|
|
316
|
-
if (debug) {
|
|
317
|
-
_debug(`Failed to load ${path8} ${e.message}`);
|
|
318
|
-
}
|
|
319
|
-
lastError = e;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
const populated = DotenvModule.populate(processEnv, parsedAll, options);
|
|
323
|
-
debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
|
|
324
|
-
quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
|
|
325
|
-
if (debug || !quiet) {
|
|
326
|
-
const keysCount = Object.keys(populated).length;
|
|
327
|
-
const shortPaths = [];
|
|
328
|
-
for (const filePath of optionPaths) {
|
|
329
|
-
try {
|
|
330
|
-
const relative = path7.relative(process.cwd(), filePath);
|
|
331
|
-
shortPaths.push(relative);
|
|
332
|
-
} catch (e) {
|
|
333
|
-
if (debug) {
|
|
334
|
-
_debug(`Failed to load ${filePath} ${e.message}`);
|
|
335
|
-
}
|
|
336
|
-
lastError = e;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
|
|
340
|
-
}
|
|
341
|
-
if (lastError) {
|
|
342
|
-
return { parsed: parsedAll, error: lastError };
|
|
343
|
-
} else {
|
|
344
|
-
return { parsed: parsedAll };
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
function config(options) {
|
|
348
|
-
if (_dotenvKey(options).length === 0) {
|
|
349
|
-
return DotenvModule.configDotenv(options);
|
|
350
|
-
}
|
|
351
|
-
const vaultPath = _vaultPath(options);
|
|
352
|
-
if (!vaultPath) {
|
|
353
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
354
|
-
return DotenvModule.configDotenv(options);
|
|
355
|
-
}
|
|
356
|
-
return DotenvModule._configVault(options);
|
|
357
|
-
}
|
|
358
|
-
function decrypt(encrypted, keyStr) {
|
|
359
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
360
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
|
361
|
-
const nonce = ciphertext.subarray(0, 12);
|
|
362
|
-
const authTag = ciphertext.subarray(-16);
|
|
363
|
-
ciphertext = ciphertext.subarray(12, -16);
|
|
364
|
-
try {
|
|
365
|
-
const aesgcm = crypto2.createDecipheriv("aes-256-gcm", key, nonce);
|
|
366
|
-
aesgcm.setAuthTag(authTag);
|
|
367
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
368
|
-
} catch (error) {
|
|
369
|
-
const isRange = error instanceof RangeError;
|
|
370
|
-
const invalidKeyLength = error.message === "Invalid key length";
|
|
371
|
-
const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
|
|
372
|
-
if (isRange || invalidKeyLength) {
|
|
373
|
-
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
374
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
375
|
-
throw err;
|
|
376
|
-
} else if (decryptionFailed) {
|
|
377
|
-
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
378
|
-
err.code = "DECRYPTION_FAILED";
|
|
379
|
-
throw err;
|
|
380
|
-
} else {
|
|
381
|
-
throw error;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
function populate(processEnv, parsed, options = {}) {
|
|
386
|
-
const debug = Boolean(options && options.debug);
|
|
387
|
-
const override = Boolean(options && options.override);
|
|
388
|
-
const populated = {};
|
|
389
|
-
if (typeof parsed !== "object") {
|
|
390
|
-
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
391
|
-
err.code = "OBJECT_REQUIRED";
|
|
392
|
-
throw err;
|
|
393
|
-
}
|
|
394
|
-
for (const key of Object.keys(parsed)) {
|
|
395
|
-
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
396
|
-
if (override === true) {
|
|
397
|
-
processEnv[key] = parsed[key];
|
|
398
|
-
populated[key] = parsed[key];
|
|
399
|
-
}
|
|
400
|
-
if (debug) {
|
|
401
|
-
if (override === true) {
|
|
402
|
-
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
403
|
-
} else {
|
|
404
|
-
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
} else {
|
|
408
|
-
processEnv[key] = parsed[key];
|
|
409
|
-
populated[key] = parsed[key];
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
return populated;
|
|
413
|
-
}
|
|
414
|
-
var DotenvModule = {
|
|
415
|
-
configDotenv,
|
|
416
|
-
_configVault,
|
|
417
|
-
_parseVault,
|
|
418
|
-
config,
|
|
419
|
-
decrypt,
|
|
420
|
-
parse,
|
|
421
|
-
populate
|
|
422
|
-
};
|
|
423
|
-
module2.exports.configDotenv = DotenvModule.configDotenv;
|
|
424
|
-
module2.exports._configVault = DotenvModule._configVault;
|
|
425
|
-
module2.exports._parseVault = DotenvModule._parseVault;
|
|
426
|
-
module2.exports.config = DotenvModule.config;
|
|
427
|
-
module2.exports.decrypt = DotenvModule.decrypt;
|
|
428
|
-
module2.exports.parse = DotenvModule.parse;
|
|
429
|
-
module2.exports.populate = DotenvModule.populate;
|
|
430
|
-
module2.exports = DotenvModule;
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
|
|
434
33
|
// src/userResponse/utils.ts
|
|
435
34
|
var utils_exports = {};
|
|
436
35
|
__export(utils_exports, {
|
|
@@ -861,7 +460,7 @@ var UserPromptSuggestionsMessageSchema = import_zod3.z.object({
|
|
|
861
460
|
payload: UserPromptSuggestionsPayloadSchema
|
|
862
461
|
});
|
|
863
462
|
var ComponentPropsSchema = import_zod3.z.object({
|
|
864
|
-
query: import_zod3.z.string().optional(),
|
|
463
|
+
query: import_zod3.z.string().or(import_zod3.z.object({})).optional(),
|
|
865
464
|
title: import_zod3.z.string().optional(),
|
|
866
465
|
description: import_zod3.z.string().optional(),
|
|
867
466
|
config: import_zod3.z.record(import_zod3.z.unknown()).optional(),
|
|
@@ -2060,7 +1659,7 @@ function sendDataResponse3(id, res, sendMessage, clientId) {
|
|
|
2060
1659
|
}
|
|
2061
1660
|
|
|
2062
1661
|
// src/userResponse/groq.ts
|
|
2063
|
-
var import_dotenv = __toESM(
|
|
1662
|
+
var import_dotenv = __toESM(require("dotenv"));
|
|
2064
1663
|
|
|
2065
1664
|
// src/userResponse/base-llm.ts
|
|
2066
1665
|
init_utils();
|
|
@@ -4822,7 +4421,7 @@ var GroqLLM = class extends BaseLLM {
|
|
|
4822
4421
|
var groqLLM = new GroqLLM();
|
|
4823
4422
|
|
|
4824
4423
|
// src/userResponse/anthropic.ts
|
|
4825
|
-
var import_dotenv2 = __toESM(
|
|
4424
|
+
var import_dotenv2 = __toESM(require("dotenv"));
|
|
4826
4425
|
import_dotenv2.default.config();
|
|
4827
4426
|
var AnthropicLLM = class extends BaseLLM {
|
|
4828
4427
|
constructor(config) {
|
|
@@ -4841,7 +4440,7 @@ var AnthropicLLM = class extends BaseLLM {
|
|
|
4841
4440
|
var anthropicLLM = new AnthropicLLM();
|
|
4842
4441
|
|
|
4843
4442
|
// src/userResponse/index.ts
|
|
4844
|
-
var import_dotenv3 = __toESM(
|
|
4443
|
+
var import_dotenv3 = __toESM(require("dotenv"));
|
|
4845
4444
|
import_dotenv3.default.config();
|
|
4846
4445
|
function getLLMProviders() {
|
|
4847
4446
|
const envProviders = process.env.LLM_PROVIDERS;
|