@promptbook/types 0.74.0-0 → 0.74.0-12

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 (52) hide show
  1. package/README.md +135 -30
  2. package/esm/typings/src/_packages/anthropic-claude.index.d.ts +2 -2
  3. package/esm/typings/src/_packages/azure-openai.index.d.ts +2 -2
  4. package/esm/typings/src/_packages/browser.index.d.ts +2 -2
  5. package/esm/typings/src/_packages/cli.index.d.ts +2 -2
  6. package/esm/typings/src/_packages/core.index.d.ts +7 -3
  7. package/esm/typings/src/_packages/documents.index.d.ts +2 -2
  8. package/esm/typings/src/_packages/execute-javascript.index.d.ts +2 -2
  9. package/esm/typings/src/_packages/fake-llm.index.d.ts +2 -2
  10. package/esm/typings/src/_packages/langtail.index.d.ts +2 -2
  11. package/esm/typings/src/_packages/legacy-documents.index.d.ts +2 -2
  12. package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -2
  13. package/esm/typings/src/_packages/node.index.d.ts +2 -2
  14. package/esm/typings/src/_packages/openai.index.d.ts +2 -2
  15. package/esm/typings/src/_packages/pdf.index.d.ts +2 -2
  16. package/esm/typings/src/_packages/remote-client.index.d.ts +2 -2
  17. package/esm/typings/src/_packages/remote-server.index.d.ts +2 -2
  18. package/esm/typings/src/_packages/utils.index.d.ts +2 -2
  19. package/esm/typings/src/_packages/website-crawler.index.d.ts +2 -2
  20. package/esm/typings/src/cli/cli-commands/make.d.ts +0 -1
  21. package/esm/typings/src/cli/cli-commands/run.d.ts +14 -0
  22. package/esm/typings/src/cli/promptbookCli.d.ts +1 -0
  23. package/esm/typings/src/cli/test/ptbk.d.ts +5 -2
  24. package/esm/typings/src/collection/collectionToJson.test.d.ts +1 -1
  25. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
  26. package/esm/typings/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +11 -0
  27. package/esm/typings/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +9 -0
  28. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -2
  29. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
  30. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
  31. package/esm/typings/src/commands/index.d.ts +1 -1
  32. package/esm/typings/src/config.d.ts +6 -0
  33. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +3 -3
  34. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -2
  35. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +2 -2
  36. package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +1 -1
  37. package/esm/typings/src/conversion/validation/_importPipeline.d.ts +7 -7
  38. package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
  39. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +1 -1
  40. package/esm/typings/src/storage/blackhole/BlackholeStorage.d.ts +33 -0
  41. package/esm/typings/src/storage/memory/MemoryStorage.d.ts +1 -1
  42. package/esm/typings/src/storage/{memory/utils → utils}/PrefixStorage.d.ts +1 -1
  43. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +6 -4
  44. package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +1 -1
  45. package/esm/typings/src/types/Prompt.d.ts +1 -1
  46. package/esm/typings/src/types/typeAliases.d.ts +2 -2
  47. package/esm/typings/src/version.d.ts +13 -2
  48. package/package.json +2 -2
  49. package/esm/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +0 -11
  50. package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +0 -9
  51. /package/esm/typings/src/commands/{PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts → BOOK_VERSION/bookVersionCommand.test.d.ts} +0 -0
  52. /package/esm/typings/src/storage/{memory → local-storage}/utils/makePromptbookStorageFromWebStorage.d.ts +0 -0
package/README.md CHANGED
@@ -77,8 +77,6 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
77
77
 
78
78
  ## 🤍 The Promptbook Whitepaper
79
79
 
80
-
81
-
82
80
  If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 3, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
83
81
 
84
82
  But often you will struggle with the **limitations of LLMs**, such as **hallucinations, off-topic responses, poor quality output, language and prompt drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd resp0nses**. When this happens, you generally have three options:
@@ -99,63 +97,65 @@ In all of these situations, but especially in 3., the **✨ Promptbook can make
99
97
 
100
98
 
101
99
 
102
- ## 💜 The Promptbook Project
103
100
 
104
101
 
105
102
 
103
+ ## 💜 The Promptbook Project
104
+
105
+ Promptbook project is ecosystem of multiple projects and tools, following is a list of most important pieces of the project:
106
+
106
107
  <table>
107
- <tbody>
108
+ <thead>
108
109
  <tr>
109
- <td>Promptbook whitepaper</td>
110
- <td>Basic motivations and problems which we are trying to solve</td>
111
- <td rowspan=3>https://github.com/webgptorg/book</td>
110
+ <th>Project</th>
111
+ <th>Description</th>
112
+ <th>Link</th>
112
113
  </tr>
114
+ </thead>
115
+ <tbody>
113
116
  <tr>
114
- <td>Promptbook <i>(system)</i></td>
115
- <td>Promptbook ...</td>
117
+ <td>Core</td>
118
+ <td>Promptbook core is a description and documentation of basic innerworkings how should be Promptbook implemented and defines which fetures must be descriable by book language</td>
119
+ <td rowspan=2>https://ptbk.io<br/>https://github.com/webgptorg/book</td>
116
120
  </tr>
117
121
  <tr>
118
122
  <td>Book language</td>
119
123
  <td>
120
- Book is a markdown-like language to define projects, pipelines, knowledge,... in the Promptbook system. It is designed to be understandable by non-programmers and non-technical people
124
+ Book is a markdown-like language to define core entities like projects, pipelines, knowledge,.... It is designed to be understandable by non-programmers and non-technical people
121
125
  </td>
122
126
  </tr>
