@promptbook/remote-client 0.84.0-20 → 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 (29) hide show
  1. package/README.md +5 -11
  2. package/esm/index.es.js +8 -58
  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/config.d.ts +1 -27
  10. package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +1 -1
  11. package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
  12. package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -3
  13. package/esm/typings/src/pipeline/book-notation.d.ts +2 -3
  14. package/esm/typings/src/pipeline/prompt-notation.d.ts +5 -18
  15. package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +1 -1
  16. package/esm/typings/src/remote-server/socket-types/_subtypes/PromptbookServer_Identification.d.ts +2 -5
  17. package/esm/typings/src/wizzard/wizzard.d.ts +1 -7
  18. package/package.json +16 -9
  19. package/umd/index.umd.js +8 -58
  20. package/umd/index.umd.js.map +1 -1
  21. package/esm/typings/src/_packages/deepseek.index.d.ts +0 -8
  22. package/esm/typings/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +0 -9
  23. package/esm/typings/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -14
  24. package/esm/typings/src/llm-providers/deepseek/register-configuration.d.ts +0 -14
  25. package/esm/typings/src/llm-providers/deepseek/register-constructor.d.ts +0 -15
  26. package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.test.d.ts +0 -1
  27. package/esm/typings/src/utils/editable/utils/isFlatPipeline.test.d.ts +0 -1
  28. package/esm/typings/src/utils/files/mimeTypeToExtension.d.ts +0 -10
  29. 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
 
