@promptbook/editable 0.84.0-21 → 0.84.0-9

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 (38) hide show
  1. package/README.md +5 -21
  2. package/esm/index.es.js +6 -56
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/cli.index.d.ts +0 -4
  5. package/esm/typings/src/_packages/core.index.d.ts +2 -12
  6. package/esm/typings/src/_packages/types.index.d.ts +0 -2
  7. package/esm/typings/src/_packages/utils.index.d.ts +0 -2
  8. package/esm/typings/src/_packages/wizzard.index.d.ts +0 -4
  9. package/esm/typings/src/cli/cli-commands/about.d.ts +1 -3
  10. package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -3
  11. package/esm/typings/src/cli/cli-commands/list-models.d.ts +1 -3
  12. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -3
  13. package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -3
  14. package/esm/typings/src/cli/cli-commands/run.d.ts +1 -3
  15. package/esm/typings/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -1
  16. package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -3
  17. package/esm/typings/src/config.d.ts +1 -27
  18. package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +1 -1
  19. package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
  20. package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -3
  21. package/esm/typings/src/pipeline/book-notation.d.ts +2 -3
  22. package/esm/typings/src/pipeline/prompt-notation.d.ts +5 -18
  23. package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +1 -1
  24. package/esm/typings/src/remote-server/socket-types/_subtypes/PromptbookServer_Identification.d.ts +2 -5
  25. package/esm/typings/src/wizzard/wizzard.d.ts +1 -7
  26. package/package.json +16 -9
  27. package/umd/index.umd.js +6 -56
  28. package/umd/index.umd.js.map +1 -1
  29. package/esm/typings/src/_packages/deepseek.index.d.ts +0 -8
  30. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +0 -13
  31. package/esm/typings/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +0 -9
  32. package/esm/typings/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -14
  33. package/esm/typings/src/llm-providers/deepseek/register-configuration.d.ts +0 -14
  34. package/esm/typings/src/llm-providers/deepseek/register-constructor.d.ts +0 -15
  35. package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.test.d.ts +0 -1
  36. package/esm/typings/src/utils/editable/utils/isFlatPipeline.test.d.ts +0 -1
  37. package/esm/typings/src/utils/files/mimeTypeToExtension.d.ts +0 -10
  38. package/esm/typings/src/utils/files/mimeTypeToExtension.test.d.ts +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->
2
2
 
3
- # Promptbook
3
+ # Promptbook
4
4
 
5
5
 
6
6
 
@@ -14,13 +14,12 @@
14
14
 
15
15
 
16
16
 
17
- ## 🌟 New Features
17
+ ## New Features
18
18
 