123
127
  <tr>
124
128
  <td>Promptbook typescript project</td>
125
129
  <td>Implementation of Promptbook in TypeScript published into multiple packages to NPM</td>
126
- <td>https://github.com/webgptorg/promptbook</td>
130
+ <td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
127
131
  </tr>
128
132
  <tr>
129
133
  <td>Promptbook studio</td>
130
- <td>Promptbook studio</td>
131
- <td rowspan=2>https://github.com/hejny/promptbook-studio</td>
134
+ <td>No-code studio to write book without need to write even the markdown</td>
135
+ <td rowspan=2>https://promptbook.studio<br/>https://github.com/hejny/promptbook-studio</td>
132
136
  </tr>
133
137
  <tr>
134
138
  <td>Promptbook miniapps</td>
135
- <td>Promptbook miniapps</td>
139
+ <td>Builder of LLM miniapps from book notation</td>
136
140
  </tr>
137
141
  </tbody>
138
142
  </table>
139
143
 
140
- ## 💙 Book language _(for prompt-engineer)_
141
144
 
142
- Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) are written in markdown-like language called [Book](https://github.com/webgptorg/book). It is designed to be understandable by non-programmers and non-technical people.
143
145
 
146
+ ## 💙 Book language _(for prompt-engineer)_
144
147
 
145
148
 
146
- ```markdown
147
- # 🌟 My first Book
148
149
 
149
- - INPUT PARAMETER {subject}
150
- - OUTPUT PARAMETER {article}
151
150
 
152
- ## Sample subject
151
+ ## 💙 The blueprint of book language
153
152
 
154
- > Promptbook
153
+ Following is the documentation and blueprint of the Book language.
155
154
 
156
- -> {subject}
155
+ ### Example
157
156
 
158
- ## Write an article
157
+ ```markdown
158
+ # 🌟 My first Book
159
159
 
160
160
  - PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
161
161
  - KNOWLEDGE https://ptbk.io
@@ -164,11 +164,65 @@ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) a
164
164
  - EXPECT MAX 1 Paragraph
165
165
 
166
166
  > Write an article about the future of artificial intelligence in the next 10 years and how metalanguages will change the way AI is used in the world.
167
- > Look specifically at the impact of {subject} on the AI industry.
167
+ > Look specifically at the impact of Promptbook on the AI industry.
168
168
 
169
169
  -> {article}
