@promptbook/markdown-utils 0.81.0-9 → 0.81.0

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 (93) hide show
  1. package/README.md +25 -8
  2. package/esm/index.es.js +141 -59
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/books/index.d.ts +38 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +12 -4
  6. package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -2
  7. package/esm/typings/src/_packages/node.index.d.ts +0 -2
  8. package/esm/typings/src/_packages/templates.index.d.ts +2 -2
  9. package/esm/typings/src/_packages/types.index.d.ts +2 -0
  10. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  11. package/esm/typings/src/_packages/wizzard.index.d.ts +44 -0
  12. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  13. package/esm/typings/src/cli/cli-commands/run.d.ts +2 -2
  14. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +11 -0
  15. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
  16. package/esm/typings/src/commands/index.d.ts +1 -1
  17. package/esm/typings/src/config.d.ts +3 -3
  18. package/esm/typings/src/conversion/compilePipeline.d.ts +1 -4
  19. package/esm/typings/src/conversion/{precompilePipeline.d.ts → parsePipeline.d.ts} +3 -3
  20. package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -3
  21. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +7 -7
  22. package/esm/typings/src/errors/utils/getErrorReportUrl.d.ts +1 -1
  23. package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +9 -4
  24. package/esm/typings/src/formfactors/image-generator/ImageGeneratorFormfactorDefinition.d.ts +24 -0
  25. package/esm/typings/src/formfactors/index.d.ts +31 -9
  26. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
  27. package/esm/typings/src/high-level-abstractions/index.d.ts +3 -3
  28. package/esm/typings/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +3 -0
  29. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  30. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +1 -1
  31. package/esm/typings/src/llm-providers/_common/register/{$provideLlmToolsForCli.d.ts → $provideLlmToolsForWizzardOrCli.d.ts} +2 -2
  32. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
  33. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  34. package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
  35. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -2
  36. package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +1 -0
  37. package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +2 -0
  38. package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +1 -0
  39. package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +1 -0
  40. package/esm/typings/src/llm-providers/google/register-configuration.d.ts +1 -0
  41. package/esm/typings/src/llm-providers/google/register-constructor.d.ts +1 -0
  42. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +1 -1
  43. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -0
  44. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -0
  45. package/esm/typings/src/llm-providers/vercel/playground/playground.d.ts +1 -1
  46. package/esm/typings/src/other/templates/getBookTemplates.d.ts +22 -0
  47. package/esm/typings/src/personas/preparePersona.d.ts +4 -4
  48. package/esm/typings/src/pipeline/PipelineString.d.ts +0 -3
  49. package/esm/typings/src/pipeline/book-notation.d.ts +14 -0
  50. package/esm/typings/src/pipeline/isValidPipelineString.d.ts +13 -0
  51. package/esm/typings/src/pipeline/isValidPipelineString.test.d.ts +4 -0
  52. package/esm/typings/src/pipeline/validatePipelineString.d.ts +14 -0
  53. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +3 -1
  54. package/esm/typings/src/prepare/preparePipeline.d.ts +2 -0
  55. package/esm/typings/src/prepare/prepareTasks.d.ts +1 -1
  56. package/esm/typings/src/scrapers/_common/Converter.d.ts +1 -0
  57. package/esm/typings/src/scrapers/_common/Scraper.d.ts +1 -1
  58. package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +3 -0
  59. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +2 -0
  60. package/esm/typings/src/scrapers/_common/utils/scraperFetch.d.ts +3 -0
  61. package/esm/typings/src/scrapers/document/register-constructor.d.ts +1 -0
  62. package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -0
  63. package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +1 -0
  64. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -0
  65. package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +1 -0
  66. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -0
  67. package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +1 -0
  68. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -1
  69. package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +1 -0
  70. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +2 -1
  71. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -1
  72. package/esm/typings/src/scrapers/website/register-constructor.d.ts +1 -0
  73. package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -0
  74. package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +1 -1
  75. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +2 -1
  76. package/esm/typings/src/types/typeAliases.d.ts +8 -2
  77. package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +1 -1
  78. package/esm/typings/src/utils/markdown/{removeContentComments.d.ts → removeMarkdownComments.d.ts} +2 -2
  79. package/esm/typings/src/utils/organization/$sideEffect.d.ts +9 -0
  80. package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
  81. package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +2 -2
  82. package/esm/typings/src/utils/validators/filePath/isRootPath.d.ts +12 -0
  83. package/esm/typings/src/utils/validators/filePath/isRootPath.test.d.ts +4 -0
  84. package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +3 -0
  85. package/esm/typings/src/wizzard/$getCompiledBook.d.ts +16 -0
  86. package/esm/typings/src/wizzard/wizzard.d.ts +51 -7
  87. package/package.json +1 -1
  88. package/umd/index.umd.js +141 -59
  89. package/umd/index.umd.js.map +1 -1
  90. package/esm/typings/src/other/templates/getBookTemplate.d.ts +0 -21
  91. package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +0 -8
  92. /package/esm/typings/src/conversion/{precompilePipeline.test.d.ts → parsePipeline.test.d.ts} +0 -0
  93. /package/esm/typings/src/utils/markdown/{removeContentComments.test.d.ts → removeMarkdownComments.test.d.ts} +0 -0
