@promptbook/cli 0.92.0-24 → 0.92.0-25

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.
Files changed (72) hide show
  1. package/esm/index.es.js +116 -99
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/core.index.d.ts +0 -2
  4. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -28
  5. package/esm/typings/src/constants.d.ts +2 -2
  6. package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
  7. package/esm/typings/src/execution/CommonToolsOptions.d.ts +3 -3
  8. package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
  9. package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
  10. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
  11. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +5 -5
  12. package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +5 -3
  13. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
  14. package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
  15. package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
  16. package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
  17. package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
  18. package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
  19. package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
  20. package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +9 -6
  21. package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +2 -2
  22. package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
  23. package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
  24. package/esm/typings/src/prepare/prepareTasks.d.ts +7 -4
  25. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +2 -1
  26. package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
  27. package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
  28. package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
  29. package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
  30. package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
  31. package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
  32. package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
  33. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
  34. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
  35. package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
  36. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
  37. package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
  38. package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
  39. package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
  40. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
  41. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
  42. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
  43. package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
  44. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
  45. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
  46. package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
  47. package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
  48. package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
  49. package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
  50. package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
  51. package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
  52. package/esm/typings/src/types/ModelVariant.d.ts +5 -5
  53. package/esm/typings/src/types/typeAliases.d.ts +8 -6
  54. package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
  55. package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
  56. package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
  57. package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
  58. package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
  59. package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
  60. package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
  61. package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
  62. package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
  63. package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
  64. package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
  65. package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
  66. package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
  67. package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
  68. package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
  69. package/esm/typings/src/version.d.ts +2 -1
  70. package/package.json +1 -1
  71. package/umd/index.umd.js +116 -99
  72. package/umd/index.umd.js.map +1 -1
package/esm/index.es.js CHANGED
@@ -47,7 +47,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
47
47
  * @generated
48
48
  * @see https://github.com/webgptorg/promptbook
49
49
  */
50
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-24';
50
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-25';
51
51
  /**
52
52
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
53
53
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -724,10 +724,10 @@ function $getGlobalScope() {
724
724
  }
725
725
 
726
726
  /**
727
- * @@@
727
+ * Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
728
728
  *
729
- * @param text @@@
730
- * @returns @@@
729
+ * @param text The text string to be converted to SCREAMING_CASE format.
730
+ * @returns The normalized text in SCREAMING_CASE format.
731
731
  * @example 'HELLO_WORLD'
732
732
  * @example 'I_LOVE_PROMPTBOOK'
733
733
  * @public exported from `@promptbook/utils`
@@ -779,10 +779,10 @@ function normalizeTo_SCREAMING_CASE(text) {
779
779
  */
780
780
 
781
781
  /**
782
- * @@@
782
+ * Normalizes a text string to snake_case format.
783
783
  *
784
- * @param text @@@
785
- * @returns @@@
784
+ * @param text The text string to be converted to snake_case format.
785
+ * @returns The normalized text in snake_case format.
786
786
  * @example 'hello_world'
787
787
  * @example 'i_love_promptbook'
788
788
  * @public exported from `@promptbook/utils`
@@ -840,10 +840,10 @@ class $Register {
840
840
  }
841
841
 
842
842
  /**
843
- * @@@
843
+ * Register for LLM tools metadata.
844
844
  *
845
845
  * Note: `$` is used to indicate that this interacts with the global scope
846
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
846
+ * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
847
847
  * @public exported from `@promptbook/core`
848
848
  */
849
849
  const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
@@ -852,10 +852,10 @@ const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
852
852
  */
853
853
 
854
854
  /**
855
- * @@@
855
+ * Register for LLM tools.
856
856
  *
857
857
  * Note: `$` is used to indicate that this interacts with the global scope
858
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
858
+ * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
859
859
  * @public exported from `@promptbook/core`
860
860
  */
861
861
  const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
@@ -1115,7 +1115,8 @@ function TODO_USE(...value) {
1115
1115
  }
1116
1116
 
