@promptbook/node 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 +88 -73
  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 +2 -2
  71. package/umd/index.umd.js +88 -73
  72. package/umd/index.umd.js.map +1 -1
@@ -6,10 +6,10 @@
6
6
  */
7
7
  export type string_snake_case = string;
8
8
  /**
9
- * @@@
9
+ * Normalizes a text string to snake_case format.
10
10
  *
11
- * @param text @@@
12
- * @returns @@@
11
+ * @param text The text string to be converted to snake_case format.
12
+ * @returns The normalized text in snake_case format.
13
13
  * @example 'hello_world'
14
14
  * @example 'i_love_promptbook'
15
15
  * @public exported from `@promptbook/utils`
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @@@
2
+ * Removes diacritic marks (accents) from characters in a string.
3
3
  *
4
- * @param input @@@
5
- * @returns @@@
4
+ * @param input The string containing diacritics to be normalized.
5
+ * @returns The string with diacritics removed or normalized.
6
6
  * @public exported from `@promptbook/utils`
7
7
  */
8
8
  export declare function removeDiacritics(input: string): string;
@@ -1,6 +1,6 @@
1
1
  import type { Keywords } from './IKeywords';
2
2
  /**
3
- * @@@
3
+ * Searches set of keywords for a specific keyword
4
4
  *
5
5
  * @param haystack
6
6
  * @param needle
@@ -8,3 +8,6 @@ import type { Keywords } from './IKeywords';
8
8
  * @public exported from `@promptbook/utils`
9
9
  */
10
10
  export declare function searchKeywords(haystack: Keywords, needle: Keywords): boolean;
11
+ /**
12
+ * TODO: Rename to `isKeywordInKeywords`
13
+ */
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @@@
2
+ * Converts a title string into a normalized name.
3
3
  *
4
- * @param value @@@
5
- * @returns @@@
6
- * @example @@@
4
+ * @param value The title string to be converted to a name.
5
+ * @returns A normalized name derived from the input title.
6
+ * @example 'Hello World!' -> 'hello-world'
7
7
  * @public exported from `@promptbook/utils`
8
8
  */
9
9
  export declare function titleToName(value: string): string;
@@ -2,8 +2,8 @@
2
2
  * Organizational helper to better mark the place where to really use empty object `{}`
3
3
  *
4
4
  * Note: There are 2 similar types>
5
- * - `empty_object` @@@
6
- * - `just_empty_object` @@@
5
+ * - `empty_object` Type used for empty data objects allowing for potential future extensions
6
+ * - `just_empty_object` Type used when an object must remain permanently empty
7
7
  *
8
8
  * @private within the repository
9
9
  */
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Organizational helper to better @@@@
2
+ * Organizational helper to better distinguish different empty object use cases.
3
3
  *
4
- * Note: There are 2 similar types>
5
- * - `empty_object` @@@
6
- * - `just_empty_object` @@@
4
+ * Note: There are 2 similar types:
5
+ * - `empty_object` Type used for empty data objects with potential extensions
6
+ * - `just_empty_object` Type used specifically for objects that must remain empty
7
7
  *
8
8
  * Note: In most cases, you should use `empty_object`
9
9
  *
@@ -14,7 +14,8 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
14
14
  */
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
- * @@@
17
+ * Represents the version string of the Promptbook engine.
18
+ * It follows semantic versioning (e.g., `0.92.0-24`).
18
19
  *
19
20
  * @generated
20
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/node",
3
- "version": "0.92.0-24",
3
+ "version": "0.92.0-25",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -51,7 +51,7 @@
51
51
  "module": "./esm/index.es.js",
52
52
  "typings": "./esm/typings/src/_packages/node.index.d.ts",
53
53
  "peerDependencies": {
54
- "@promptbook/core": "0.92.0-24"
54
+ "@promptbook/core": "0.92.0-25"
55
55
  },