@@ -1,19 +1,63 @@
1
1
  import { Promisable } from 'type-fest';
2
+ import type { ExecutionTools } from '../execution/ExecutionTools';
2
3
  import type { PipelineExecutorResult } from '../execution/PipelineExecutorResult';
4
+ import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
5
+ import type { PipelineString } from '../pipeline/PipelineString';
3
6
  import type { TaskProgress } from '../types/TaskProgress';
4
7
  import type { InputParameters } from '../types/typeAliases';
8
+ import type { string_filename } from '../types/typeAliases';
5
9
  import type { string_pipeline_url } from '../types/typeAliases';
6
10
  /**
7
- * @@@
11
+ * Wizzard for simple usage of the Promptbook
12
+ * Look at `wizzard` for more details
8
13
  *
9
- * @public exported from `@promptbook/node`
14
+ * Note: This works only in Node.js environment and looks for the configuration, environment, tools and cache in the Node.js environment
15
+ *
16
+ * @private just for single instance
10
17
  */
11
- export declare const wizzard: {
18
+ declare class Wizzard {
19
+ /**
20
+ * Run the book
21
+ *
22
+ * It can be loaded from:
23
+ * 1) As a file ./books/write-cv.book.md
24
+ * 2) As a URL https://promptbook.studio/hejny/write-cv.book.md found in ./books folder recursively
25
+ * 2) As a URL https://promptbook.studio/hejny/write-cv.book.md fetched from the internet
26
+ * 3) As a string
27
+ *
28
+ * Note: This works simmilar to the `ptbk run` command
29
+ */
30
+ execute(book: string_pipeline_url | string_filename | PipelineString, inputParameters: InputParameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<PipelineExecutorResult>;
31
+ private executionTools;
32
+ /**
33
+ * Provides the tools automatically for the Node.js environment
34
+ *
35
+ * @param pipelineSource
36
+ */
37
+ getExecutionTools(): Promise<Required<Pick<ExecutionTools, 'fs' | 'fetch'>>>;
12
38
  /**
13
- * @@@!!!!!!
39
+ * Load book from the source
40
+ *
41
+ * Pipelines can be loaded from:
42
+ * 1) As a file ./books/write-cv.book.md
43
+ * 2) As a URL https://promptbook.studio/hejny/write-cv.book.md found in ./books folder recursively
44
+ * 2) As a URL https://promptbook.studio/hejny/write-cv.book.md fetched from the internet
45
+ * 3) As a string
46
+ *
47
+ * @param pipelineSource
14
48
  */
15
- execute(book: string_pipeline_url, inputParameters: InputParameters, onProgress?: ((taskProgress: TaskProgress) => Promisable<void>) | undefined): Promise<PipelineExecutorResult>;
16
- };
49
+ getCompiledBook(pipelineSource: string_filename | string_pipeline_url | PipelineString): Promise<PipelineJson>;
50
+ }
51
+ /**
52
+ * Wizzard for simple usage of the Promptbook
53
+ *
54
+ * Note: This works only in Node.js environment and looks for the configuration, environment, tools and cache in the Node.js environment
55
+ *
56
+ * @singleton
57
+ * @public exported from `@promptbook/wizzard`
58
+ */
59
+ export declare const wizzard: Wizzard;
60
+ export {};
17
61
  /**
18
- * TODO: !!!!!! Add to readmes - one markdown here imported in all packages
62
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
19
63
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/markdown-utils",
3
- "version": "0.81.0-9",
3
+ "version": "0.81.0",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "--note-0": " <- [🐊]",
6
6
  "private": false,