@promptbook/cli 0.74.0-7 → 0.74.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 (37) hide show
  1. package/README.md +5 -17
  2. package/bin/promptbook-cli.js +8 -2
  3. package/esm/index.es.js +256 -113
  4. package/esm/index.es.js.map +1 -1
  5. package/esm/typings/src/_packages/core.index.d.ts +5 -1
  6. package/esm/typings/src/_packages/utils.index.d.ts +4 -0
  7. package/esm/typings/src/cli/cli-commands/run.d.ts +1 -1
  8. package/esm/typings/src/cli/main.d.ts +4 -1
  9. package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
  10. package/esm/typings/src/cli/test/ptbk.d.ts +1 -1
  11. package/esm/typings/src/collection/collectionToJson.test.d.ts +1 -1
  12. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
  13. package/esm/typings/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -1
  14. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -2
  15. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
  16. package/esm/typings/src/config.d.ts +6 -0
  17. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +3 -3
  18. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -2
  19. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +2 -2
  20. package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +1 -1
  21. package/esm/typings/src/conversion/validation/_importPipeline.d.ts +7 -7
  22. package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
  23. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +1 -1
  24. package/esm/typings/src/storage/blackhole/BlackholeStorage.d.ts +33 -0
  25. package/esm/typings/src/storage/memory/MemoryStorage.d.ts +1 -1
  26. package/esm/typings/src/storage/{memory/utils → utils}/PrefixStorage.d.ts +1 -1
  27. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +6 -4
  28. package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +1 -1
  29. package/esm/typings/src/types/Prompt.d.ts +1 -1
  30. package/esm/typings/src/types/typeAliases.d.ts +2 -2
  31. package/esm/typings/src/utils/expectation-counters/config.d.ts +12 -0
  32. package/esm/typings/src/utils/expectation-counters/countLines.d.ts +2 -0
  33. package/esm/typings/src/utils/expectation-counters/countPages.d.ts +2 -0
  34. package/package.json +3 -3
  35. package/umd/index.umd.js +256 -113
  36. package/umd/index.umd.js.map +1 -1
  37. /package/esm/typings/src/storage/{memory → local-storage}/utils/makePromptbookStorageFromWebStorage.d.ts +0 -0
package/README.md CHANGED
@@ -18,16 +18,13 @@ Build responsible, controlled and transparent applications on top of LLM models!
18
18
 
19
19
  ## ✨ New Features
20
20
 
21
- - 💙 Working on [the **Book** language v1](https://github.com/webgptorg/book)
21
+ - 💙 Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
22
+ - 🖤 Run books from CLI - `npx ptbk run path/to/your/book`
22
23
  - 📚 Support of `.docx`, `.doc` and `.pdf` documents
23
24
  - ✨ **Support of [OpenAI o1 model](https://openai.com/o1/)**
24
25
 
25
26
 
26
27
 
27
- <blockquote style="color: #ff8811">
28
- <b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
29
- </blockquote>
30
-
31
28
  ## 📦 Package `@promptbook/cli`
32
29
 
33
30
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
@@ -70,7 +67,7 @@ import { OpenAiExecutionTools } from '@promptbook/openai';
70
67
 
71
68
  // ▶ Get single Pipeline
72
69
  const promptbook = await getPipelineCollection().getPipelineByUrl(
73
- `https://promptbook.studio/my-collection/write-article.ptbk.md`,
70
+ `https://promptbook.studio/my-collection/write-article.book.md`,
74
71
  );
75
72
 
76
73
  // ▶ Create executor - the function that will execute the Pipeline
@@ -97,7 +94,7 @@ There is also a javascript and json format available.
97
94
  ## Prettify
98
95
 
99
96
  ```bash
100
- npx ptbk prettify promptbook/**/*.ptbk.md
97
+ npx ptbk prettify promptbook/**/*.book.md
101
98
  ```
102
99
 
103
100
  This will prettify all promptbooks in `promptbook` directory and adds Mermaid graphs to them.
@@ -205,7 +202,7 @@ Following is the documentation and blueprint of the Book language.
205
202
 
206
203
  File is designed to be easy to read and write. It is strict subset of markdown. It is designed to be understandable by both humans and machines and without specific knowledge of the language.
207
204
 
208
- It has file with `.ptbk.md` or `.book` extension with `UTF-8` non BOM encoding.
205
+ It has file with `.book.md` or `.book` extension with `UTF-8` non BOM encoding.
209
206
 
210
207
  As it is source code, it can leverage all the features of version control systems like git and does not suffer from the problems of binary formats, proprietary formats, or no-code solutions.
211
208
 
@@ -298,11 +295,6 @@ Or you can install them separately:
298
295
 
299
296
  ## 📚 Dictionary
300
297
 
301
-
302
-
303
-
304
-
305
-
306
298
  ### 📚 Dictionary
307
299
 
308
300
  The following glossary is used to clarify certain concepts:
@@ -318,8 +310,6 @@ The following glossary is used to clarify certain concepts:
318
310
  - **Retrieval-augmented generation** is a machine learning paradigm where a model generates text by retrieving relevant information from a large database of text. This approach combines the benefits of generative models and retrieval models.
319
311
  - **Longtail** refers to non-common or rare events, items, or entities that are not well-represented in the training data of machine learning models. Longtail items are often challenging for models to predict accurately.
320
312
 
321
-
322
-
323
313
  _Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
324
314
 
325
315
  #### Promptbook core
@@ -380,8 +370,6 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
380
370
  - [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
381
371
  - [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
382
372
 
383
-
384
-
385
373
  ### Terms specific to Promptbook TypeScript implementation
386
374
 
387
375
  - Anonymous mode
@@ -1,8 +1,14 @@
1
1
  #!/usr/bin/env node
2
+ // <- TODO: [🎺] Ensure correct version of Node.js is used
2
3
 
3
- const { _CLI /* <- Note: [🥠] */ } = require('../umd/index.umd.js');
4
+ /**
5
+ * Note: [🔺] Purpose of this file is to run CLI in production environment
6
+ */
7
+
8
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
9
+ const { _CLI } = require('../umd/index.umd.js');
4
10
 
5
- _CLI._initialize();
11
+ _CLI._initialize_promptbookCli();
6
12
 
7
13
  /**
8
14
  * TODO: [🕌] When more functionalities, rename