170
170
  ```
171
171
 
172
+ ### Goals and principles of book language
173
+
174
+ 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.
175
+
176
+ It has file with `.book.md` or `.book` extension with `UTF-8` non BOM encoding.
177
+
178
+ 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.
179
+
180
+ But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
181
+
182
+ ### Structure
183
+
184
+ Book is divided into sections. Each section starts with heading. The language itself is not sensitive to the type of heading _(`h1`, `h2`, `h3`, ...)_ but it is recommended to use `h1` for header section and `h2` for other sections.
185
+
186
+ ### Header
187
+
188
+ Header is the first section of the book. It contains metadata about the pipeline. It is recommended to use `h1` heading for header section but it is not required.
189
+
190
+ ### Parameter
191
+
192
+ Foo bar
193
+
194
+ #### Parameter names
195
+
196
+ Reserved words:
197
+
198
+ - _each command_ like `PERSONA`, `EXPECT`, `KNOWLEDGE`, etc.
199
+ - `content`
200
+ - `context`
201
+ - `knowledge`
202
+ - `examples`
203
+ - `modelName`
204
+ - `currentDate`
205
+
206
+ #### Parameter notation
207
+
208
+ ### Template
209
+
210
+ Todo todo
211
+
212
+ ### Command
213
+
214
+ Todo todo
215
+
216
+ ### Block
217
+
218
+ Todo todo
219
+
220
+ ### Return parameter
221
+
222
+ ### Examples
223
+
224
+
225
+
172
226
  ## 📦 Packages _(for developers)_
173
227
 
174
228
  This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
@@ -207,15 +261,59 @@ Or you can install them separately:
207
261
 
208
262
 
209
263
 
210
- ## 📚 Dictionary
211
264
 
212
- The following glossary is used to clarify certain concepts:
213
265
 
214
- ### Basic terms
215
266
 
267
+ ## 📚 Dictionary
268
+
269
+ ### 📚 Dictionary
216
270
 
271
+ The following glossary is used to clarify certain concepts:
217
272
 
218
- ### Core concepts
273
+ #### General LLM / AI terms
274
+
275
+ - **Prompt drift** is a phenomenon where the AI model starts to generate outputs that are not aligned with the original prompt. This can happen due to the model's training data, the prompt's wording, or the model's architecture.
276
+ - **Pipeline, workflow or chain** is a sequence of tasks that are executed in a specific order. In the context of AI, a pipeline can refer to a sequence of AI models that are used to process data.
277
+ - **Fine-tuning** is a process where a pre-trained AI model is further trained on a specific dataset to improve its performance on a specific task.
278
+ - **Zero-shot learning** is a machine learning paradigm where a model is trained to perform a task without any labeled examples. Instead, the model is provided with a description of the task and is expected to generate the correct output.
279
+ - **Few-shot learning** is a machine learning paradigm where a model is trained to perform a task with only a few labeled examples. This is in contrast to traditional machine learning, where models are trained on large datasets.
280
+ - **Meta-learning** is a machine learning paradigm where a model is trained on a variety of tasks and is able to learn new tasks with minimal additional training. This is achieved by learning a set of meta-parameters that can be quickly adapted to new tasks.
281
+ - **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.
282
+ - **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.
283
+
284
+ _Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
285
+
286
+ #### Promptbook core
287
+
288
+ - **Organization** _(legacy name collection)_ group jobs, workforce, knowledge, instruments, and actions into one package. Entities in one organization can share resources (= import resources from each other).
289
+ - **Jobs**
290
+ - **Task**
291
+ - **Subtask**
292
+ - **Workforce**
293
+ - **Persona**
294
+ - **Team**
295
+ - **Role**
296
+ - **Knowledge**
297
+ - **Public**
298
+ - **Private**
299
+ - **Protected**
300
+ - **Instruments**
301
+ - **Actions**
302
+
303
+ #### Book language
304
+
305
+ - **Book file**
306
+ - **Section**
307
+ - **Heading**
308
+ - **Description**
309
+ - **Command**
310
+ - **Block**
311
+ - **Return statement**
312
+ - **Comment**
313
+ - **Import**
314
+ - **Scope**
315
+
316
+ #### 💯 Core concepts
219
317
 
220
318
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
221
319
  - [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
@@ -228,7 +326,7 @@ The following glossary is used to clarify certain concepts:
228
326
  - [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
229
327
  - [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
230
328
 
231
- ### Advanced concepts
329
+ ##### Advanced concepts
232
330
 
233
331
  - [📚 Knowledge (Retrieval-augmented generation)](https://github.com/webgptorg/promptbook/discussions/41)
234
332
  - [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
@@ -243,6 +341,13 @@ The following glossary is used to clarify certain concepts:
243
341
  - [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
244
342
  - [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
245
343
 
344
+ ### Terms specific to Promptbook TypeScript implementation
345
+
346
+ - Anonymous mode
347
+ - Application mode
348
+
349
+
350
+
246
351
  ## 🔌 Usage in Typescript / Javascript
247
352
 
248
353
  - [Simple usage](./examples/usage/simple-script)
@@ -1,4 +1,4 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { ANTHROPIC_CLAUDE_MODELS } from '../llm-providers/anthropic-claude/anthropic-claude-models';
3
3
  import { AnthropicClaudeExecutionTools } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionTools';
4
4
  import type { AnthropicClaudeExecutionToolsOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
@@ -6,7 +6,7 @@ import type { AnthropicClaudeExecutionToolsDirectOptions } from '../llm-provider
6
6
  import type { AnthropicClaudeExecutionToolsProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
7
7
  import { createAnthropicClaudeExecutionTools } from '../llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools';
8
8
  import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor';
9
- export { PROMPTBOOK_VERSION };
9
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
10
10
  export { ANTHROPIC_CLAUDE_MODELS };
11
11
  export { AnthropicClaudeExecutionTools };
12
12
  export type { AnthropicClaudeExecutionToolsOptions };
@@ -1,9 +1,9 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { AzureOpenAiExecutionTools } from '../llm-providers/azure-openai/AzureOpenAiExecutionTools';
3
3
  import type { AzureOpenAiExecutionToolsOptions } from '../llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions';
4
4
  import { createAzureOpenAiExecutionTools } from '../llm-providers/azure-openai/createAzureOpenAiExecutionTools';
5
5
  import { _AzureOpenAiRegistration } from '../llm-providers/azure-openai/register-constructor';
6
- export { PROMPTBOOK_VERSION };
6
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
7
7
  export { AzureOpenAiExecutionTools };
8
8
  export type { AzureOpenAiExecutionToolsOptions };
9
9
  export { createAzureOpenAiExecutionTools };
@@ -1,9 +1,9 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { SimplePromptInterfaceTools } from '../dialogs/simple-prompt/SimplePromptInterfaceTools';
3
3
  import { $provideScrapersForBrowser } from '../scrapers/_common/register/$provideScrapersForBrowser';
4
4
  import { getLocalStorage } from '../storage/local-storage/getLocalStorage';
5
5
  import { getSessionStorage } from '../storage/local-storage/getSessionStorage';
6
- export { PROMPTBOOK_VERSION };
6
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
7
7
  export { SimplePromptInterfaceTools };
8
8
  export { $provideScrapersForBrowser };
9
9
  export { getLocalStorage };
@@ -1,4 +1,4 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { _CLI } from '../cli/main';
3
3
  import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
4
4
  import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor';
@@ -18,7 +18,7 @@ import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
18
18
  import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
19
19
  import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
20
20
  import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
21
- export { PROMPTBOOK_VERSION };
21
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
22
22
  export { _CLI };
23
23
  export { _AnthropicClaudeMetadataRegistration };
24
24
  export { _AnthropicClaudeRegistration };
@@ -1,4 +1,4 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { collectionToJson } from '../collection/collectionToJson';
3
3
  import { createCollectionFromJson } from '../collection/constructors/createCollectionFromJson';
4
4
  import { createCollectionFromPromise } from '../collection/constructors/createCollectionFromPromise';
@@ -7,6 +7,7 @@ import { createSubcollection } from '../collection/constructors/createSubcollect
7
7
  import type { TemplateType } from '../commands/TEMPLATE/TemplateTypes';
8
8
  import { TemplateTypes } from '../commands/TEMPLATE/TemplateTypes';
9
9
  import { CLAIM } from '../config';
10
+ import { DEFAULT_TITLE } from '../config';
10
11
  import { MAX_FILENAME_LENGTH } from '../config';
11
12
  import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
12
13
  import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
@@ -84,14 +85,15 @@ import { _DocumentScraperMetadataRegistration } from '../scrapers/document/regis
84
85
  import { _MarkdownScraperMetadataRegistration } from '../scrapers/markdown/register-metadata';
85
86
  import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
86
87
  import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
88
+ import { BlackholeStorage } from '../storage/blackhole/BlackholeStorage';
87
89
  import { MemoryStorage } from '../storage/memory/MemoryStorage';
88
- import { PrefixStorage } from '../storage/memory/utils/PrefixStorage';
90
+ import { PrefixStorage } from '../storage/utils/PrefixStorage';
89
91
  import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
90
92
  import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
91
93
  import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
92
94
  import { MODEL_VARIANTS } from '../types/ModelVariant';
93
95
  import { EXPECTATION_UNITS } from '../types/PipelineJson/Expectations';
94
- export { PROMPTBOOK_VERSION };
96
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
95
97
  export { collectionToJson };
96
98
  export { createCollectionFromJson };
97
99
  export { createCollectionFromPromise };
@@ -100,6 +102,7 @@ export { createSubcollection };
100
102
  export type { TemplateType };
101
103
  export { TemplateTypes };
102
104
  export { CLAIM };
105
+ export { DEFAULT_TITLE };
103
106
  export { MAX_FILENAME_LENGTH };
104
107
  export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
105
108
  export { DEFAULT_MAX_PARALLEL_COUNT };
@@ -177,6 +180,7 @@ export { _DocumentScraperMetadataRegistration };
177
180
  export { _MarkdownScraperMetadataRegistration };
178
181
  export { _PdfScraperMetadataRegistration };
179
182
  export { _WebsiteScraperMetadataRegistration };
183
+ export { BlackholeStorage };
180
184
  export { MemoryStorage };
181
185
  export { PrefixStorage };
182
186
  export { executionReportJsonToString };
@@ -1,8 +1,8 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createDocumentScraper } from '../scrapers/document/createDocumentScraper';
3
3
  import { DocumentScraper } from '../scrapers/document/DocumentScraper';
4
4
  import { _DocumentScraperRegistration } from '../scrapers/document/register-constructor';
5
- export { PROMPTBOOK_VERSION };
5
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
6
6
  export { createDocumentScraper };
7
7
  export { DocumentScraper };
8
8
  export { _DocumentScraperRegistration };
@@ -1,8 +1,8 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { JavascriptEvalExecutionTools } from '../scripting/javascript/JavascriptEvalExecutionTools';
3
3
  import { JavascriptExecutionTools } from '../scripting/javascript/JavascriptExecutionTools';
4
4
  import { POSTPROCESSING_FUNCTIONS } from '../scripting/javascript/postprocessing-functions';
5
- export { PROMPTBOOK_VERSION };
5
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
6
6
  export { JavascriptEvalExecutionTools };
7
7
  export { JavascriptExecutionTools };
8
8
  export { POSTPROCESSING_FUNCTIONS };
@@ -1,6 +1,6 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { MockedEchoLlmExecutionTools } from '../llm-providers/mocked/MockedEchoLlmExecutionTools';
3
3
  import { MockedFackedLlmExecutionTools } from '../llm-providers/mocked/MockedFackedLlmExecutionTools';
4
- export { PROMPTBOOK_VERSION };
4
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
5
5
  export { MockedEchoLlmExecutionTools };
6
6
  export { MockedFackedLlmExecutionTools };
@@ -1,6 +1,6 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { LangtailExecutionTools } from '../llm-providers/langtail/LangtailExecutionTools';
3
3
  import type { LangtailExecutionToolsOptions } from '../llm-providers/langtail/LangtailExecutionToolsOptions';
4
- export { PROMPTBOOK_VERSION };
4
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
5
5
  export { LangtailExecutionTools };
6
6
  export type { LangtailExecutionToolsOptions };
@@ -1,8 +1,8 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createLegacyDocumentScraper } from '../scrapers/document-legacy/createLegacyDocumentScraper';
3
3
  import { LegacyDocumentScraper } from '../scrapers/document-legacy/LegacyDocumentScraper';
4
4
  import { _LegacyDocumentScraperRegistration } from '../scrapers/document-legacy/register-constructor';
5
- export { PROMPTBOOK_VERSION };
5
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
6
6
  export { createLegacyDocumentScraper };
7
7
  export { LegacyDocumentScraper };
8
8
  export { _LegacyDocumentScraperRegistration };
@@ -1,4 +1,4 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { extractBlock } from '../postprocessing/utils/extractBlock';
3
3
  import { extractJsonBlock } from '../postprocessing/utils/extractJsonBlock';
4
4
  import { createMarkdownScraper } from '../scrapers/markdown/createMarkdownScraper';
@@ -21,7 +21,7 @@ import { parseMarkdownSection } from '../utils/markdown/parseMarkdownSection';
21
21
  import { removeContentComments } from '../utils/markdown/removeContentComments';
22
22
  import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
23
23
  import { splitMarkdownIntoSections } from '../utils/markdown/splitMarkdownIntoSections';
24
- export { PROMPTBOOK_VERSION };
24
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
25
25
  export { extractBlock };
26
26
  export { extractJsonBlock };
27
27
  export { createMarkdownScraper };
@@ -1,4 +1,4 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createCollectionFromDirectory } from '../collection/constructors/createCollectionFromDirectory';
3
3
  import { $provideExecutablesForNode } from '../executables/$provideExecutablesForNode';
4
4
  import { $provideExecutionToolsForNode } from '../execution/utils/$provideExecutionToolsForNode';
@@ -9,7 +9,7 @@ import { $provideScrapersForNode } from '../scrapers/_common/register/$provideSc
9
9
  import { FileCacheStorage } from '../storage/file-cache-storage/FileCacheStorage';
10
10
  import { $execCommand } from '../utils/execCommand/$execCommand';
11
11
  import { $execCommands } from '../utils/execCommand/$execCommands';
12
- export { PROMPTBOOK_VERSION };
12
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
13
13
  export { createCollectionFromDirectory };
14
14
  export { $provideExecutablesForNode };
15
15
  export { $provideExecutionToolsForNode };
@@ -1,4 +1,4 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createOpenAiAssistantExecutionTools } from '../llm-providers/openai/createOpenAiAssistantExecutionTools';
3
3
  import { createOpenAiExecutionTools } from '../llm-providers/openai/createOpenAiExecutionTools';
4
4
  import { OPENAI_MODELS } from '../llm-providers/openai/openai-models';
@@ -8,7 +8,7 @@ import { OpenAiExecutionTools } from '../llm-providers/openai/OpenAiExecutionToo
8
8
  import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions';
9
9
  import { _OpenAiRegistration } from '../llm-providers/openai/register-constructor';
10
10
  import { _OpenAiAssistantRegistration } from '../llm-providers/openai/register-constructor';
11
- export { PROMPTBOOK_VERSION };
11
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
12
12
  export { createOpenAiAssistantExecutionTools };
13
13
  export { createOpenAiExecutionTools };
14
14
  export { OPENAI_MODELS };
@@ -1,8 +1,8 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createPdfScraper } from '../scrapers/pdf/createPdfScraper';
3
3
  import { PdfScraper } from '../scrapers/pdf/PdfScraper';
4
4
  import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
5
- export { PROMPTBOOK_VERSION };
5
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
6
6
  export { createPdfScraper };
7
7
  export { PdfScraper };
8
8
  export { _PdfScraperRegistration };
@@ -1,8 +1,8 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import type { RemoteLlmExecutionToolsOptions } from '../llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions';
3
3
  import type { RemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
4
4
  import { RemoteLlmExecutionTools } from '../llm-providers/remote/RemoteLlmExecutionTools';
5
- export { PROMPTBOOK_VERSION };
5
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
6
6
  export type { RemoteLlmExecutionToolsOptions };
7
7
  export type { RemoteServerOptions };
8
8
  export { RemoteLlmExecutionTools };
@@ -1,6 +1,6 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import type { RemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
3
3
  import { startRemoteServer } from '../llm-providers/remote/startRemoteServer';
4
- export { PROMPTBOOK_VERSION };
4
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
5
5
  export type { RemoteServerOptions };
6
6
  export { startRemoteServer };
@@ -1,4 +1,4 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
3
3
  import { extractParameterNamesFromTemplate } from '../conversion/utils/extractParameterNamesFromTemplate';
4
4
  import { extractVariables } from '../conversion/utils/extractVariables';
@@ -69,7 +69,7 @@ import { isUrlOnPrivateNetwork } from '../utils/validators/url/isUrlOnPrivateNet
69
69
  import { isValidPipelineUrl } from '../utils/validators/url/isValidPipelineUrl';
70
70
  import { isValidUrl } from '../utils/validators/url/isValidUrl';
71
71
  import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
72
- export { PROMPTBOOK_VERSION };
72
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
73
73
  export { renderPromptbookMermaid };
74
74
  export { extractParameterNamesFromTemplate };
75
75
  export { extractVariables };
@@ -1,8 +1,8 @@
1
- import { PROMPTBOOK_VERSION } from '../version';
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createWebsiteScraper } from '../scrapers/website/createWebsiteScraper';
3
3
  import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
4
4
  import { WebsiteScraper } from '../scrapers/website/WebsiteScraper';
5
- export { PROMPTBOOK_VERSION };
5
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
6
6
  export { createWebsiteScraper };
7
7
  export { _WebsiteScraperRegistration };
8
8
  export { WebsiteScraper };
@@ -7,7 +7,6 @@ import type { Command as Program } from 'commander';
7
7
  export declare function initializeMakeCommand(program: Program): void;
8
8
  /**
9
9
  * TODO: [🥃][main] !!! Allow `ptbk make` without configuring any llm tools
10
- * TODO: Maybe remove this command - "about" command should be enough?
11
10
  * TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
12
11
  * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
13
12
  * TODO: [🖇] What about symlinks? Maybe flag --follow-symlinks
@@ -0,0 +1,14 @@
1
+ import type { Command as Program } from 'commander';
2
+ /**
3
+ * Initializes `run` command for Promptbook CLI utilities
4
+ *
5
+ * @private internal function of `promptbookCli`
6
+ */
7
+ export declare function initializeRunCommand(program: Program): void;
8
+ /**
9
+ * TODO: !!!!!! Catch and wrap all errors from CLI
10
+ * TODO: [🧠] Pass `maxExecutionAttempts`, `csvSettings`
11
+ * TODO: [🥃][main] !!! Allow `ptbk run` without configuring any llm tools
12
+ * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
13
+ * TODO: [🖇] What about symlinks? Maybe flag --follow-symlinks
14
+ */
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export declare function promptbookCli(): Promise<void>;
7
7
  /**
8
+ * TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.book.md` -> `ptbk ./foo.book.md`
8
9
  * TODO: [🥠] Do not export, its just for CLI script