56
56
  "dependencies": {
57
57
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -46,7 +46,7 @@
46
46
  * @generated
47
47
  * @see https://github.com/webgptorg/promptbook
48
48
  */
49
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-24';
49
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-25';
50
50
  /**
51
51
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
52
52
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -682,13 +682,13 @@
682
682
  */
683
683
  const REPLACING_NONCE = 'ptbkauk42kV2dzao34faw7FudQUHYPtW';
684
684
  /**
685
- * @@@
685
+ * Placeholder value indicating a parameter is missing its value.
686
686
  *
687
687
  * @private within the repository
688
688
  */
689
689
  const RESERVED_PARAMETER_MISSING_VALUE = 'MISSING-' + REPLACING_NONCE;
690
690
  /**
691
- * @@@
691
+ * Placeholder value indicating a parameter is restricted and cannot be used directly.
692
692
  *
693
693
  * @private within the repository
694
694
  */
@@ -1691,8 +1691,8 @@
1691
1691
  * @public exported from `@promptbook/core`
1692
1692
  */
1693
1693
  function isPipelinePrepared(pipeline) {
1694
- // Note: Ignoring `pipeline.preparations` @@@
1695
- // Note: Ignoring `pipeline.knowledgePieces` @@@
1694
+ // Note: Ignoring `pipeline.preparations`
1695
+ // Note: Ignoring `pipeline.knowledgePieces`
1696
1696
  if (pipeline.title === undefined || pipeline.title === '' || pipeline.title === DEFAULT_BOOK_TITLE) {
1697
1697
  // TODO: !!! Comment this out
1698
1698
  console.log('Pipeline is not prepared because title is undefined or empty', pipeline);
@@ -2876,7 +2876,7 @@
2876
2876
  else if (!availableParametersNames.has(parameterName) && expectedParameterNames.has(parameterName)) ;
2877
2877
  }
2878
2878
  if (expectedParameterNames.size === 0) {
2879
- // Note: [👨‍👨‍👧] Now we can freeze `mappedParameters` to prevent @@@
2879
+ // Note: [👨‍👨‍👧] Now we can freeze `mappedParameters` to prevent accidental modifications after mapping
2880
2880
  Object.freeze(mappedParameters);
2881
2881
  return mappedParameters;
2882
2882
  }
@@ -2907,7 +2907,7 @@
2907
2907
  for (let i = 0; i < expectedParameterNames.size; i++) {
2908
2908
  mappedParameters[expectedParameterNamesArray[i]] = availableParameters[availableParametersNamesArray[i]];
2909
2909
  }
2910
- // Note: [👨‍👨‍👧] Now we can freeze `mappedParameters` to prevent @@@
2910
+ // Note: [👨‍👨‍👧] Now we can freeze `mappedParameters` to prevent accidental modifications after mapping
2911
2911
  Object.freeze(mappedParameters);
2912
2912
  return mappedParameters;
2913
2913
  }
@@ -3658,10 +3658,10 @@
3658
3658
  */
3659
3659
 
3660
3660
  /**
3661
- * @@@
3661
+ * Removes diacritic marks (accents) from characters in a string.
3662
3662
  *
3663
- * @param input @@@
3664
- * @returns @@@
3663
+ * @param input The string containing diacritics to be normalized.
3664
+ * @returns The string with diacritics removed or normalized.
3665
3665
  * @public exported from `@promptbook/utils`
3666
3666
  */
3667
3667
  function removeDiacritics(input) {
@@ -4149,11 +4149,10 @@
4149
4149
  const highLevelError = new PipelineExecutionError(spaceTrim__default["default"]((block) => `
4150
4150
  ${error.message}
4151
4151
 
4152
- This is error in FOREACH command when mapping data
4152
+ This is error in FOREACH command when mapping ${formatDefinition.formatName} ${subvalueParser.subvalueName} data (${index + 1}/${length})
4153
4153
  You have probbably passed wrong data to pipeline or wrong data was generated which are processed by FOREACH command
4154
4154
 
4155
4155
  ${block(pipelineIdentification)}
4156
- Subparameter index: ${index}
4157
4156
  `));
4158
4157
  if (length > BIG_DATASET_TRESHOLD) {
4159
4158
  console.error(highLevelError);
@@ -4181,12 +4180,11 @@
4181
4180
  catch (error) {
4182
4181
  if (length > BIG_DATASET_TRESHOLD) {
4183
4182
  console.error(spaceTrim__default["default"]((block) => `
4184
- Error in FOREACH command:
4183
+ ${error.message}
4185
4184
 
4186
- ${block(pipelineIdentification)}
4185
+ This is error in FOREACH command when processing ${formatDefinition.formatName} ${subvalueParser.subvalueName} data (${index + 1}/${length})
4187
4186
 
4188
4187
  ${block(pipelineIdentification)}
4189
- Subparameter index: ${index}
4190
4188
  `));
4191
4189
  return FAILED_VALUE_PLACEHOLDER;
4192
4190
  }
@@ -5039,10 +5037,10 @@
5039
5037
  }
5040
5038
 
5041
5039
  /**
5042
- * @@@
5040
+ * Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
5043
5041
  *
5044
- * @param text @@@
5045
- * @returns @@@
5042
+ * @param text The text string to be converted to SCREAMING_CASE format.
5043
+ * @returns The normalized text in SCREAMING_CASE format.
5046
5044
  * @example 'HELLO_WORLD'
5047
5045
  * @example 'I_LOVE_PROMPTBOOK'
5048
5046
  * @public exported from `@promptbook/utils`
@@ -5094,10 +5092,10 @@
5094
5092
  */
5095
5093
 
5096
5094
  /**
5097
- * @@@
5095
+ * Normalizes a text string to snake_case format.
5098
5096
  *
5099
- * @param text @@@
5100
- * @returns @@@
5097
+ * @param text The text string to be converted to snake_case format.
5098
+ * @returns The normalized text in snake_case format.
5101
5099
  * @example 'hello_world'
5102
5100
  * @example 'i_love_promptbook'
5103
5101
  * @public exported from `@promptbook/utils`
@@ -5167,10 +5165,11 @@
5167
5165
  */
5168
5166
 
5169
5167
  /**
5170
- * @@@
5168
+ * Registry for all available scrapers in the system.
5169
+ * Central point for registering and accessing different types of content scrapers.
5171
5170
  *
5172
5171
  * Note: `$` is used to indicate that this interacts with the global scope
5173
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
5172
+ * @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
5174
5173
  * @public exported from `@promptbook/core`
5175
5174
  */
5176
5175
  const $scrapersRegister = new $Register('scraper_constructors');
@@ -5266,10 +5265,10 @@
5266
5265
  */
5267
5266
 
5268
5267
  /**
5269
- * @@@
5268
+ * Converts a given text to kebab-case format.
5270
5269
  *
5271
- * @param text @@@
5272
- * @returns @@@
5270
+ * @param text The text to be converted.
5271
+ * @returns The kebab-case formatted string.
5273
5272
  * @example 'hello-world'
5274
5273
  * @example 'i-love-promptbook'
5275
5274
  * @public exported from `@promptbook/utils`
@@ -5338,7 +5337,8 @@
5338
5337
  */
5339
5338
 
5340
5339
  /**
5341
- * @@@
5340
+ * Converts a name to a properly formatted subfolder path for cache storage.
5341
+ * Handles normalization and path formatting to create consistent cache directory structures.
5342
5342
  *
5343
5343
  * @private for `FileCacheStorage`
5344
5344
  */
@@ -5418,11 +5418,11 @@
5418
5418
  }
5419
5419
 
5420
5420
  /**
5421
- * @@@
5421
+ * Converts a title string into a normalized name.
5422
5422
  *
5423
- * @param value @@@
5424
- * @returns @@@
5425
- * @example @@@
5423
+ * @param value The title string to be converted to a name.
5424
+ * @returns A normalized name derived from the input title.
5425
+ * @example 'Hello World!' -> 'hello-world'
5426
5426
  * @public exported from `@promptbook/utils`
5427
5427
  */
5428
5428
  function titleToName(value) {
@@ -5473,7 +5473,9 @@
5473
5473
  */
5474
5474
 
5475
5475
  /**
5476
- * @@@
5476
+ * Factory function that creates a handler for processing knowledge sources.
5477
+ * Provides standardized processing of different types of knowledge sources
5478
+ * across various scraper implementations.
5477
5479
  *
5478
5480
  * @public exported from `@promptbook/core`
5479
5481
  */
@@ -5714,9 +5716,12 @@
5714
5716
  */
5715
5717
 
5716
5718
  /**
5717
- * @@@
5719
+ * Prepares tasks by adding knowledge to the prompt and ensuring all necessary parameters are included.
5718
5720
  *
5719
- * @public exported from `@promptbook/core`
5721
+ * @param tasks Sequence of tasks that are chained together to form a pipeline
5722
+ * @returns A promise that resolves to the prepared tasks.
5723
+ *
5724
+ * @private internal utility of `preparePipeline`
5720
5725
  */
5721
5726
  async function prepareTasks(pipeline, tools, options) {
5722
5727
  const { maxParallelCount = DEFAULT_MAX_PARALLEL_COUNT } = options;
@@ -6622,11 +6627,11 @@
6622
6627
  };
6623
6628
 
6624
6629
  /**
6625
- * @@@
6630
+ * Normalizes a given text to camelCase format.
6626
6631
  *
6627
- * @param text @@@
6628
- * @param _isFirstLetterCapital @@@
6629
- * @returns @@@
6632
+ * @param text The text to be normalized.
6633
+ * @param _isFirstLetterCapital Whether the first letter should be capitalized.
6634
+ * @returns The camelCase formatted string.
6630
6635
  * @example 'helloWorld'
6631
6636
  * @example 'iLovePromptbook'
6632
6637
  * @public exported from `@promptbook/utils`
@@ -7114,7 +7119,7 @@
7114
7119
  };
7115
7120
 
7116
7121
  /**
7117
- * @@@
7122
+ * Pipeline interface which is equivalent to `any`
7118
7123
  *
7119
7124
  * @see https://github.com/webgptorg/promptbook/discussions/171
7120
7125
  *
@@ -7444,8 +7449,7 @@
7444
7449
  };
7445
7450
 
7446
7451
  /**
7447
- * @@@
7448
- *
7452
+ * @see {@link ModelVariant}
7449
7453
  * @public exported from `@promptbook/core`
7450
7454
  */
7451
7455
  const MODEL_VARIANTS = ['COMPLETION', 'CHAT', 'EMBEDDING' /* <- TODO [🏳] */ /* <- [🤖] */];
@@ -8418,7 +8422,7 @@
8418
8422
  }
8419
8423
 
8420
8424
  /**
8421
- * @@@
8425
+ * Extracts the interface (input and output parameters) from a pipeline.
8422
8426
  *
8423
8427
  * @deprecated https://github.com/webgptorg/promptbook/pull/186
8424
8428
  * @see https://github.com/webgptorg/promptbook/discussions/171
@@ -8451,7 +8455,7 @@
8451
8455
  }
8452
8456
 
8453
8457
  /**
8454
- * @@@
8458
+ * Checks if two pipeline interfaces are structurally identical.
8455
8459
  *
8456
8460
  * @deprecated https://github.com/webgptorg/promptbook/pull/186
8457
8461
  * @see https://github.com/webgptorg/promptbook/discussions/171
@@ -8483,10 +8487,11 @@
8483
8487
  }
8484
8488
 
8485
8489
  /**
8486
- * @@@
8490
+ * Checks if a given pipeline satisfies the requirements of a specified pipeline interface.
8487
8491
  *
8488
8492
  * @deprecated https://github.com/webgptorg/promptbook/pull/186
8489
8493
  * @see https://github.com/webgptorg/promptbook/discussions/171
8494
+ * @returns `true` if the pipeline implements the interface, `false` otherwise.
8490
8495
  *
8491
8496
  * @public exported from `@promptbook/core`
8492
8497
  */
@@ -8672,7 +8677,8 @@
8672
8677
  }
8673
8678
 
8674
8679
  /**
8675
- * @@@
8680
+ * Utility to determine if a pipeline string is in flat format.
8681
+ * A flat pipeline is a simple text without proper structure (headers, blocks, etc).
8676
8682
  *
8677
8683
  * @public exported from `@promptbook/editable`
8678
8684
  */
@@ -8693,7 +8699,10 @@
8693
8699
  }