1117
1117
  /**
1118
- * @@@
1118
+ * Provides filesystem access (for example for Node.js-based scrapers)
1119
+ * Creates a standardized filesystem interface that scrapers can use for file operations.
1119
1120
  *
1120
1121
  * @public exported from `@promptbook/node`
1121
1122
  */
@@ -1577,13 +1578,13 @@ const ORDER_OF_PIPELINE_JSON = [
1577
1578
  */
1578
1579
  const REPLACING_NONCE = 'ptbkauk42kV2dzao34faw7FudQUHYPtW';
1579
1580
  /**
1580
- * @@@
1581
+ * Placeholder value indicating a parameter is missing its value.
1581
1582
  *
1582
1583
  * @private within the repository
1583
1584
  */
1584
1585
  const RESERVED_PARAMETER_MISSING_VALUE = 'MISSING-' + REPLACING_NONCE;
1585
1586
  /**
1586
- * @@@
1587
+ * Placeholder value indicating a parameter is restricted and cannot be used directly.
1587
1588
  *
1588
1589
  * @private within the repository
1589
1590
  */
@@ -2018,10 +2019,10 @@ for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
2018
2019
  */
2019
2020
 
2020
2021
  /**
2021
- * @@@
2022
+ * Removes diacritic marks (accents) from characters in a string.
2022
2023
  *
2023
- * @param input @@@
2024
- * @returns @@@
2024
+ * @param input The string containing diacritics to be normalized.
2025
+ * @returns The string with diacritics removed or normalized.
2025
2026
  * @public exported from `@promptbook/utils`
2026
2027
  */
2027
2028
  function removeDiacritics(input) {
@@ -2035,10 +2036,10 @@ function removeDiacritics(input) {
2035
2036
  */
2036
2037
 
2037
2038
  /**
2038
- * @@@
2039
+ * Converts a given text to kebab-case format.
2039
2040
  *
2040
- * @param text @@@
2041
- * @returns @@@
2041
+ * @param text The text to be converted.
2042
+ * @returns The kebab-case formatted string.
2042
2043
  * @example 'hello-world'
2043
2044
  * @example 'i-love-promptbook'
2044
2045
  * @public exported from `@promptbook/utils`
@@ -2086,11 +2087,11 @@ function normalizeToKebabCase(text) {
2086
2087
  */
2087
2088
 
2088
2089
  /**
2089
- * @@@
2090
+ * Converts a title string into a normalized name.
2090
2091
  *
2091
- * @param value @@@
2092
- * @returns @@@
2093
- * @example @@@
2092
+ * @param value The title string to be converted to a name.
2093
+ * @returns A normalized name derived from the input title.
2094
+ * @example 'Hello World!' -> 'hello-world'
2094
2095
  * @public exported from `@promptbook/utils`
2095
2096
  */
2096
2097
  function titleToName(value) {
@@ -2110,7 +2111,8 @@ function titleToName(value) {
2110
2111
  }
2111
2112
 
2112
2113
  /**
2113
- * @@@
2114
+ * Converts a name to a properly formatted subfolder path for cache storage.
2115
+ * Handles normalization and path formatting to create consistent cache directory structures.
2114
2116
  *
2115
2117
  * @private for `FileCacheStorage`
2116
2118
  */
@@ -2119,7 +2121,10 @@ function nameToSubfolderPath(name) {
2119
2121
  }
2120
2122
 
2121
2123
  /**
2122
- * @@@
2124
+ * A storage implementation that caches data in files organized in a directory structure.
2125
+ * Provides methods for retrieving, storing, and managing cached data on the filesystem.
2126
+ *
2127
+ * This class implements the PromptbookStorage interface for filesystem-based caching.
2123
2128
  *
2124
2129
  * @public exported from `@promptbook/node`
2125
2130
  */
@@ -2132,7 +2137,8 @@ class FileCacheStorage {
2132
2137
  }
2133
2138
  }
2134
2139
  /**
2135
- * @@@
2140
+ * Converts a storage key to a filesystem path where the data should be stored.
2141
+ * Creates a consistent, deterministic file path based on the key string.
2136
2142
  */
2137
2143
  getFilenameForKey(key) {
2138
2144
  // TODO: [👬] DRY
@@ -2144,7 +2150,8 @@ class FileCacheStorage {
2144
2150
  ...nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */), `${name.substring(0, MAX_FILENAME_LENGTH)}.json`);
2145
2151
  }
2146
2152
  /**
2147
- * @@@ Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
2153
+ * Returns the current value associated with the given key, or null if the given key does not exist.
2154
+ * Retrieves the cached data from the file system storage.
2148
2155
  */
2149
2156
  async getItem(key) {
2150
2157
  const filename = this.getFilenameForKey(key);
@@ -2157,7 +2164,8 @@ class FileCacheStorage {
2157
2164
  return value;
2158
2165
  }
2159
2166
  /**
2160
- * @@@ Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
2167
+ * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
2168
+ * Persists data to the file system, creating necessary directory structure if it doesn't exist.
2161
2169
  */
2162
2170
  async setItem(key, value) {
2163
2171
  const filename = this.getFilenameForKey(key);
@@ -2169,7 +2177,8 @@ class FileCacheStorage {
2169
2177
  await writeFile(filename, fileContent, 'utf-8');
2170
2178
  }
2171
2179
  /**
2172
- * @@@ Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.
2180
+ * Removes the key/value pair with the given key from the storage, if a key/value pair with the given key exists.
2181
+ * Deletes the corresponding file from the filesystem.
2173
2182
  */
2174
2183
  async removeItem(key) {
2175
2184
  const filename = this.getFilenameForKey(key);
@@ -2984,9 +2993,8 @@ function countUsage(llmTools) {
2984
2993
  */
2985
2994
 
2986
2995
  /**
2987
- * @@@
2996
+ * Provides LLM tools configuration by reading environment variables.
2988
2997
  *
2989
- * @@@ .env
2990
2998
  * Note: `$` is used to indicate that this function is not a pure function - it uses filesystem to access `.env` file
2991
2999
  *
2992
3000
  * It looks for environment variables:
@@ -2994,7 +3002,8 @@ function countUsage(llmTools) {
2994
3002
  * - `process.env.ANTHROPIC_CLAUDE_API_KEY`
2995
3003
  * - ...
2996
3004
  *
2997
- * @returns @@@
3005
+ * @see Environment variables documentation or .env file for required variables.
3006
+ * @returns A promise that resolves to the LLM tools configuration, or null if configuration is incomplete or missing.
2998
3007
  * @public exported from `@promptbook/node`
2999
3008
  */
3000
3009
  async function $provideLlmToolsConfigurationFromEnv() {
@@ -3912,10 +3921,11 @@ async function $provideExecutablesForNode(options) {
3912
3921
  */
3913
3922
 
3914
3923
  /**
3915
- * @@@
3924
+ * Registry for all available scrapers in the system.
3925
+ * Central point for registering and accessing different types of content scrapers.
3916
3926
  *
3917
3927
  * Note: `$` is used to indicate that this interacts with the global scope
3918
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
3928
+ * @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
3919
3929
  * @public exported from `@promptbook/core`
3920
3930
  */
3921
3931
  const $scrapersRegister = new $Register('scraper_constructors');
@@ -3924,11 +3934,9 @@ const $scrapersRegister = new $Register('scraper_constructors');
3924
3934
  */
3925
3935
 
3926
3936
  /**
3927
- * @@@
3928
- *
3929
- * 1) @@@
3930
- * 2) @@@
3931
- *
3937
+ * Provides a collection of scrapers optimized for Node.js environment.
3938
+ * 1) `provideScrapersForNode` use as default
3939
+ * 2) `provideScrapersForBrowser` use in limited browser environment *
3932
3940
  * @public exported from `@promptbook/node`
3933
3941
  */
3934
3942
  async function $provideScrapersForNode(tools, options) {
@@ -4944,8 +4952,8 @@ function createCollectionFromJson(...promptbooks) {
4944
4952
  * @public exported from `@promptbook/core`
4945
4953
  */
4946
4954
  function isPipelinePrepared(pipeline) {
4947
- // Note: Ignoring `pipeline.preparations` @@@
4948
- // Note: Ignoring `pipeline.knowledgePieces` @@@
4955
+ // Note: Ignoring `pipeline.preparations`
4956
+ // Note: Ignoring `pipeline.knowledgePieces`
4949
4957
  if (pipeline.title === undefined || pipeline.title === '' || pipeline.title === DEFAULT_BOOK_TITLE) {
4950
4958
  // TODO: !!! Comment this out
4951
4959
  console.log('Pipeline is not prepared because title is undefined or empty', pipeline);
@@ -5745,7 +5753,7 @@ function mapAvailableToExpectedParameters(options) {
5745
5753
  else if (!availableParametersNames.has(parameterName) && expectedParameterNames.has(parameterName)) ;
5746
5754
  }
5747
5755
  if (expectedParameterNames.size === 0) {
5748
- // Note: [👨‍👨‍👧] Now we can freeze `mappedParameters` to prevent @@@
5756
+ // Note: [👨‍👨‍👧] Now we can freeze `mappedParameters` to prevent accidental modifications after mapping
5749
5757
  Object.freeze(mappedParameters);
5750
5758
  return mappedParameters;
5751
5759
  }
@@ -5776,7 +5784,7 @@ function mapAvailableToExpectedParameters(options) {
5776
5784
  for (let i = 0; i < expectedParameterNames.size; i++) {
5777
5785
  mappedParameters[expectedParameterNamesArray[i]] = availableParameters[availableParametersNamesArray[i]];
5778
5786
  }
5779
- // Note: [👨‍👨‍👧] Now we can freeze `mappedParameters` to prevent @@@
5787
+ // Note: [👨‍👨‍👧] Now we can freeze `mappedParameters` to prevent accidental modifications after mapping
5780
5788
  Object.freeze(mappedParameters);
5781
5789
  return mappedParameters;
5782
5790
  }
@@ -6548,11 +6556,10 @@ async function executeFormatSubvalues(options) {
6548
6556
  const highLevelError = new PipelineExecutionError(spaceTrim((block) => `
6549
6557
  ${error.message}
6550
6558
 
6551
- This is error in FOREACH command when mapping data
6559
+ This is error in FOREACH command when mapping ${formatDefinition.formatName} ${subvalueParser.subvalueName} data (${index + 1}/${length})
6552
6560
  You have probbably passed wrong data to pipeline or wrong data was generated which are processed by FOREACH command
6553
6561
 
6554
6562
  ${block(pipelineIdentification)}
6555
- Subparameter index: ${index}
6556
6563
  `));
6557
6564
  if (length > BIG_DATASET_TRESHOLD) {
6558
6565
  console.error(highLevelError);
@@ -6580,12 +6587,11 @@ async function executeFormatSubvalues(options) {
6580
6587
  catch (error) {
6581
6588
  if (length > BIG_DATASET_TRESHOLD) {
6582
6589
  console.error(spaceTrim((block) => `
6583
- Error in FOREACH command:
6590
+ ${error.message}
6584
6591
 
6585
- ${block(pipelineIdentification)}
6592
+ This is error in FOREACH command when processing ${formatDefinition.formatName} ${subvalueParser.subvalueName} data (${index + 1}/${length})
6586
6593
 
6587
6594
  ${block(pipelineIdentification)}
6588
- Subparameter index: ${index}
6589
6595
  `));
6590
6596
  return FAILED_VALUE_PLACEHOLDER;
6591
6597
  }
@@ -7406,7 +7412,9 @@ function mimeTypeToExtension(value) {
7406
7412
  }
7407
7413
 
7408
7414
  /**
7409
- * @@@
7415
+ * Factory function that creates a handler for processing knowledge sources.
7416
+ * Provides standardized processing of different types of knowledge sources
7417
+ * across various scraper implementations.
7410
7418
  *
7411
7419
  * @public exported from `@promptbook/core`
7412
7420
  */
@@ -7647,9 +7655,12 @@ TODO: [🧊] This is how it can look in future
7647
7655
  */
7648
7656
 
7649
7657
  /**
7650
- * @@@
7658
+ * Prepares tasks by adding knowledge to the prompt and ensuring all necessary parameters are included.
7651
7659
  *
7652
- * @public exported from `@promptbook/core`
7660
+ * @param tasks Sequence of tasks that are chained together to form a pipeline
7661
+ * @returns A promise that resolves to the prepared tasks.
7662
+ *
7663
+ * @private internal utility of `preparePipeline`
7653
7664
  */
7654
7665
  async function prepareTasks(pipeline, tools, options) {
7655
7666
  const { maxParallelCount = DEFAULT_MAX_PARALLEL_COUNT } = options;
@@ -8555,11 +8566,11 @@ const expectCommandParser = {
8555
8566
  };
8556
8567
 
8557
8568
  /**
8558
- * @@@
8569
+ * Normalizes a given text to camelCase format.
8559
8570
  *
8560
- * @param text @@@
8561
- * @param _isFirstLetterCapital @@@
8562
- * @returns @@@
8571
+ * @param text The text to be normalized.
8572
+ * @param _isFirstLetterCapital Whether the first letter should be capitalized.
8573
+ * @returns The camelCase formatted string.
8563
8574
  * @example 'helloWorld'
8564
8575
  * @example 'iLovePromptbook'
8565
8576
  * @public exported from `@promptbook/utils`
@@ -9047,7 +9058,7 @@ const GeneratorFormfactorDefinition = {
9047
9058
  };
9048
9059
 
9049
9060
  /**
9050
- * @@@
9061
+ * Pipeline interface which is equivalent to `any`
9051
9062
  *
9052
9063
  * @see https://github.com/webgptorg/promptbook/discussions/171
9053
9064
  *
@@ -9377,8 +9388,7 @@ const jokerCommandParser = {
9377
9388
  };
9378
9389
 
9379
9390
  /**
9380
- * @@@
9381
- *
9391
+ * @see {@link ModelVariant}
9382
9392
  * @public exported from `@promptbook/core`
9383
9393
  */
9384
9394
  const MODEL_VARIANTS = ['COMPLETION', 'CHAT', 'EMBEDDING' /* <- TODO [🏳] */ /* <- [🤖] */];
@@ -10351,7 +10361,7 @@ function parseCommandVariant(input) {
10351
10361
  }
10352
10362
 
10353
10363
  /**
10354
- * @@@
10364
+ * Extracts the interface (input and output parameters) from a pipeline.
10355
10365
  *
10356
10366
  * @deprecated https://github.com/webgptorg/promptbook/pull/186
10357
10367
  * @see https://github.com/webgptorg/promptbook/discussions/171
@@ -10384,7 +10394,7 @@ function getPipelineInterface(pipeline) {
10384
10394
  }
10385
10395
 
10386
10396
  /**
10387
- * @@@
10397
+ * Checks if two pipeline interfaces are structurally identical.
10388
10398
  *
10389
10399
  * @deprecated https://github.com/webgptorg/promptbook/pull/186
10390
10400
  * @see https://github.com/webgptorg/promptbook/discussions/171
@@ -10416,10 +10426,11 @@ function isPipelineInterfacesEqual(pipelineInterface1, pipelineInterface2) {
10416
10426
  }
10417
10427
 
10418
10428
  /**
10419
- * @@@
10429
+ * Checks if a given pipeline satisfies the requirements of a specified pipeline interface.
10420
10430
  *
10421
10431
  * @deprecated https://github.com/webgptorg/promptbook/pull/186
10422
10432
  * @see https://github.com/webgptorg/promptbook/discussions/171
10433
+ * @returns `true` if the pipeline implements the interface, `false` otherwise.
10423
10434
  *
10424
10435
  * @public exported from `@promptbook/core`
10425
10436
  */
@@ -10605,7 +10616,8 @@ function removeMarkdownComments(content) {
10605
10616
  }
10606
10617
 
10607
10618
  /**
10608
- * @@@
10619
+ * Utility to determine if a pipeline string is in flat format.
10620
+ * A flat pipeline is a simple text without proper structure (headers, blocks, etc).
10609
10621
  *
10610
10622
  * @public exported from `@promptbook/editable`
10611
10623
  */
@@ -10626,7 +10638,10 @@ function isFlatPipeline(pipelineString) {
10626
10638
  }
10627
10639
 
10628
10640
  /**
10629
- * @@@
10641
+ * Converts a pipeline structure to its string representation.
10642
+ *
10643
+ * Transforms a flat, simple pipeline into a properly formatted pipeline string
10644
+ * with sections for title, prompt, and return statement.
10630
10645
  *
10631
10646
  * @public exported from `@promptbook/editable`
10632
10647
  */
@@ -10683,7 +10698,7 @@ function deflatePipeline(pipelineString) {
10683
10698
  * Note: It can not work with html syntax and comments
10684
10699
  *
10685
10700
  * @param markdown any valid markdown
10686
- * @returns @@@
10701
+ * @returns An array of strings, each representing an individual list item found in the markdown
10687
10702
  * @public exported from `@promptbook/markdown-utils`
10688
10703
  */
10689
10704
  function extractAllListItemsFromMarkdown(markdown) {
@@ -11447,11 +11462,11 @@ function parseKeywordsFromString(input) {
11447
11462
  }
11448
11463
 
11449
11464
  /**
11450
- * @@@
11465
+ * Converts a name string into a URI-compatible format.
11451
11466
  *
11452
- * @param name @@@
11453
- * @returns @@@
11454
- * @example @@@
11467
+ * @param name The string to be converted to a URI-compatible format.
11468
+ * @returns A URI-compatible string derived from the input name.
11469
+ * @example 'Hello World' -> 'hello-world'
11455
11470
  * @public exported from `@promptbook/utils`
11456
11471
  */
11457
11472
  function nameToUriPart(name) {
@@ -11465,11 +11480,11 @@ function nameToUriPart(name) {
11465
11480
  }
11466
11481
 
11467
11482
  /**
11468
- * @@@
11483
+ * Converts a given name into URI-compatible parts.
11469
11484
  *
11470
- * @param name @@@
11471
- * @returns @@@
11472
- * @example @@@
11485
+ * @param name The name to be converted into URI parts.
11486
+ * @returns An array of URI-compatible parts derived from the name.
11487
+ * @example 'Example Name' -> ['example', 'name']
11473
11488
  * @public exported from `@promptbook/utils`
11474
11489
  */
11475
11490
  function nameToUriParts(name) {
@@ -17592,9 +17607,8 @@ const _OpenAiAssistantRegistration = $llmToolsRegister.register(createOpenAiAssi
17592
17607
  */
17593
17608
 
17594
17609
  /**
17595
- * Create a filename for intermediate cache for scrapers
17596
- *
17597
- * Note: It also checks if directory exists and creates it if not
17610
+ * Retrieves an intermediate source for a scraper based on the knowledge source.
17611
+ * Manages the caching and retrieval of intermediate scraper results for optimized performance.
17598
17612
  *
17599
17613
  * @private as internal utility for scrapers
17600
17614
  */
@@ -17821,14 +17835,14 @@ const boilerplateScraperMetadata = $deepFreeze({
17821
17835
  packageName: '@promptbook/boilerplate',
17822
17836
  className: 'BoilerplateScraper',
17823
17837
  mimeTypes: [
17824
- '@@@/@@@',
17825
- // <- TODO: @@@ Add compatible mime types with Boilerplate scraper
17838
+ '@@/@@',
17839
+ // <- TODO: @@ Add compatible mime types with Boilerplate scraper
17826
17840
  ],
17827
- documentationUrl: 'https://github.com/webgptorg/promptbook/discussions/@@@',
17841
+ documentationUrl: 'https://github.com/webgptorg/promptbook/discussions/@@',
17828
17842
  isAvilableInBrowser: false,
17829
17843
  // <- Note: [🌏] Only `MarkdownScraper` makes sense to be available in the browser, for scraping non-markdown sources in the browser use a remote server
17830
17844
  requiredExecutables: [
17831
- /* @@@ 'Pandoc' */
17845
+ /* @@ 'Pandoc' */
17832
17846
  ],
17833
17847
  }); /* <- Note: [🤛] */
17834
17848
  /**
@@ -17846,7 +17860,7 @@ const _BoilerplateScraperMetadataRegistration = $scrapersMetadataRegister.regist
17846
17860
  */
17847
17861
 
17848
17862
  /**
17849
- * Scraper of @@@ files
17863
+ * Scraper of @@ files
17850
17864
  *
17851
17865
  * @see `documentationUrl` for more details
17852
17866
  * @public exported from `@promptbook/boilerplate`
@@ -17864,30 +17878,30 @@ class BoilerplateScraper {
17864
17878
  this.markdownScraper = new MarkdownScraper(tools, options);
17865
17879
  }
17866
17880
  /**
17867
- * Convert the `.@@@` to `.md` file and returns intermediate source
17881
+ * Convert the `.@@` to `.md` file and returns intermediate source
17868
17882
  *
17869
17883
  * Note: `$` is used to indicate that this function is not a pure function - it leaves files on the disk and you are responsible for cleaning them by calling `destroy` method of returned object
17870
17884
  */
17871
17885
  async $convert(source) {
17872
17886
  var _a;
17873
17887
  const { rootDirname = process.cwd(), cacheDirname = DEFAULT_SCRAPE_CACHE_DIRNAME, intermediateFilesStrategy = DEFAULT_INTERMEDIATE_FILES_STRATEGY, isVerbose = DEFAULT_IS_VERBOSE, } = this.options;
17874
- // TODO: @@@ Preserve or delete
17888
+ // TODO: @@ Preserve or delete
17875
17889
  if (!$isRunningInNode()) {
17876
17890
  throw new KnowledgeScrapeError('BoilerplateScraper is only supported in Node environment');
17877
17891
  }
17878
- // TODO: @@@ Preserve or delete
17892
+ // TODO: @@ Preserve or delete
17879
17893
  if (this.tools.fs === undefined) {
17880
17894
  throw new EnvironmentMismatchError('Can not scrape boilerplates without filesystem tools');
17881
17895
  // <- TODO: [🧠] What is the best error type here`
17882
17896
  }
17883
- // TODO: @@@ Preserve, delete or modify
17897
+ // TODO: @@ Preserve, delete or modify
17884
17898
  if (((_a = this.tools.executables) === null || _a === void 0 ? void 0 : _a.pandocPath) === undefined) {
17885
17899
  throw new MissingToolsError('Pandoc is required for scraping .docx files');
17886
17900
  }
17887
- // TODO: @@@ Preserve, delete or modify
17901
+ // TODO: @@ Preserve, delete or modify
17888
17902
  if (source.filename === null) {
17889
17903
  // TODO: [🧠] Maybe save file as temporary
17890
- throw new KnowledgeScrapeError('When parsing .@@@ file, it must be real file in the file system');
17904
+ throw new KnowledgeScrapeError('When parsing .@@ file, it must be real file in the file system');
17891
17905
  }
17892
17906
  const extension = getFileExtension(source.filename);
17893
17907
  const cacheFilehandler = await getScraperIntermediateSource(source, {
@@ -17897,7 +17911,7 @@ class BoilerplateScraper {
17897
17911
  extension: 'md',
17898
17912
  isVerbose,
17899
17913
  });
17900
- // TODO: @@@ Preserve, delete or modify
17914
+ // TODO: @@ Preserve, delete or modify
17901
17915
  // Note: Running Pandoc ONLY if the file in the cache does not exist
17902
17916
  if (!(await isFileExisting(cacheFilehandler.filename, this.tools.fs))) {
17903
17917
  const command = `"${this.tools.executables.pandocPath}" -f ${extension} -t markdown "${source.filename}" -o "${cacheFilehandler.filename}"`;
@@ -17923,7 +17937,7 @@ class BoilerplateScraper {
17923
17937
  */
17924
17938
  async scrape(source) {
17925
17939
  const cacheFilehandler = await this.$convert(source);
17926
- // TODO: @@@ Preserve, delete or modify
17940
+ // TODO: @@ Preserve, delete or modify
17927
17941
  const markdownSource = {
17928
17942
  source: source.source,
17929
17943
  filename: cacheFilehandler.filename,
@@ -17954,7 +17968,7 @@ class BoilerplateScraper {
17954
17968
  * TODO: [👣] Converted documents can act as cached items - there is no need to run conversion each time
17955
17969
  * TODO: [🪂] Do it in parallel
17956
17970
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
17957
- * @@@ Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17971
+ * @@ Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17958
17972
  */
17959
17973
 
17960
17974
  /**
@@ -18288,7 +18302,8 @@ class LegacyDocumentScraper {
18288
18302
  */
18289
18303
 
18290
18304
  /**
18291
- * @@@
18305
+ * Creates a scraper for legacy document formats (.doc, .rtf, etc).
18306
+ * Uses LibreOffice for conversion to extract content from older document formats.
18292
18307
  *
18293
18308
  * @public exported from `@promptbook/legacy-documents`
18294
18309
  */
@@ -18315,7 +18330,7 @@ const _LegacyDocumentScraperRegistration = $scrapersRegister.register(createLega
18315
18330
  */
18316
18331
 
18317
18332
  /**
18318
- * @@@
18333
+ * Creates a scraper for document content.
18319
18334
  *
18320
18335
  * @public exported from `@promptbook/documents`
18321
18336
  */
@@ -18342,7 +18357,7 @@ const _DocumentScraperRegistration = $scrapersRegister.register(createDocumentSc
18342
18357
  */
18343
18358
 
18344
18359
  /**
18345
- * @@@
18360
+ * Creates a scraper for markdown content.
18346
18361
  *
18347
18362
  * @public exported from `@promptbook/markdown-utils`
18348
18363
  */
@@ -18448,8 +18463,8 @@ class MarkitdownScraper {
18448
18463
  extension: 'md',
18449
18464
  isVerbose,
18450
18465
  });
18451
- // TODO: @@@ Preserve, delete or modify
18452
- // Note: Running Pandoc ONLY if the file in the cache does not exist
18466
+ // TODO: Determine if Markitdown conversion should run only if the cache file doesn't exist, or always.
18467
+ // Note: Running Markitdown conversion ONLY if the file in the cache does not exist
18453
18468
  if (!(await isFileExisting(cacheFilehandler.filename, this.tools.fs))) {
18454
18469
  const src = source.filename || source.url || null;
18455
18470
  // console.log('!!', { src, source, cacheFilehandler });
@@ -18471,11 +18486,11 @@ class MarkitdownScraper {
18471
18486
  return cacheFilehandler;
18472
18487
  }
18473
18488
  /**
18474
- * Scrapes the docx file and returns the knowledge pieces or `null` if it can't scrape it
18489
+ * Scrapes the source document (PDF, DOCX, etc.) and returns the knowledge pieces or `null` if it can't scrape it.
18475
18490
  */
18476
18491
  async scrape(source) {
18477
18492
  const cacheFilehandler = await this.$convert(source);
18478
- // TODO: @@@ Preserve, delete or modify
18493
+ // TODO: Ensure this correctly creates the source object for the internal MarkdownScraper using the converted file.
18479
18494
  const markdownSource = {
18480
18495
  source: source.source,
18481
18496
  filename: cacheFilehandler.filename,
@@ -18619,7 +18634,8 @@ class PdfScraper {
18619
18634
  */
18620
18635
 
18621
18636
  /**
18622
- * @@@
18637
+ * Factory function to create an instance of PdfScraper.
18638
+ * It bundles the scraper class with its metadata.
18623
18639
  *
18624
18640
  * @public exported from `@promptbook/pdf`
18625
18641
  */
@@ -18795,7 +18811,8 @@ class WebsiteScraper {
18795
18811
  */
18796
18812
 
18797
18813
  /**
18798
- * @@@
18814
+ * Factory function to create an instance of WebsiteScraper.
18815
+ * It bundles the scraper class with its metadata.
18799
18816
  *
18800
18817
  * @public exported from `@promptbook/website-crawler`
18801
18818
  */