9
10
  * TODO: [🕌] When more functionalities, rename
10
11
  * Note: 11:11
@@ -1,2 +1,5 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ #!/usr/bin/env ts-node
2
+ /**
3
+ * Note: Purpose of this file !!!!!!! vs other place
4
+ */
5
+ import '../../_packages/cli.index.ts';
@@ -1,6 +1,6 @@
1
1
  export {};
2
2
  /**
3
- * Note: [🐠] For example here URL https://example.com/pipeline.ptbk.md is not valid
3
+ * Note: [🐠] For example here URL https://example.com/pipeline.book.md is not valid
4
4
  * because it is on private network BUT its very hard to debug because
5
5
  * there is no error message and false return (the error) happen deep in:
6
6
  * `isValidPipelineUrl` -> `isValidPipelineUrl` -> `isUrlOnPrivateNetwork`
@@ -5,7 +5,7 @@ import type { PipelineCollection } from '../PipelineCollection';
5
5
  /**
6
6
  * Options for `createCollectionFromDirectory` function
7
7
  *
8
- * Note: `rootDirname` is not needed because it is the folder in which `.ptbk.md` file is located
8
+ * Note: `rootDirname` is not needed because it is the folder in which `.book.md` file is located
9
9
  * This is not same as `path` which is the first argument of `createCollectionFromDirectory` - it can be a subfolder
10
10
  */
