@botpress/runtime 1.13.12 → 1.13.13

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/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.12", adk: "1.13.12", sdk: "5.0.2", llmz: "0.0.37", zai: "2.5.6", cognitive: "0.3.3" };
51
+ define_PACKAGE_VERSIONS_default = { runtime: "1.13.13", adk: "1.13.13", sdk: "5.0.2", llmz: "0.0.37", zai: "2.5.6", cognitive: "0.3.3" };
52
52
  }
53
53
  });
54
54
 
@@ -41172,7 +41172,8 @@ var init_source_website = __esm({
41172
41172
  toFetch.push(url2);
41173
41173
  } else {
41174
41174
  const existingMetadata = existing.metadata;
41175
- if (url2.lastmod && existingMetadata?.lastmod !== url2.lastmod) {
41175
+ const isFailed = existing.status === "indexing_failed" || existing.status === "upload_failed" || existing.status === "upload_pending";
41176
+ if (isFailed || url2.lastmod && existingMetadata?.lastmod !== url2.lastmod) {
41176
41177
  toFetch.push(url2);
41177
41178
  } else {
41178
41179
  skippedUnchanged++;
@@ -41259,14 +41260,18 @@ var init_source_website = __esm({
41259
41260
  return null;
41260
41261
  }
41261
41262
  };
41262
- console.log(`[SYNC DEBUG] Starting 'fetching and indexing pages' for ${toFetch.slice(0, this.maxPages).length} URLs...`);
41263
+ console.log(
41264
+ `[SYNC DEBUG] Starting 'fetching and indexing pages' for ${toFetch.slice(0, this.maxPages).length} URLs...`
41265
+ );
41263
41266
  const indexed = await step2.map(
41264
41267
  "fetching and indexing pages",
41265
41268
  toFetch.slice(0, this.maxPages),
41266
41269
  (url2) => fetchAndIndex(url2),
41267
41270
  { concurrency: 20, maxAttempts: 2 }
41268
41271
  );
41269
- console.log(`[SYNC DEBUG] Fetch complete. ${indexed.length} attempted, ${indexed.filter((f) => f !== null).length} successful`);
41272
+ console.log(
41273
+ `[SYNC DEBUG] Fetch complete. ${indexed.length} attempted, ${indexed.filter((f) => f !== null).length} successful`
41274
+ );
41270
41275
  const successful = indexed.filter((f) => f !== null);
41271
41276
  console.log(`[SYNC DEBUG] Starting dsData registration...`);
41272
41277
  await step2("register web page source", async () => {
@@ -41305,7 +41310,9 @@ var init_source_website = __esm({
41305
41310
  console.warn("Failed to register web page source in dsData state:", err);
41306
41311
  }
41307
41312
  });
41308
- console.log(`[SYNC DEBUG] \u2705 WebsiteSource sync complete for "${this.id}". Processed: ${discoveredUrls.length}, Added: ${successful.length}, Deleted: ${deleted.length}`);
41313
+ console.log(
41314
+ `[SYNC DEBUG] \u2705 WebsiteSource sync complete for "${this.id}". Processed: ${discoveredUrls.length}, Added: ${successful.length}, Deleted: ${deleted.length}`
41315
+ );
41309
41316
  return {
41310
41317
  processed: discoveredUrls.length,
41311
41318
  deleted,
@@ -48267,11 +48274,14 @@ var init_source_directory = __esm({
48267
48274
  const content = await fs3.readFile(local.abs);
48268
48275
  const hash = crypto2.createHash("sha256").update(content).digest("hex");
48269
48276
  const { file } = await client2.getFile({ id: key }).catch(() => ({ file: null }));
48270
- if (!input.force && file?.metadata?.hash === hash) {
48277
+ const isFailed = file?.status === "indexing_failed" || file?.status === "upload_failed" || file?.status === "upload_pending";
48278
+ if (!input.force && !isFailed && file?.metadata?.hash === hash) {
48271
48279
  console.log(`Skipping unchanged file: ${local.rel}`);
48272
48280
  return null;
48273
48281
  }
48274
- if (input.force && file?.metadata?.hash === hash) {
48282
+ if (isFailed) {
48283
+ console.log(`Re-indexing failed file (status: ${file?.status}): ${local.rel}`);
48284
+ } else if (input.force && file?.metadata?.hash === hash) {
48275
48285
  console.log(`Force re-indexing file (unchanged): ${local.rel}`);
48276
48286
  }
48277
48287
  const title = path4.basename(local.name, path4.extname(local.name));