@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/library.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
|
|
|
@@ -26343,7 +26343,7 @@ var require_form_data = __commonJS({
|
|
|
26343
26343
|
var parseUrl = __require("url").parse;
|
|
26344
26344
|
var fs3 = __require("fs");
|
|
26345
26345
|
var Stream2 = __require("stream").Stream;
|
|
26346
|
-
var
|
|
26346
|
+
var crypto3 = __require("crypto");
|
|
26347
26347
|
var mime = require_mime_types();
|
|
26348
26348
|
var asynckit = require_asynckit();
|
|
26349
26349
|
var setToStringTag = require_es_set_tostringtag();
|
|
@@ -26549,7 +26549,7 @@ var require_form_data = __commonJS({
|
|
|
26549
26549
|
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
26550
26550
|
};
|
|
26551
26551
|
FormData3.prototype._generateBoundary = function() {
|
|
26552
|
-
this._boundary = "--------------------------" +
|
|
26552
|
+
this._boundary = "--------------------------" + crypto3.randomBytes(12).toString("hex");
|
|
26553
26553
|
};
|
|
26554
26554
|
FormData3.prototype.getLengthSync = function() {
|
|
26555
26555
|
var knownLength = this._overheadLength + this._valueLength;
|
|
@@ -26970,7 +26970,7 @@ var init_URLSearchParams = __esm({
|
|
|
26970
26970
|
});
|
|
26971
26971
|
|
|
26972
26972
|
// ../../node_modules/axios/lib/platform/node/index.js
|
|
26973
|
-
import
|
|
26973
|
+
import crypto2 from "crypto";
|
|
26974
26974
|
var ALPHA, DIGIT, ALPHABET, generateString, node_default;
|
|
26975
26975
|
var init_node2 = __esm({
|
|
26976
26976
|
"../../node_modules/axios/lib/platform/node/index.js"() {
|
|
@@ -26989,7 +26989,7 @@ var init_node2 = __esm({
|
|
|
26989
26989
|
let str = "";
|
|
26990
26990
|
const { length } = alphabet;
|
|
26991
26991
|
const randomValues = new Uint32Array(size);
|
|
26992
|
-
|
|
26992
|
+
crypto2.randomFillSync(randomValues);
|
|
26993
26993
|
for (let i = 0; i < size; i++) {
|
|
26994
26994
|
str += alphabet[randomValues[i] % length];
|
|
26995
26995
|
}
|
|
@@ -41124,7 +41124,7 @@ var init_source_website = __esm({
|
|
|
41124
41124
|
type: "website",
|
|
41125
41125
|
state: State,
|
|
41126
41126
|
async handler({ input, step: step2, state, client: client2 }) {
|
|
41127
|
-
const
|
|
41127
|
+
const crypto3 = await import("crypto");
|
|
41128
41128
|
console.log(
|
|
41129
41129
|
`Starting sync for WebsiteSource [${this.id}] in mode [${this.mode}, maxPages=${this.maxPages}, maxDepth=${this.maxDepth}, baseUrl=${this.baseUrl}, sitemapUrl=${this.sitemapUrl}]`
|
|
41130
41130
|
);
|
|
@@ -41207,7 +41207,7 @@ var init_source_website = __esm({
|
|
|
41207
41207
|
content,
|
|
41208
41208
|
metadata: fetchMetadata
|
|
41209
41209
|
} = await this.fetchUrl(sitemapUrl.loc);
|
|
41210
|
-
const hash =
|
|
41210
|
+
const hash = crypto3.createHash("sha256").update(content).digest("hex");
|
|
41211
41211
|
let contentType = fetchedContentType;
|
|
41212
41212
|
if (!contentType) {
|
|
41213
41213
|
contentType = content.includes("<html") ? "text/html" : "text/markdown";
|
|
@@ -48210,7 +48210,7 @@ var init_source_directory = __esm({
|
|
|
48210
48210
|
const glob2 = await Promise.resolve().then(() => (init_esm9(), esm_exports3));
|
|
48211
48211
|
const path4 = await import("path");
|
|
48212
48212
|
const fs3 = await import("fs/promises");
|
|
48213
|
-
const
|
|
48213
|
+
const crypto3 = await import("crypto");
|
|
48214
48214
|
const directory = path4.resolve(adk.environment.agent.directory, this.directoryPath);
|
|
48215
48215
|
const tags = {
|
|
48216
48216
|
[WellKnownTags.knowledge.KNOWLEDGE]: "knowledge-base",
|
|
@@ -48272,7 +48272,7 @@ var init_source_directory = __esm({
|
|
|
48272
48272
|
const upsertFile = async (local) => {
|
|
48273
48273
|
const key = `data_source://${this.type}/${this.id}/${local.rel}`;
|
|
48274
48274
|
const content = await fs3.readFile(local.abs);
|
|
48275
|
-
const hash =
|
|
48275
|
+
const hash = crypto3.createHash("sha256").update(content).digest("hex");
|
|
48276
48276
|
const { file } = await client2.getFile({ id: key }).catch(() => ({ file: null }));
|
|
48277
48277
|
const isFailed = file?.status === "indexing_failed" || file?.status === "upload_failed" || file?.status === "upload_pending";
|
|
48278
48278
|
if (!input.force && !isFailed && file?.metadata?.hash === hash) {
|