11
11
  type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions, 'rootDirname'> & {
@@ -0,0 +1,11 @@
1
+ import type { string_semantic_version } from '../../types/typeAliases';
2
+ /**
3
+ * Parsed BOOK_VERSION command
4
+ *
5
+ * @see ./bookVersionCommandParser.ts for more details
6
+ * @private within the commands folder
7
+ */
8
+ export type BookVersionCommand = {
9
+ readonly type: 'BOOK_VERSION';
10
+ readonly bookVersion: string_semantic_version;
11
+ };
@@ -0,0 +1,9 @@
1
+ import type { PipelineHeadCommandParser } from '../_common/types/CommandParser';
2
+ import type { BookVersionCommand } from './BookVersionCommand';
3
+ /**
4
+ * Parses the BOOK_VERSION command
5
+ *
6
+ * @see `documentationUrl` for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const bookVersionCommandParser: PipelineHeadCommandParser<BookVersionCommand>;
@@ -3,12 +3,12 @@ import type { ForeachCommand } from './ForeachCommand';
3
3
  /**
4
4
  * Parses the foreach command
5
5
  *
6
- * Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.ptbk.md` file
6
+ * Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book.md` file
7
7
  *
8
8
  * @see `documentationUrl` for more details
9
9
  * @private within the commands folder
10
10
  */
11
11
  export declare const foreachCommandParser: PipelineTemplateCommandParser<ForeachCommand>;
12
12
  /**
13
- * TODO: [🍭] Make .ptbk.md file with examples of the FOREACH with wrong parsing and logic
13
+ * TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
14
14
  */
@@ -3,7 +3,7 @@ import type { BoilerplateCommand } from './BoilerplateCommand';
3
3
  /**
4
4
  * Parses the boilerplate command
5
5
  *
6
- * Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.ptbk.md` file
6
+ * Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book.md` file
7
7
  *
8
8
  * @see `documentationUrl` for more details
9
9
  * @private within the commands folder
@@ -169,7 +169,7 @@ export type CommandParserInput = {
169
169
  /**
170
170
  * @@@
171
171
  *
172
- * @example 'PROMPTBOOK_VERSION_0_62_0'
172
+ * @example 'PROMPTBOOK_ENGINE_VERSION_0_62_0'
173
173
  * @example 'FOREACH_LIST_LINE_CUSTOMERS_CUSTOMER'
174
174
  */
175
175
  readonly normalized: string_name & string_SCREAMING_CASE;
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * @private internal index of `parseCommand`
5
5
  */
6
- export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./TEMPLATE/TemplateCommand").TemplateCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./PROMPTBOOK_VERSION/PromptbookVersionCommand").PromptbookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
6
+ export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./TEMPLATE/TemplateCommand").TemplateCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./BOOK_VERSION/BookVersionCommand").BookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
@@ -14,6 +14,12 @@ export declare const GENERATOR_WARNING = "\u26A0\uFE0F WARNING: This code has be
14
14
  * @public exported from `@promptbook/core`
