@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/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.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
 
@@ -41149,7 +41149,8 @@ var init_source_website = __esm({
41149
41149
  toFetch.push(url2);
41150
41150
  } else {
41151
41151
  const existingMetadata = existing.metadata;
41152
- if (url2.lastmod && existingMetadata?.lastmod !== url2.lastmod) {
41152
+ const isFailed = existing.status === "indexing_failed" || existing.status === "upload_failed" || existing.status === "upload_pending";
41153
+ if (isFailed || url2.lastmod && existingMetadata?.lastmod !== url2.lastmod) {
41153
41154
  toFetch.push(url2);
41154
41155
  } else {
41155
41156
  skippedUnchanged++;
@@ -41236,14 +41237,18 @@ var init_source_website = __esm({
41236
41237
  return null;
41237
41238
  }
41238
41239
  };
41239
- console.log(`[SYNC DEBUG] Starting 'fetching and indexing pages' for ${toFetch.slice(0, this.maxPages).length} URLs...`);
41240
+ console.log(
41241
+ `[SYNC DEBUG] Starting 'fetching and indexing pages' for ${toFetch.slice(0, this.maxPages).length} URLs...`
41242
+ );
41240
41243
  const indexed = await step2.map(
41241
41244
  "fetching and indexing pages",
41242
41245
  toFetch.slice(0, this.maxPages),
41243
41246
  (url2) => fetchAndIndex(url2),
41244
41247
  { concurrency: 20, maxAttempts: 2 }
41245
41248
  );
41246
- console.log(`[SYNC DEBUG] Fetch complete. ${indexed.length} attempted, ${indexed.filter((f) => f !== null).length} successful`);
41249
+ console.log(
41250
+ `[SYNC DEBUG] Fetch complete. ${indexed.length} attempted, ${indexed.filter((f) => f !== null).length} successful`
41251
+ );
41247
41252
  const successful = indexed.filter((f) => f !== null);
41248
41253
  console.log(`[SYNC DEBUG] Starting dsData registration...`);
41249
41254
  await step2("register web page source", async () => {
@@ -41282,7 +41287,9 @@ var init_source_website = __esm({
41282
41287
  console.warn("Failed to register web page source in dsData state:", err);
41283
41288
  }
41284
41289
  });
41285
- console.log(`[SYNC DEBUG] \u2705 WebsiteSource sync complete for "${this.id}". Processed: ${discoveredUrls.length}, Added: ${successful.length}, Deleted: ${deleted.length}`);
41290
+ console.log(
41291
+ `[SYNC DEBUG] \u2705 WebsiteSource sync complete for "${this.id}". Processed: ${discoveredUrls.length}, Added: ${successful.length}, Deleted: ${deleted.length}`
41292
+ );
41286
41293
  return {
41287
41294
  processed: discoveredUrls.length,
41288
41295
  deleted,
@@ -48244,11 +48251,14 @@ var init_source_directory = __esm({
48244
48251
  const content = await fs3.readFile(local.abs);
48245
48252
  const hash = crypto2.createHash("sha256").update(content).digest("hex");
48246
48253
  const { file } = await client2.getFile({ id: key }).catch(() => ({ file: null }));
48247
- if (!input.force && file?.metadata?.hash === hash) {
48254
+ const isFailed = file?.status === "indexing_failed" || file?.status === "upload_failed" || file?.status === "upload_pending";
48255
+ if (!input.force && !isFailed && file?.metadata?.hash === hash) {
48248
48256
  console.log(`Skipping unchanged file: ${local.rel}`);
48249
48257
  return null;
48250
48258
  }
48251
- if (input.force && file?.metadata?.hash === hash) {
48259
+ if (isFailed) {
48260
+ console.log(`Re-indexing failed file (status: ${file?.status}): ${local.rel}`);
48261
+ } else if (input.force && file?.metadata?.hash === hash) {
48252
48262
  console.log(`Force re-indexing file (unchanged): ${local.rel}`);
48253
48263
  }
48254
48264
  const title = path5.basename(local.name, path5.extname(local.name));