@@ -264,9 +263,8 @@ Or you can install them separately:
264
263
  - **[@promptbook/anthropic-claude](https://www.npmjs.com/package/@promptbook/anthropic-claude)** - Execution tools for Anthropic Claude API, wrapper around Anthropic Claude SDK
265
264
  - **[@promptbook/vercel](https://www.npmjs.com/package/@promptbook/vercel)** - Adapter for Vercel functionalities
266
265
  - **[@promptbook/google](https://www.npmjs.com/package/@promptbook/google)** - Integration with Google's Gemini API
267
- - **[@promptbook/deepseek](https://www.npmjs.com/package/@promptbook/deepseek)** - Integration with [DeepSeek API](https://www.deepseek.com/)
268
266
  - **[@promptbook/azure-openai](https://www.npmjs.com/package/@promptbook/azure-openai)** - Execution tools for Azure OpenAI API
269
-
267
+ - **[@promptbook/langtail](https://www.npmjs.com/package/@promptbook/langtail)** - Execution tools for Langtail API, wrapper around Langtail SDK
270
268
  - **[@promptbook/fake-llm](https://www.npmjs.com/package/@promptbook/fake-llm)** - Mocked execution tools for testing the library and saving the tokens
271
269
  - **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
272
270
  - **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
@@ -436,10 +434,6 @@ See [TODO.md](./TODO.md)
436
434
 
437
435
 
438
436
 
439
- ## 🤝 Partners
440
-
441
- [![Technology Incubation](./other/partners/CI-Technology-Incubation.png)](https://technologickainkubace.org/en/about-technology-incubation/about-the-project/)
442
-
443
437
  ## 🖋️ Contributing
444
438
 
445
439
  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
@@ -19,7 +19,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
19
19
  * @generated
20
20
  * @see https://github.com/webgptorg/promptbook
21
21
  */
22
- var PROMPTBOOK_ENGINE_VERSION = '0.84.0-19';
22
+ var PROMPTBOOK_ENGINE_VERSION = '0.84.0-8';
23
23
  /**
24
24
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
25
25
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -430,12 +430,6 @@ var DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
430
430
  * @public exported from `@promptbook/core`
431
431
  */
432
432
  var DEFAULT_TASK_TITLE = "Task";
433
- /**
434
- * When the pipeline is flat and no name of return parameter is provided, this name is used
435
- *
436
- * @public exported from `@promptbook/core`
437
- */
438
- var DEFAULT_BOOK_OUTPUT_PARAMETER_NAME = 'result';
439
433
  /**
440
434
  * Timeout for the connections in milliseconds
441
435
  *
@@ -651,7 +645,7 @@ function preparePipelineOnRemoteServer(pipeline, options) {
651
645
  });
652
646
  }
653
647
  /**
654
- * TODO: [🐚] Do not return Promise<PipelineJson> But PreparePipelineTask
648
+ * TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
655
649
  */
656
650
 
657
651
  /**
@@ -4514,21 +4508,6 @@ var HIGH_LEVEL_ABSTRACTIONS = [
4514
4508
  * Note: [💞] Ignore a discrepancy between file name and entity name
4515
4509
  */
4516
4510
 
4517
- /**
4518
- * Checks if value is valid email
4519
- *
4520
- * @public exported from `@promptbook/utils`
4521
- */
4522
- function isValidEmail(email) {
4523
- if (typeof email !== 'string') {
4524
- return false;
4525
- }
4526
- if (email.split('\n').length > 1) {
4527
- return false;
4528
- }
4529
- return /^.+@.+\..+$/.test(email);
4530
- }
4531
-
4532
4511
  /**
4533
4512
  * Function `validatePipelineString` will validate the if the string is a valid pipeline string
4534
4513
  * 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.
@@ -4542,15 +4521,6 @@ function validatePipelineString(pipelineString) {
4542
4521
  if (isValidJsonString(pipelineString)) {
4543
4522
  throw new ParseError('Expected a book, but got a JSON string');
4544
4523
  }
4545
- else if (isValidUrl(pipelineString)) {
4546
- throw new ParseError("Expected a book, but got just the URL \"".concat(pipelineString, "\""));
4547
- }
4548
- else if (isValidFilePath(pipelineString)) {
4549
- throw new ParseError("Expected a book, but got just the file path \"".concat(pipelineString, "\""));
4550
- }
4551
- else if (isValidEmail(pipelineString)) {
4552
- throw new ParseError("Expected a book, but got just the email \"".concat(pipelineString, "\""));
4553
- }
4554
4524
  // <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
4555
4525
  return pipelineString;
4556
4526
  }
@@ -4586,15 +4556,12 @@ function isFlatPipeline(pipelineString) {
4586
4556
  pipelineString = removeMarkdownComments(pipelineString);
4587
4557
  pipelineString = spaceTrim$1(pipelineString);
4588
4558
  var isMarkdownBeginningWithHeadline = pipelineString.startsWith('# ');
4589
- //const isLastLineReturnStatement = pipelineString.split('\n').pop()!.split('`').join('').startsWith('->');
4590
- var isBacktickBlockUsed = pipelineString.includes('```');
4591
- var isQuoteBlocksUsed = /^>\s+/m.test(pipelineString);
4592
- var isBlocksUsed = isBacktickBlockUsed || isQuoteBlocksUsed;
4593
- // TODO: [🧉] Also (double)check
4559
+ var isLastLineReturnStatement = pipelineString.split('\n').pop().split('`').join('').startsWith('->');
4560
+ // TODO: Also (double)check
4594
4561
  // > const usedCommands
4595
4562
  // > const isBlocksUsed
4596
4563
  // > const returnStatementCount
4597
- var isFlat = !isMarkdownBeginningWithHeadline && !isBlocksUsed; /* && isLastLineReturnStatement */
4564
+ var isFlat = !isMarkdownBeginningWithHeadline && isLastLineReturnStatement;
4598
4565
  return isFlat;
4599
4566
  }
4600
4567
 
@@ -4608,26 +4575,9 @@ function deflatePipeline(pipelineString) {
4608
4575
  return pipelineString;
4609
4576
  }
4610
4577
  var pipelineStringLines = pipelineString.split('\n');
4611
- var potentialReturnStatement = pipelineStringLines.pop();
4612
- var returnStatement;
4613
- if (/(-|=)>\s*\{.*\}/.test(potentialReturnStatement)) {
4614
- // Note: Last line is return statement
4615
- returnStatement = potentialReturnStatement;
4616
- }
4617
- else {
4618
- // Note: Last line is not a return statement
4619
- returnStatement = "-> {".concat(DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, "}");
4620
- pipelineStringLines.push(potentialReturnStatement);
4621
- }
4578
+ var returnStatement = pipelineStringLines.pop();
4622
4579
  var prompt = spaceTrim$1(pipelineStringLines.join('\n'));
4623
- var quotedPrompt;
4624
- if (prompt.split('\n').length <= 1) {
4625
- quotedPrompt = "> ".concat(prompt);
4626
- }
4627
- else {
4628
- quotedPrompt = spaceTrim$1(function (block) { return "\n ```\n ".concat(block(prompt.split('`').join('\\`')), "\n ```\n "); });
4629
- }
4630
- pipelineString = validatePipelineString(spaceTrim$1(function (block) { return "\n # ".concat(DEFAULT_BOOK_TITLE, "\n\n ## Prompt\n\n ").concat(block(quotedPrompt), "\n\n ").concat(returnStatement, "\n "); }));
4580
+ pipelineString = validatePipelineString(spaceTrim$1(function (block) { return "\n # ".concat(DEFAULT_BOOK_TITLE, "\n\n ## Prompt\n\n ```\n ").concat(block(prompt), "\n ```\n\n ").concat(returnStatement, "\n "); }));
4631
4581
  // <- TODO: Maybe use book` notation
4632
4582
  return pipelineString;
4633
4583
  }
@@ -5633,7 +5583,7 @@ function compilePipelineOnRemoteServer(pipelineString, options) {
5633
5583
  });
5634
5584
  }
5635
5585
  /**
5636
- * TODO: [🐚] Do not return Promise<PipelineJson> But PreparePipelineTask
5586
+ * TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
5637
5587
  */
5638
5588
 
5639
5589
  /**