19
- - 💫 Support of [`o3-mini` model by OpenAI](https://openai.com/index/openai-o3-mini/)
20
- - 🐋 **Support of [DeepSeek models](https://www.npmjs.com/package/@promptbook/deepseek)**
21
19
  - 💙 Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
22
20
  - 🖤 Run books from CLI - `npx ptbk run path/to/your/book`
23
- - 📚 Support of `.docx`, `.doc` and `.pdf` documents as knowledge
21
+ - 📚 Support of `.docx`, `.doc` and `.pdf` documents
22
+ - ✨ **Support of [OpenAI o1 model](https://openai.com/o1/)**
24
23
 
25
24
 
26
25
 
@@ -266,9 +265,8 @@ Or you can install them separately:
266
265
  - **[@promptbook/anthropic-claude](https://www.npmjs.com/package/@promptbook/anthropic-claude)** - Execution tools for Anthropic Claude API, wrapper around Anthropic Claude SDK
267
266
  - **[@promptbook/vercel](https://www.npmjs.com/package/@promptbook/vercel)** - Adapter for Vercel functionalities
268
267
  - **[@promptbook/google](https://www.npmjs.com/package/@promptbook/google)** - Integration with Google's Gemini API
269
- - **[@promptbook/deepseek](https://www.npmjs.com/package/@promptbook/deepseek)** - Integration with [DeepSeek API](https://www.deepseek.com/)
270
268
  - **[@promptbook/azure-openai](https://www.npmjs.com/package/@promptbook/azure-openai)** - Execution tools for Azure OpenAI API
271
-
269
+ - **[@promptbook/langtail](https://www.npmjs.com/package/@promptbook/langtail)** - Execution tools for Langtail API, wrapper around Langtail SDK
272
270
  - **[@promptbook/fake-llm](https://www.npmjs.com/package/@promptbook/fake-llm)** - Mocked execution tools for testing the library and saving the tokens
273
271
  - **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
274
272
  - **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
@@ -438,20 +436,6 @@ See [TODO.md](./TODO.md)
438
436
 
439
437
 
440
438
 
441
- ## 🤝 Partners
442
-
443
- <div style="display: flex; align-items: center; gap: 20px;">
444
-
445
- <a href="https://promptbook.studio/">
446
- <img src="./other/design/promptbook-studio-logo.png" alt="Partner 3" height="100">
447
- </a>
448
-
449
- <a href="https://technologickainkubace.org/en/about-technology-incubation/about-the-project/">
450
- <img src="./other/partners/CI-Technology-Incubation.png" alt="Technology Incubation" height="100">
451
- </a>
452
-
453
- </div>
454
-
455
439
  ## 🖋️ Contributing
456
440
 
457
441
  I am open to pull requests, feedback, and suggestions. Or if you like this utility, you can [☕ buy me a coffee](https://www.buymeacoffee.com/hejny) or [donate via cryptocurrencies](https://github.com/hejny/hejny/blob/main/documents/crypto.md).
package/esm/index.es.js CHANGED
@@ -17,7 +17,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
17
17
  * @generated
18
18
  * @see https://github.com/webgptorg/promptbook
19
19
  */
20
- var PROMPTBOOK_ENGINE_VERSION = '0.84.0-20';
20
+ var PROMPTBOOK_ENGINE_VERSION = '0.84.0-8';
21
21
  /**
22
22
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
23
23
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -188,12 +188,6 @@ var ADMIN_GITHUB_NAME = 'hejny';
188
188
  * @public exported from `@promptbook/core`
189
189
  */
190
190
  var DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
191
- /**
192
- * When the pipeline is flat and no name of return parameter is provided, this name is used
193
- *
194
- * @public exported from `@promptbook/core`
195
- */
196
- var DEFAULT_BOOK_OUTPUT_PARAMETER_NAME = 'result';
197
191
  // <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
198
192
  /**
199
193
  * The maximum number of iterations for a loops
@@ -3874,21 +3868,6 @@ function parseCommandVariant(input) {
3874
3868
  return null;
3875
3869
  }
3876
3870
 
3877
- /**
3878
- * Checks if value is valid email
3879
- *
3880
- * @public exported from `@promptbook/utils`
3881
- */
3882
- function isValidEmail(email) {
3883
- if (typeof email !== 'string') {
3884
- return false;
3885
- }
3886
- if (email.split('\n').length > 1) {
3887
- return false;
3888
- }
3889
- return /^.+@.+\..+$/.test(email);
3890
- }
3891
-
3892
3871
  /**
3893
3872
  * Function `validatePipelineString` will validate the if the string is a valid pipeline string
3894
3873
  * It does not check if the string is fully logically correct, but if it is a string that can be a pipeline string or the string looks completely different.
@@ -3902,15 +3881,6 @@ function validatePipelineString(pipelineString) {
3902
3881
  if (isValidJsonString(pipelineString)) {
3903
3882
  throw new ParseError('Expected a book, but got a JSON string');
3904
3883
  }
3905
- else if (isValidUrl(pipelineString)) {
3906
- throw new ParseError("Expected a book, but got just the URL \"".concat(pipelineString, "\""));
3907
- }
3908
- else if (isValidFilePath(pipelineString)) {
3909
- throw new ParseError("Expected a book, but got just the file path \"".concat(pipelineString, "\""));
3910
- }
3911
- else if (isValidEmail(pipelineString)) {
3912
- throw new ParseError("Expected a book, but got just the email \"".concat(pipelineString, "\""));
3913
- }
3914
3884
  // <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
3915
3885
  return pipelineString;
3916
3886
  }
@@ -3938,15 +3908,12 @@ function isFlatPipeline(pipelineString) {
3938
3908
  pipelineString = removeMarkdownComments(pipelineString);
3939
3909
  pipelineString = spaceTrim(pipelineString);
3940
3910
  var isMarkdownBeginningWithHeadline = pipelineString.startsWith('# ');
3941
- //const isLastLineReturnStatement = pipelineString.split('\n').pop()!.split('`').join('').startsWith('->');
3942
- var isBacktickBlockUsed = pipelineString.includes('```');
3943
- var isQuoteBlocksUsed = /^>\s+/m.test(pipelineString);
3944
- var isBlocksUsed = isBacktickBlockUsed || isQuoteBlocksUsed;
3945
- // TODO: [🧉] Also (double)check
3911
+ var isLastLineReturnStatement = pipelineString.split('\n').pop().split('`').join('').startsWith('->');
3912
+ // TODO: Also (double)check
3946
3913
  // > const usedCommands
3947
3914
  // > const isBlocksUsed
3948
3915
  // > const returnStatementCount
3949
- var isFlat = !isMarkdownBeginningWithHeadline && !isBlocksUsed; /* && isLastLineReturnStatement */
3916
+ var isFlat = !isMarkdownBeginningWithHeadline && isLastLineReturnStatement;
3950
3917
  return isFlat;
3951
3918
  }
3952
3919
 
@@ -3960,26 +3927,9 @@ function deflatePipeline(pipelineString) {
3960
3927
  return pipelineString;
3961
3928
  }
3962
3929
  var pipelineStringLines = pipelineString.split('\n');
3963
- var potentialReturnStatement = pipelineStringLines.pop();
3964
- var returnStatement;
3965
- if (/(-|=)>\s*\{.*\}/.test(potentialReturnStatement)) {
3966
- // Note: Last line is return statement
3967
- returnStatement = potentialReturnStatement;
3968
- }
3969
- else {
3970
- // Note: Last line is not a return statement
3971
- returnStatement = "-> {".concat(DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, "}");
3972
- pipelineStringLines.push(potentialReturnStatement);
3973
- }
3930
+ var returnStatement = pipelineStringLines.pop();
3974
3931
  var prompt = spaceTrim(pipelineStringLines.join('\n'));
3975
- var quotedPrompt;
3976
- if (prompt.split('\n').length <= 1) {
3977
- quotedPrompt = "> ".concat(prompt);
3978
- }
3979
- else {
3980
- quotedPrompt = spaceTrim(function (block) { return "\n ```\n ".concat(block(prompt.split('`').join('\\`')), "\n ```\n "); });
3981
- }
3982
- pipelineString = validatePipelineString(spaceTrim(function (block) { return "\n # ".concat(DEFAULT_BOOK_TITLE, "\n\n ## Prompt\n\n ").concat(block(quotedPrompt), "\n\n ").concat(returnStatement, "\n "); }));
3932
+ pipelineString = validatePipelineString(spaceTrim(function (block) { return "\n # ".concat(DEFAULT_BOOK_TITLE, "\n\n ## Prompt\n\n ```\n ").concat(block(prompt), "\n ```\n\n ").concat(returnStatement, "\n "); }));
3983
3933
  // <- TODO: Maybe use book` notation
3984
3934
  return pipelineString;
3985
3935
  }