8694
8700
 
8695
8701
  /**
8696
- * @@@
8702
+ * Converts a pipeline structure to its string representation.
8703
+ *
8704
+ * Transforms a flat, simple pipeline into a properly formatted pipeline string
8705
+ * with sections for title, prompt, and return statement.
8697
8706
  *
8698
8707
  * @public exported from `@promptbook/editable`
8699
8708
  */
@@ -8750,7 +8759,7 @@
8750
8759
  * Note: It can not work with html syntax and comments
8751
8760
  *
8752
8761
  * @param markdown any valid markdown
8753
- * @returns @@@
8762
+ * @returns An array of strings, each representing an individual list item found in the markdown
8754
8763
  * @public exported from `@promptbook/markdown-utils`
8755
8764
  */
8756
8765
  function extractAllListItemsFromMarkdown(markdown) {
@@ -9605,7 +9614,8 @@
9605
9614
  */
9606
9615
 
9607
9616
  /**
9608
- * @@@
9617
+ * Provides filesystem access (for example for Node.js-based scrapers)
9618
+ * Creates a standardized filesystem interface that scrapers can use for file operations.
9609
9619
  *
9610
9620
  * @public exported from `@promptbook/node`
9611
9621
  */
@@ -9810,10 +9820,10 @@
9810
9820
  */
9811
9821
 
9812
9822
  /**
9813
- * @@@
9823
+ * Register for LLM tools metadata.
9814
9824
  *
9815
9825
  * Note: `$` is used to indicate that this interacts with the global scope
9816
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
9826
+ * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
9817
9827
  * @public exported from `@promptbook/core`
9818
9828
  */
9819
9829
  const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
@@ -9841,10 +9851,10 @@
9841
9851
  */
9842
9852
 
9843
9853
  /**
9844
- * @@@
9854
+ * Register for LLM tools.
9845
9855
  *
9846
9856
  * Note: `$` is used to indicate that this interacts with the global scope
9847
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
9857
+ * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
9848
9858
  * @public exported from `@promptbook/core`
9849
9859
  */
9850
9860
  const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
@@ -10037,9 +10047,8 @@
10037
10047
  */
10038
10048
 
10039
10049
  /**
10040
- * @@@
10050
+ * Provides LLM tools configuration by reading environment variables.
10041
10051
  *
10042
- * @@@ .env
10043
10052
  * Note: `$` is used to indicate that this function is not a pure function - it uses filesystem to access `.env` file
10044
10053
  *
10045
10054
  * It looks for environment variables:
@@ -10047,7 +10056,8 @@
10047
10056
  * - `process.env.ANTHROPIC_CLAUDE_API_KEY`
10048
10057
  * - ...
10049
10058
  *
10050
- * @returns @@@
10059
+ * @see Environment variables documentation or .env file for required variables.
10060
+ * @returns A promise that resolves to the LLM tools configuration, or null if configuration is incomplete or missing.
10051
10061
  * @public exported from `@promptbook/node`
10052
10062
  */
10053
10063
  async function $provideLlmToolsConfigurationFromEnv() {
@@ -10168,11 +10178,9 @@
10168
10178
  */
10169
10179
 
10170
10180
  /**
10171
- * @@@
10172
- *
10173
- * 1) @@@
10174
- * 2) @@@
10175
- *
10181
+ * Provides a collection of scrapers optimized for Node.js environment.
10182
+ * 1) `provideScrapersForNode` use as default
10183
+ * 2) `provideScrapersForBrowser` use in limited browser environment *
10176
10184
  * @public exported from `@promptbook/node`
10177
10185
  */
10178
10186
  async function $provideScrapersForNode(tools, options) {
@@ -10279,11 +10287,11 @@
10279
10287
  }
10280
10288
 
10281
10289
  /**
10282
- * @@@
10290
+ * Converts a name string into a URI-compatible format.
10283
10291
  *
10284
- * @param name @@@
10285
- * @returns @@@
10286
- * @example @@@
10292
+ * @param name The string to be converted to a URI-compatible format.
10293
+ * @returns A URI-compatible string derived from the input name.
10294
+ * @example 'Hello World' -> 'hello-world'
10287
10295
  * @public exported from `@promptbook/utils`
10288
10296
  */
10289
10297
  function nameToUriPart(name) {
@@ -10297,11 +10305,11 @@
10297
10305
  }
10298
10306
 
10299
10307
  /**
10300
- * @@@
10308
+ * Converts a given name into URI-compatible parts.
10301
10309
  *
10302
- * @param name @@@
10303
- * @returns @@@
10304
- * @example @@@
10310
+ * @param name The name to be converted into URI parts.
10311
+ * @returns An array of URI-compatible parts derived from the name.
10312
+ * @example 'Example Name' -> ['example', 'name']
10305
10313
  * @public exported from `@promptbook/utils`
10306
10314
  */
10307
10315
  function nameToUriParts(name) {
@@ -11108,7 +11116,10 @@
11108
11116
  */
11109
11117
 
11110
11118
  /**
11111
- * @@@
11119
+ * A storage implementation that caches data in files organized in a directory structure.
11120
+ * Provides methods for retrieving, storing, and managing cached data on the filesystem.
11121
+ *
11122
+ * This class implements the PromptbookStorage interface for filesystem-based caching.
11112
11123
  *
11113
11124
  * @public exported from `@promptbook/node`
11114
11125
  */
@@ -11121,7 +11132,8 @@
11121
11132
  }
11122
11133
  }
11123
11134
  /**
11124
- * @@@
11135
+ * Converts a storage key to a filesystem path where the data should be stored.
11136
+ * Creates a consistent, deterministic file path based on the key string.
11125
11137
  */
11126
11138
  getFilenameForKey(key) {
11127
11139
  // TODO: [👬] DRY
@@ -11133,7 +11145,8 @@
11133
11145
  ...nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */), `${name.substring(0, MAX_FILENAME_LENGTH)}.json`);
11134
11146
  }
11135
11147
  /**
11136
- * @@@ 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.
11148
+ * Returns the current value associated with the given key, or null if the given key does not exist.
11149
+ * Retrieves the cached data from the file system storage.
11137
11150
  */
11138
11151
  async getItem(key) {
11139
11152
  const filename = this.getFilenameForKey(key);
@@ -11146,7 +11159,8 @@
11146
11159
  return value;
11147
11160
  }
11148
11161
  /**
11149
- * @@@ Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
11162
+ * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
11163
+ * Persists data to the file system, creating necessary directory structure if it doesn't exist.
11150
11164
  */
11151
11165
  async setItem(key, value) {
11152
11166
  const filename = this.getFilenameForKey(key);
@@ -11158,7 +11172,8 @@
11158
11172
  await promises.writeFile(filename, fileContent, 'utf-8');
11159
11173
  }
11160
11174
  /**
11161
- * @@@ 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.
11175
+ * Removes the key/value pair with the given key from the storage, if a key/value pair with the given key exists.
11176
+ * Deletes the corresponding file from the filesystem.
11162
11177
  */
11163
11178
  async removeItem(key) {
11164
11179
  const filename = this.getFilenameForKey(key);