@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/internal.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
|
|
|
@@ -26654,7 +26654,7 @@ var require_form_data = __commonJS({
|
|
|
26654
26654
|
var parseUrl = __require("url").parse;
|
|
26655
26655
|
var fs3 = __require("fs");
|
|
26656
26656
|
var Stream2 = __require("stream").Stream;
|
|
26657
|
-
var
|
|
26657
|
+
var crypto3 = __require("crypto");
|
|
26658
26658
|
var mime = require_mime_types();
|
|
26659
26659
|
var asynckit = require_asynckit();
|
|
26660
26660
|
var setToStringTag = require_es_set_tostringtag();
|
|
@@ -26860,7 +26860,7 @@ var require_form_data = __commonJS({
|
|
|
26860
26860
|
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
26861
26861
|
};
|
|
26862
26862
|
FormData3.prototype._generateBoundary = function() {
|
|
26863
|
-
this._boundary = "--------------------------" +
|
|
26863
|
+
this._boundary = "--------------------------" + crypto3.randomBytes(12).toString("hex");
|
|
26864
26864
|
};
|
|
26865
26865
|
FormData3.prototype.getLengthSync = function() {
|
|
26866
26866
|
var knownLength = this._overheadLength + this._valueLength;
|
|
@@ -27281,7 +27281,7 @@ var init_URLSearchParams = __esm({
|
|
|
27281
27281
|
});
|
|
27282
27282
|
|
|
27283
27283
|
// ../../node_modules/axios/lib/platform/node/index.js
|
|
27284
|
-
import
|
|
27284
|
+
import crypto2 from "crypto";
|
|
27285
27285
|
var ALPHA, DIGIT, ALPHABET, generateString, node_default;
|
|
27286
27286
|
var init_node2 = __esm({
|
|
27287
27287
|
"../../node_modules/axios/lib/platform/node/index.js"() {
|
|
@@ -27300,7 +27300,7 @@ var init_node2 = __esm({
|
|
|
27300
27300
|
let str = "";
|
|
27301
27301
|
const { length } = alphabet;
|
|
27302
27302
|
const randomValues = new Uint32Array(size);
|
|
27303
|
-
|
|
27303
|
+
crypto2.randomFillSync(randomValues);
|
|
27304
27304
|
for (let i = 0; i < size; i++) {
|
|
27305
27305
|
str += alphabet[randomValues[i] % length];
|
|
27306
27306
|
}
|
|
@@ -41101,7 +41101,7 @@ var init_source_website = __esm({
|
|
|
41101
41101
|
type: "website",
|
|
41102
41102
|
state: State,
|
|
41103
41103
|
async handler({ input, step: step2, state, client: client2 }) {
|
|
41104
|
-
const
|
|
41104
|
+
const crypto3 = await import("crypto");
|
|
41105
41105
|
console.log(
|
|
41106
41106
|
`Starting sync for WebsiteSource [${this.id}] in mode [${this.mode}, maxPages=${this.maxPages}, maxDepth=${this.maxDepth}, baseUrl=${this.baseUrl}, sitemapUrl=${this.sitemapUrl}]`
|
|
41107
41107
|
);
|
|
@@ -41184,7 +41184,7 @@ var init_source_website = __esm({
|
|
|
41184
41184
|
content,
|
|
41185
41185
|
metadata: fetchMetadata
|
|
41186
41186
|
} = await this.fetchUrl(sitemapUrl.loc);
|
|
41187
|
-
const hash =
|
|
41187
|
+
const hash = crypto3.createHash("sha256").update(content).digest("hex");
|
|
41188
41188
|
let contentType = fetchedContentType;
|
|
41189
41189
|
if (!contentType) {
|
|
41190
41190
|
contentType = content.includes("<html") ? "text/html" : "text/markdown";
|
|
@@ -48187,7 +48187,7 @@ var init_source_directory = __esm({
|
|
|
48187
48187
|
const glob2 = await Promise.resolve().then(() => (init_esm9(), esm_exports3));
|
|
48188
48188
|
const path5 = await import("path");
|
|
48189
48189
|
const fs3 = await import("fs/promises");
|
|
48190
|
-
const
|
|
48190
|
+
const crypto3 = await import("crypto");
|
|
48191
48191
|
const directory = path5.resolve(adk.environment.agent.directory, this.directoryPath);
|
|
48192
48192
|
const tags = {
|
|
48193
48193
|
[WellKnownTags.knowledge.KNOWLEDGE]: "knowledge-base",
|
|
@@ -48249,7 +48249,7 @@ var init_source_directory = __esm({
|
|
|
48249
48249
|
const upsertFile = async (local) => {
|
|
48250
48250
|
const key = `data_source://${this.type}/${this.id}/${local.rel}`;
|
|
48251
48251
|
const content = await fs3.readFile(local.abs);
|
|
48252
|
-
const hash =
|
|
48252
|
+
const hash = crypto3.createHash("sha256").update(content).digest("hex");
|
|
48253
48253
|
const { file } = await client2.getFile({ id: key }).catch(() => ({ file: null }));
|
|
48254
48254
|
const isFailed = file?.status === "indexing_failed" || file?.status === "upload_failed" || file?.status === "upload_pending";
|
|
48255
48255
|
if (!input.force && !isFailed && file?.metadata?.hash === hash) {
|