15
15
  */
16
16
  export declare const CLAIM = "Build responsible, controlled and transparent applications on top of LLM models!";
17
+ /**
18
+ * When the title is not provided, the default title is used
19
+ *
20
+ * @public exported from `@promptbook/core`
21
+ */
22
+ export declare const DEFAULT_TITLE = "Untitled";
17
23
  /**
18
24
  * Warning message for the generated sections and files files
19
25
  *
@@ -3,8 +3,8 @@ import type { PipelineString } from '../types/PipelineString';
3
3
  /**
4
4
  * Converts promptbook in JSON format to string format
5
5
  *
6
- * @param pipelineJson Promptbook in JSON format (.ptbk.json)
7
- * @returns Promptbook in string format (.ptbk.md)
6
+ * @param pipelineJson Promptbook in JSON format (.book.json)
7
+ * @returns Promptbook in string format (.book.md)
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
10
  export declare function pipelineJsonToString(pipelineJson: PipelineJson): PipelineString;
@@ -13,5 +13,5 @@ export declare function pipelineJsonToString(pipelineJson: PipelineJson): Pipeli
13
13
  * TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
14
14
  * TODO: [🏛] Maybe make some markdown builder
15
15
  * TODO: [🏛] Escape all
16
- * TODO: [🧠] Should be in generated .ptbk.md file GENERATOR_WARNING
16
+ * TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
17
17
  */
@@ -13,10 +13,10 @@ import type { PipelineString } from '../types/PipelineString';
13
13
  * Note: This function does not validate logic of the pipeline only the parsing
14
14
  * Note: This function acts as compilation process
15
15
  *
