@promptbook/cli 0.72.0-27 → 0.72.0-29

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/esm/index.es.js CHANGED
@@ -19,12 +19,15 @@ import { io } from 'socket.io-client';
19
19
  import Anthropic from '@anthropic-ai/sdk';
20
20
  import { OpenAIClient, AzureKeyCredential } from '@azure/openai';
21
21
  import OpenAI from 'openai';
22
+ import { Readability } from '@mozilla/readability';
23
+ import { JSDOM } from 'jsdom';
24
+ import { Converter } from 'showdown';
22
25
 
23
26
  // ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
24
27
  /**
25
28
  * The version of the Promptbook library
26
29
  */
27
- var PROMPTBOOK_VERSION = '0.72.0-26';
30
+ var PROMPTBOOK_VERSION = '0.72.0-28';
28
31
  // TODO: [main] !!!! List here all the versions and annotate + put into script
29
32
 
30
33
  /*! *****************************************************************************
@@ -14084,6 +14087,28 @@ var websiteScraperMetadata = $deepFreeze({
14084
14087
  */
14085
14088
  var _WebsiteScraperMetadataRegistration = $scrapersMetadataRegister.register(websiteScraperMetadata);
14086
14089
 
14090
+ /**
14091
+ * Create a new showdown converter instance
14092
+ *
14093
+ * @private utility of `WebsiteScraper`
14094
+ */
14095
+ function createShowdownConverter() {
14096
+ return new Converter({
14097
+ flavor: 'github',
14098
+ /*
14099
+ > import showdownHighlight from 'showdown-highlight';
14100
+ > extensions: [
14101
+ > showdownHighlight({
14102
+ > // Whether to add the classes to the <pre> tag, default is false
14103
+ > pre: true,
14104
+ > // Whether to use hljs' auto language detection, default is true
14105
+ > auto_detection: true,
14106
+ > }),
14107
+ > ],
14108
+ */
14109
+ });
14110
+ }
14111
+
14087
14112
  /**
14088
14113
  * Scraper for websites
14089
14114
  *
@@ -14095,6 +14120,12 @@ var WebsiteScraper = /** @class */ (function () {
14095
14120
  this.tools = tools;
14096
14121
  this.options = options;
14097
14122
  this.markdownScraper = new MarkdownScraper(tools, options);
14123
+ // TODO: !!!!!! Remove
14124
+ TODO_USE(Readability);
14125
+ TODO_USE(Converter);
14126
+ TODO_USE(JSDOM);
14127
+ TODO_USE(createShowdownConverter);
14128
+ this.showdownConverter = createShowdownConverter();
14098
14129
  }
14099
14130
  Object.defineProperty(WebsiteScraper.prototype, "metadata", {
14100
14131
  /**
@@ -14115,9 +14146,6 @@ var WebsiteScraper = /** @class */ (function () {
14115
14146
  return __awaiter(this, void 0, void 0, function () {
14116
14147
  var markdown;
14117
14148
  return __generator(this, function (_a) {
14118
- if (source.url === null) {
14119
- throw new KnowledgeScrapeError('Website scraper requires URL');
14120
- }
14121
14149
  markdown = "";
14122
14150
  return [2 /*return*/, __assign(__assign({}, source), { markdown: markdown, destroy: function () { } })];
14123
14151
  });