@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.
@@ -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
 
@@ -37081,7 +37081,8 @@ var init_source_website = __esm({
37081
37081
  toFetch.push(url2);
37082
37082
  } else {
37083
37083
  const existingMetadata = existing.metadata;
37084
- if (url2.lastmod && existingMetadata?.lastmod !== url2.lastmod) {
37084
+ const isFailed = existing.status === "indexing_failed" || existing.status === "upload_failed" || existing.status === "upload_pending";
37085
+ if (isFailed || url2.lastmod && existingMetadata?.lastmod !== url2.lastmod) {
37085
37086
  toFetch.push(url2);
37086
37087
  } else {
37087
37088
  skippedUnchanged++;
@@ -37168,14 +37169,18 @@ var init_source_website = __esm({
37168
37169
  return null;
37169
37170
  }
37170
37171
  };
37171
- console.log(`[SYNC DEBUG] Starting 'fetching and indexing pages' for ${toFetch.slice(0, this.maxPages).length} URLs...`);
37172
+ console.log(
37173
+ `[SYNC DEBUG] Starting 'fetching and indexing pages' for ${toFetch.slice(0, this.maxPages).length} URLs...`
37174
+ );
37172
37175
  const indexed = await step2.map(
37173
37176
  "fetching and indexing pages",
37174
37177
  toFetch.slice(0, this.maxPages),
37175
37178
  (url2) => fetchAndIndex(url2),
37176
37179
  { concurrency: 20, maxAttempts: 2 }
37177
37180
  );
37178
- console.log(`[SYNC DEBUG] Fetch complete. ${indexed.length} attempted, ${indexed.filter((f) => f !== null).length} successful`);
37181
+ console.log(
37182
+ `[SYNC DEBUG] Fetch complete. ${indexed.length} attempted, ${indexed.filter((f) => f !== null).length} successful`
37183
+ );
37179
37184
  const successful = indexed.filter((f) => f !== null);
37180
37185
  console.log(`[SYNC DEBUG] Starting dsData registration...`);
37181
37186
  await step2("register web page source", async () => {
@@ -37214,7 +37219,9 @@ var init_source_website = __esm({
37214
37219
  console.warn("Failed to register web page source in dsData state:", err);
37215
37220
  }
37216
37221
  });
37217
- console.log(`[SYNC DEBUG] \u2705 WebsiteSource sync complete for "${this.id}". Processed: ${discoveredUrls.length}, Added: ${successful.length}, Deleted: ${deleted.length}`);
37222
+ console.log(
37223
+ `[SYNC DEBUG] \u2705 WebsiteSource sync complete for "${this.id}". Processed: ${discoveredUrls.length}, Added: ${successful.length}, Deleted: ${deleted.length}`
37224
+ );
37218
37225
  return {
37219
37226
  processed: discoveredUrls.length,
37220
37227
  deleted,
@@ -44176,11 +44183,14 @@ var init_source_directory = __esm({
44176
44183
  const content = await fs3.readFile(local.abs);
44177
44184
  const hash = crypto2.createHash("sha256").update(content).digest("hex");
44178
44185
  const { file } = await client2.getFile({ id: key }).catch(() => ({ file: null }));
44179
- if (!input.force && file?.metadata?.hash === hash) {
44186
+ const isFailed = file?.status === "indexing_failed" || file?.status === "upload_failed" || file?.status === "upload_pending";
44187
+ if (!input.force && !isFailed && file?.metadata?.hash === hash) {
44180
44188
  console.log(`Skipping unchanged file: ${local.rel}`);
44181
44189
  return null;
44182
44190
  }
44183
- if (input.force && file?.metadata?.hash === hash) {
44191
+ if (isFailed) {
44192
+ console.log(`Re-indexing failed file (status: ${file?.status}): ${local.rel}`);
44193
+ } else if (input.force && file?.metadata?.hash === hash) {
44184
44194
  console.log(`Force re-indexing file (unchanged): ${local.rel}`);
44185
44195
  }
44186
44196
  const title = path4.basename(local.name, path4.extname(local.name));