16
- * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
16
+ * @param pipelineString {Promptbook} in string markdown format (.book.md)
17
17
  * @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
18
18
  * @param options - Options and tools for the compilation
19
- * @returns {Promptbook} compiled in JSON format (.ptbk.json)
19
+ * @returns {Promptbook} compiled in JSON format (.book.json)
20
20
  * @throws {ParseError} if the promptbook string is not valid
21
21
  * @public exported from `@promptbook/core`
22
22
  */
@@ -11,8 +11,8 @@ import type { PipelineString } from '../types/PipelineString';
11
11
  * Note: This function does not validate logic of the pipeline only the parsing
12
12
  * Note: This function acts as compilation process
13
13
  *
14
- * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
15
- * @returns {Promptbook} compiled in JSON format (.ptbk.json)
14
+ * @param pipelineString {Promptbook} in string markdown format (.book.md)
15
+ * @returns {Promptbook} compiled in JSON format (.book.json)
16
16
  * @throws {ParseError} if the promptbook string is not valid
17
17
  * @public exported from `@promptbook/core`
18
18
  */
@@ -9,7 +9,7 @@ import type { string_json } from '../../types/typeAliases';
9
9
  */
10
10
  export declare function stringifyPipelineJson<TType>(pipeline: TType): string_json<TType>;
11
11
  /**
12
- * TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.ptbk.md
12
+ * TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book.md
13
13
  * TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
14
14
  * TODO: [🧠] Maybe more elegant solution than replacing via regex
15
15
  * TODO: [🍙] Make some standard order of json properties
@@ -2,7 +2,7 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
2
  import type { PipelineString } from '../../types/PipelineString';
3
3
  import type { string_json } from '../../types/typeAliases';
4
4
  /**
5
- * Import the pipeline.ptbk.md or pipeline.ptbk.json file
5
+ * Import the pipeline.book.md or pipeline.book.json file
6
6
  *
7
7
  * Note: Using here custom import to work in jest tests
8
8
  * Note: Using sync version is 💩 in the production code, but it's ok here in tests
@@ -10,20 +10,20 @@ import type { string_json } from '../../types/typeAliases';
10
10
  * @param path - The path to the file relative to examples/pipelines directory
11
11
  * @private internal function of tests
12
12
  */
13
- export declare function importPipelineWithoutPreparation(path: `${string}.ptbk.md`): PipelineString;
14
- export declare function importPipelineWithoutPreparation(path: `${string}.ptbk.json`): PipelineJson;
13
+ export declare function importPipelineWithoutPreparation(path: `${string}.book.md`): PipelineString;
14
+ export declare function importPipelineWithoutPreparation(path: `${string}.book.json`): PipelineJson;
15
15
  /**
16
- * Import the pipeline.ptbk.json file as parsed JSON
16
+ * Import the pipeline.book.json file as parsed JSON
17
17
  *
18
18
  * @private internal function of tests
19
19
  */
20
- export declare function importPipelineJson(path: `${string}.ptbk.json`): PipelineJson;
20
+ export declare function importPipelineJson(path: `${string}.book.json`): PipelineJson;
21
21
  /**
22
- * Import the pipeline.ptbk.json file as string
22
+ * Import the pipeline.book.json file as string
23
23
  *
24
24
  * @private internal function of tests
25
25
  */
26
- export declare function importPipelineJsonAsString(path: `${string}.ptbk.json`): string_json<PipelineJson>;
26
+ export declare function importPipelineJsonAsString(path: `${string}.book.json`): string_json<PipelineJson>;
27
27
  /**
28
28
  * Note: [⚫] Code in this file should never be published in any package
29
29
  */
@@ -13,7 +13,7 @@ import type { FormatSubvalueDefinition } from './FormatSubvalueDefinition';
13
13
  */
