@flutchai/flutch-sdk 0.7.6 → 0.7.7
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/dist/index.cjs +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8,10 +8,10 @@ var fs = require('fs');
|
|
|
8
8
|
var path2 = require('path');
|
|
9
9
|
var os = require('os');
|
|
10
10
|
var config = require('@nestjs/config');
|
|
11
|
+
var express = require('express');
|
|
11
12
|
var net = require('net');
|
|
12
13
|
var mongoose = require('mongoose');
|
|
13
14
|
var langgraphCheckpointMongodb = require('@langchain/langgraph-checkpoint-mongodb');
|
|
14
|
-
var express = require('express');
|
|
15
15
|
var crypto = require('crypto');
|
|
16
16
|
var promClient = require('prom-client');
|
|
17
17
|
var messages = require('@langchain/core/messages');
|
|
@@ -1990,6 +1990,14 @@ async function bootstrap(AppModule, options = {}) {
|
|
|
1990
1990
|
setupRedisMock();
|
|
1991
1991
|
const app = await core.NestFactory.create(AppModule);
|
|
1992
1992
|
const logger3 = new common.Logger("Bootstrap");
|
|
1993
|
+
const bodyLimit = options.bodyLimit || process.env.GRAPH_BODY_LIMIT || "10mb";
|
|
1994
|
+
app.use(express.json({
|
|
1995
|
+
limit: bodyLimit
|
|
1996
|
+
}));
|
|
1997
|
+
app.use(express.urlencoded({
|
|
1998
|
+
limit: bodyLimit,
|
|
1999
|
+
extended: true
|
|
2000
|
+
}));
|
|
1993
2001
|
const requestedPort = options.port || parseInt(process.env.PORT || "3100", 10);
|
|
1994
2002
|
const port = await findAvailablePort(requestedPort);
|
|
1995
2003
|
const globalPrefix = options.globalPrefix;
|
|
@@ -7152,8 +7160,8 @@ function toolSearchTerms(text) {
|
|
|
7152
7160
|
}
|
|
7153
7161
|
__name(toolSearchTerms, "toolSearchTerms");
|
|
7154
7162
|
function schemaParams(schema) {
|
|
7155
|
-
const
|
|
7156
|
-
const properties =
|
|
7163
|
+
const json2 = schema;
|
|
7164
|
+
const properties = json2?.properties ?? json2?.shape ?? {};
|
|
7157
7165
|
return Object.entries(properties).flatMap(([name, property]) => property?.description ? [
|
|
7158
7166
|
name,
|
|
7159
7167
|
property.description
|
|
@@ -8868,8 +8876,8 @@ var IV_LENGTH = 16;
|
|
|
8868
8876
|
function encryptTokens(tokens, key) {
|
|
8869
8877
|
const iv = crypto__namespace.randomBytes(IV_LENGTH);
|
|
8870
8878
|
const cipher = crypto__namespace.createCipheriv(ALGORITHM, Buffer.from(key), iv);
|
|
8871
|
-
const
|
|
8872
|
-
let encrypted = cipher.update(
|
|
8879
|
+
const json2 = JSON.stringify(tokens);
|
|
8880
|
+
let encrypted = cipher.update(json2, "utf8", "hex");
|
|
8873
8881
|
encrypted += cipher.final("hex");
|
|
8874
8882
|
return iv.toString("hex") + ":" + encrypted;
|
|
8875
8883
|
}
|