@botpress/runtime 1.13.13 → 1.13.14
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/definition.js +9 -9
- package/dist/definition.js.map +3 -3
- package/dist/internal.js +9 -9
- package/dist/internal.js.map +3 -3
- package/dist/library.js +9 -9
- package/dist/library.js.map +3 -3
- package/dist/runtime/handlers/trigger.d.ts +2 -0
- package/dist/runtime/handlers/trigger.d.ts.map +1 -1
- package/dist/runtime.js +41 -11
- package/dist/runtime.js.map +3 -3
- package/package.json +2 -2
package/dist/definition.js
CHANGED
|
@@ -48,7 +48,7 @@ var init_define_BUILD = __esm({
|
|
|
48
48
|
var define_PACKAGE_VERSIONS_default;
|
|
49
49
|
var init_define_PACKAGE_VERSIONS = __esm({
|
|
50
50
|
"<define:__PACKAGE_VERSIONS__>"() {
|
|
51
|
-
define_PACKAGE_VERSIONS_default = { runtime: "1.13.
|
|
51
|
+
define_PACKAGE_VERSIONS_default = { runtime: "1.13.14", adk: "1.13.14", sdk: "5.0.2", llmz: "0.0.37", zai: "2.5.6", cognitive: "0.3.3" };
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -10657,7 +10657,7 @@ var require_form_data = __commonJS({
|
|
|
10657
10657
|
var parseUrl = __require("url").parse;
|
|
10658
10658
|
var fs3 = __require("fs");
|
|
10659
10659
|
var Stream2 = __require("stream").Stream;
|
|
10660
|
-
var
|
|
10660
|
+
var crypto3 = __require("crypto");
|
|
10661
10661
|
var mime = require_mime_types();
|
|
10662
10662
|
var asynckit = require_asynckit();
|
|
10663
10663
|
var setToStringTag = require_es_set_tostringtag();
|
|
@@ -10863,7 +10863,7 @@ var require_form_data = __commonJS({
|
|
|
10863
10863
|
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
10864
10864
|
};
|
|
10865
10865
|
FormData3.prototype._generateBoundary = function() {
|
|
10866
|
-
this._boundary = "--------------------------" +
|
|
10866
|
+
this._boundary = "--------------------------" + crypto3.randomBytes(12).toString("hex");
|
|
10867
10867
|
};
|
|
10868
10868
|
FormData3.prototype.getLengthSync = function() {
|
|
10869
10869
|
var knownLength = this._overheadLength + this._valueLength;
|
|
@@ -11284,7 +11284,7 @@ var init_URLSearchParams = __esm({
|
|
|
11284
11284
|
});
|
|
11285
11285
|
|
|
11286
11286
|
// ../../node_modules/axios/lib/platform/node/index.js
|
|
11287
|
-
import
|
|
11287
|
+
import crypto2 from "crypto";
|
|
11288
11288
|
var ALPHA, DIGIT, ALPHABET, generateString, node_default;
|
|
11289
11289
|
var init_node = __esm({
|
|
11290
11290
|
"../../node_modules/axios/lib/platform/node/index.js"() {
|
|
@@ -11303,7 +11303,7 @@ var init_node = __esm({
|
|
|
11303
11303
|
let str = "";
|
|
11304
11304
|
const { length } = alphabet;
|
|
11305
11305
|
const randomValues = new Uint32Array(size);
|
|
11306
|
-
|
|
11306
|
+
crypto2.randomFillSync(randomValues);
|
|
11307
11307
|
for (let i = 0; i < size; i++) {
|
|
11308
11308
|
str += alphabet[randomValues[i] % length];
|
|
11309
11309
|
}
|
|
@@ -37033,7 +37033,7 @@ var init_source_website = __esm({
|
|
|
37033
37033
|
type: "website",
|
|
37034
37034
|
state: State,
|
|
37035
37035
|
async handler({ input, step: step2, state, client: client2 }) {
|
|
37036
|
-
const
|
|
37036
|
+
const crypto3 = await import("crypto");
|
|
37037
37037
|
console.log(
|
|
37038
37038
|
`Starting sync for WebsiteSource [${this.id}] in mode [${this.mode}, maxPages=${this.maxPages}, maxDepth=${this.maxDepth}, baseUrl=${this.baseUrl}, sitemapUrl=${this.sitemapUrl}]`
|
|
37039
37039
|
);
|
|
@@ -37116,7 +37116,7 @@ var init_source_website = __esm({
|
|
|
37116
37116
|
content,
|
|
37117
37117
|
metadata: fetchMetadata
|
|
37118
37118
|
} = await this.fetchUrl(sitemapUrl.loc);
|
|
37119
|
-
const hash =
|
|
37119
|
+
const hash = crypto3.createHash("sha256").update(content).digest("hex");
|
|
37120
37120
|
let contentType = fetchedContentType;
|
|
37121
37121
|
if (!contentType) {
|
|
37122
37122
|
contentType = content.includes("<html") ? "text/html" : "text/markdown";
|
|
@@ -44119,7 +44119,7 @@ var init_source_directory = __esm({
|
|
|
44119
44119
|
const glob2 = await Promise.resolve().then(() => (init_esm9(), esm_exports3));
|
|
44120
44120
|
const path4 = await import("path");
|
|
44121
44121
|
const fs3 = await import("fs/promises");
|
|
44122
|
-
const
|
|
44122
|
+
const crypto3 = await import("crypto");
|
|
44123
44123
|
const directory = path4.resolve(adk.environment.agent.directory, this.directoryPath);
|
|
44124
44124
|
const tags = {
|
|
44125
44125
|
[WellKnownTags.knowledge.KNOWLEDGE]: "knowledge-base",
|
|
@@ -44181,7 +44181,7 @@ var init_source_directory = __esm({
|
|
|
44181
44181
|
const upsertFile = async (local) => {
|
|
44182
44182
|
const key = `data_source://${this.type}/${this.id}/${local.rel}`;
|
|
44183
44183
|
const content = await fs3.readFile(local.abs);
|
|
44184
|
-
const hash =
|
|
44184
|
+
const hash = crypto3.createHash("sha256").update(content).digest("hex");
|
|
44185
44185
|
const { file } = await client2.getFile({ id: key }).catch(() => ({ file: null }));
|
|
44186
44186
|
const isFailed = file?.status === "indexing_failed" || file?.status === "upload_failed" || file?.status === "upload_pending";
|
|
44187
44187
|
if (!input.force && !isFailed && file?.metadata?.hash === hash) {
|