14
14
  export type FormatDefinition<TValue extends TPartialValue, TPartialValue extends string, TSettings extends empty_object, TSchema extends empty_object> = {
15
15
  /**
16
- * The name of the format used in .ptbk.md files
16
+ * The name of the format used in .book.md files
17
17
  *
18
18
  * @example "JSON"
19
19
  */
@@ -9,7 +9,7 @@ import type { empty_object } from '../../utils/organization/empty_object';
9
9
  */
10
10
  export type FormatSubvalueDefinition<TValue extends string, TSettings extends empty_object> = {
11
11
  /**
12
- * The name of the format used in .ptbk.md files
12
+ * The name of the format used in .book.md files
13
13
  *
14
14
  * @example "CELL"
15
15
  */
@@ -0,0 +1,33 @@
1
+ import type { PromptbookStorage } from '../_common/PromptbookStorage';
2
+ /**
3
+ * Behaves like a storage but forgets everything you put in it
4
+ *
5
+ * @public exported from `@promptbook/core`
6
+ */
7
+ export declare class BlackholeStorage<TItem> implements PromptbookStorage<TItem> {
8
+ /**
9
+ * Returns the number of key/value pairs currently present in the list associated with the object.
10
+ */
11
+ get length(): number;
12
+ /**
13
+ * Empties the list associated with the object of all key/value pairs, if there are any.
14
+ */
15
+ clear(): void;
16
+ /**
17
+ * 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.
18
+ * @param key
19
+ */
20
+ getItem(key: string): null;
21
+ /**
22
+ * Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.
23
+ */
24
+ key(index: number): null;
25
+ /**
26
+ * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
27
+ */
28
+ setItem(key: string, value: TItem): void;
29
+ /**
30
+ * 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.
31
+ */
32
+ removeItem(key: string): void;
33
+ }
@@ -1,6 +1,6 @@
1
1
  import type { PromptbookStorage } from '../_common/PromptbookStorage';
2
2
  /**
3
- * Stores
3
+ * Stores data in memory (HEAP)
4
4
  *
5
5
  * @public exported from `@promptbook/core`
6
6
  */
@@ -1,5 +1,5 @@
1
1
  import type { Promisable } from 'type-fest';
2
- import type { PromptbookStorage } from '../../_common/PromptbookStorage';
2
+ import type { PromptbookStorage } from '../_common/PromptbookStorage';
3
3
  /**
4
4
  * This class behaves like LocalStorage but separates keys by prefix
5
5
  *
@@ -26,12 +26,12 @@ export type PipelineJson = {
26
26
  * Note: It must be unique across all pipeline collections
27
27
  * Note: It must use HTTPs URL
28
28
  * Tip: You can do versioning in the URL
29
- * For example: https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md@1.0.0
29
+ * For example: https://promptbook.studio/webgpt/write-website-content-cs.book.md@1.0.0
30
30
  * Warning: Do not hash part of the URL, hash part is used for identification of the template in the pipeline
31
31
  */
32
32
  readonly pipelineUrl?: string_pipeline_url;
33
33
  /**
34
- * Internal helper for tracking the source `.ptbk.md` file of the pipeline
34
+ * Internal helper for tracking the source `.book.md` file of the pipeline
35
35
  */
36
36
  readonly sourceFile?: string_filename;
37
37
  /**
@@ -40,9 +40,11 @@ export type PipelineJson = {
40
40
  */
41
41
  readonly title: string_markdown_text;
42
42
  /**
43
- * Version of the .ptbk.json file
43
+ * Version of the Book language
44
+ *
45
+ * @see https://github.com/webgptorg/book
44
46
  */
45
- readonly promptbookVersion?: string_semantic_version;
47
+ readonly bookVersion?: string_semantic_version;
46
48
  /**
47
49
  * Description of the promptbook
48
50
  * It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
@@ -18,5 +18,5 @@ export type PreparationJson = {
18
18
  /**
19
19
  * TODO: [🍙] Make some standard order of json properties
20
20
  * TODO: Maybe put here used `modelName`
21
- * TODO: [🍥] When using `date` it changes all examples .ptbk.json files each time so until some more elegant solution omit the time from prepared pipeline
21
+ * TODO: [🍥] When using `date` it changes all examples .book.json files each time so until some more elegant solution omit the time from prepared pipeline
22
22
  */
@@ -95,7 +95,7 @@ export type CommonPrompt = {
95
95
  /**
96
96
  * Unique identifier of the pipeline with specific template name as hash
97
97
  *
98
- * @example https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md#keywords
98
+ * @example https://promptbook.studio/webgpt/write-website-content-cs.book.md#keywords
99
99
  */
100
100
  readonly pipelineUrl?: string_pipeline_url_with_hashtemplate;
101
101
  /**
@@ -298,13 +298,13 @@ export type string_base_url = string;
298
298
  /**
299
299
  * Semantic helper
300
300
  *
301
- * For example `"https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md"`
301
+ * For example `"https://promptbook.studio/webgpt/write-website-content-cs.book.md"`
302
302
  */
303
303
  export type string_pipeline_url = string;
304
304
  /**
305
305
  * Semantic helper
306
306
  *
307
- * For example `"https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md#keywords"`
307
+ * For example `"https://promptbook.studio/webgpt/write-website-content-cs.book.md#keywords"`
308
308
  */
309
309
  export type string_pipeline_url_with_hashtemplate = string;
310
310
  /**
@@ -1,6 +1,17 @@
1
1
  import type { string_semantic_version } from './types/typeAliases';
2
2
  /**
3
- * The version of the Promptbook library
3
+ * The version of the Book language
4
+ *
5
+ * @see https://github.com/webgptorg/book
4
6
  */
5
- export declare const PROMPTBOOK_VERSION: string_promptbook_version;
7
+ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
8
+ /**
9
+ * The version of the Promptbook engine
10
+ *
11
+ * @see https://github.com/webgptorg/promptbook
12
+ */
13
+ export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
6
14
  export type string_promptbook_version = string_semantic_version;
15
+ /**
16
+ * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
17
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.74.0-0",
3
+ "version": "0.74.0-12",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -51,6 +51,6 @@
51
51
  ],
52
52
  "typings": "./esm/typings/src/_packages/types.index.d.ts",
53
53
  "peerDependencies": {
54
- "@promptbook/core": "0.74.0-0"
54
+ "@promptbook/core": "0.74.0-12"
55
55
  }
56
56
  }
@@ -1,11 +0,0 @@
1
- import type { string_semantic_version } from '../../types/typeAliases';
2
- /**
3
- * Parsed PROMPTBOOK_VERSION command
4
- *
5
- * @see ./promptbookVersionCommandParser.ts for more details
6
- * @private within the commands folder
7
- */
8
- export type PromptbookVersionCommand = {
9
- readonly type: 'PROMPTBOOK_VERSION';
10
- readonly promptbookVersion: string_semantic_version;
11
- };
@@ -1,9 +0,0 @@
1
- import type { PipelineHeadCommandParser } from '../_common/types/CommandParser';
2
- import type { PromptbookVersionCommand } from './PromptbookVersionCommand';
3
- /**
4
- * Parses the PROMPTBOOK_VERSION command
5
- *
6
- * @see `documentationUrl` for more details
7
- * @private within the commands folder
8
- */
9
- export declare const promptbookVersionCommandParser: PipelineHeadCommandParser<PromptbookVersionCommand>;