@promptbook/remote-client 0.103.0-2 → 0.103.0-21

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 (69) hide show
  1. package/README.md +6 -207
  2. package/esm/index.es.js +61 -4
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/browser.index.d.ts +6 -0
  5. package/esm/typings/src/_packages/components.index.d.ts +4 -4
  6. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  7. package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +16 -0
  8. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +5 -0
  9. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileTooltip.d.ts +15 -0
  10. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +66 -8
  11. package/esm/typings/src/book-components/BookEditor/BookEditorActionbar.d.ts +11 -0
  12. package/esm/typings/src/book-components/BookEditor/BookEditorMonaco.d.ts +5 -0
  13. package/esm/typings/src/book-components/BookEditor/config.d.ts +1 -0
  14. package/esm/typings/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +12 -0
  15. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +5 -0
  16. package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +15 -0
  17. package/esm/typings/src/book-components/_common/Modal/Modal.d.ts +13 -0
  18. package/esm/typings/src/book-components/_common/react-utils/classNames.d.ts +1 -1
  19. package/esm/typings/src/book-components/icons/AboutIcon.d.ts +9 -0
  20. package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +9 -0
  21. package/esm/typings/src/book-components/icons/MenuIcon.d.ts +12 -0
  22. package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +2 -1
  23. package/esm/typings/src/cli/cli-commands/about.d.ts +2 -1
  24. package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -1
  25. package/esm/typings/src/cli/cli-commands/list-models.d.ts +2 -1
  26. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +2 -1
  27. package/esm/typings/src/cli/cli-commands/login.d.ts +2 -1
  28. package/esm/typings/src/cli/cli-commands/make.d.ts +2 -1
  29. package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
  30. package/esm/typings/src/cli/cli-commands/run.d.ts +2 -1
  31. package/esm/typings/src/cli/cli-commands/start-server.d.ts +2 -1
  32. package/esm/typings/src/cli/cli-commands/test-command.d.ts +2 -1
  33. package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +2 -1
  34. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -5
  35. package/esm/typings/src/config.d.ts +14 -1
  36. package/esm/typings/src/execution/utils/usage-constants.d.ts +4 -124
  37. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +2 -1
  38. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +2 -1
  39. package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -12
  40. package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -9
  41. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -12
  42. package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -9
  43. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -12
  44. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -9
  45. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -12
  46. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -9
  47. package/esm/typings/src/scrapers/markitdown/createMarkitdownScraper.d.ts +1 -12
  48. package/esm/typings/src/scrapers/markitdown/register-metadata.d.ts +1 -9
  49. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -12
  50. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -9
  51. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -12
  52. package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -9
  53. package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +2 -1
  54. package/esm/typings/src/types/typeAliases.d.ts +1 -1
  55. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -1
  56. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +2 -1
  57. package/esm/typings/src/utils/files/$induceBookDownload.d.ts +13 -0
  58. package/esm/typings/src/utils/files/$induceFileDownload.d.ts +13 -0
  59. package/esm/typings/src/utils/files/ObjectUrl.d.ts +46 -0
  60. package/esm/typings/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +1 -0
  61. package/esm/typings/src/utils/organization/$side_effect.d.ts +7 -0
  62. package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +2 -1
  63. package/esm/typings/src/version.d.ts +1 -1
  64. package/package.json +2 -2
  65. package/umd/index.umd.js +61 -4
  66. package/umd/index.umd.js.map +1 -1
  67. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +0 -5
  68. package/esm/typings/src/book-components/Chat/utils/renderMarkdown.d.ts +0 -21
  69. package/esm/typings/src/book-components/Chat/utils/renderMarkdown.test.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-client",
3
- "version": "0.103.0-2",
3
+ "version": "0.103.0-21",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -100,7 +100,7 @@
100
100
  "module": "./esm/index.es.js",
101
101
  "typings": "./esm/typings/src/_packages/remote-client.index.d.ts",
102
102
  "peerDependencies": {
103
- "@promptbook/core": "0.103.0-2"
103
+ "@promptbook/core": "0.103.0-21"
104
104
  },
105
105
  "dependencies": {
106
106
  "crypto": "1.0.1",
package/umd/index.umd.js CHANGED
@@ -23,7 +23,7 @@
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-2';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-21';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1221,15 +1221,30 @@
1221
1221
  * @public exported from `@promptbook/core`
1222
1222
  */
1223
1223
  const PROMPTBOOK_COLOR = Color.fromHex('#79EAFD');
1224
- // <- TODO: [🧠] Using `Color` here increases the package size approx 3kb, maybe remove it
1224
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
1225
1225
  /**
1226
- * Dark color of the Promptbook
1226
+ * Colors for syntax highlighting in the `<BookEditor/>`
1227
+ *
1228
+ * TODO: [🗽] Unite branding and make single place for it
1229
+ *
1230
+ * @public exported from `@promptbook/core`
1231
+ */
1232
+ ({
1233
+ TITLE: Color.fromHex('#244EA8'),
1234
+ LINE: Color.fromHex('#eeeeee'),
1235
+ COMMITMENT: Color.fromHex('#DA0F78'),
1236
+ PARAMETER: Color.fromHex('#8e44ad'),
1237
+ });
1238
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
1239
+ /**
1240
+ * Chat color of the Promptbook (in chat)
1227
1241
  *
1228
1242
  * TODO: [🗽] Unite branding and make single place for it
1229
1243
  *
1230
1244
  * @public exported from `@promptbook/core`
1231
1245
  */
1232
1246
  PROMPTBOOK_COLOR.then(lighten(0.1)).then(saturate(0.9)).then(grayscale(0.9));
1247
+ // <- TODO: [🧠][🈵] Using `Color` and `lighten`, `saturate`,... here increases the package size approx 3kb, maybe remove it
1233
1248
  /**
1234
1249
  * Color of the user (in chat)
1235
1250
  *
@@ -1238,6 +1253,7 @@
1238
1253
  * @public exported from `@promptbook/core`
1239
1254
  */
1240
1255
  Color.fromHex('#1D4ED8');
1256
+ // <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
1241
1257
  /**
1242
1258
  * When the title is not provided, the default title is used
1243
1259
  *
@@ -5563,6 +5579,46 @@
5563
5579
  const SUPPORTED_SCRIPT_LANGUAGES = ['javascript', 'typescript', 'python'];
5564
5580
  // <- TODO: [🏥] DRY
5565
5581
 
5582
+ /**
5583
+ * Number of padding lines to add at the end of the book content
5584
+ *
5585
+ * @public exported from `@promptbook/core`
5586
+ */
5587
+ const PADDING_LINES = 11;
5588
+ /**
5589
+ * A function that adds padding to the book content
5590
+ *
5591
+ * @public exported from `@promptbook/core`
5592
+ */
5593
+ function padBook(content) {
5594
+ if (!content) {
5595
+ return '\n'.repeat(PADDING_LINES);
5596
+ }
5597
+ const lines = content.split('\n');
5598
+ let trailingEmptyLines = 0;
5599
+ for (let i = lines.length - 1; i >= 0; i--) {
5600
+ const line = lines[i];
5601
+ if (line === undefined) {
5602
+ // Note: This should not happen in reality, but it's here to satisfy TypeScript's noUncheckedIndexedAccess option
5603
+ continue;
5604
+ }
5605
+ if (line.trim() === '') {
5606
+ trailingEmptyLines++;
5607
+ }
5608
+ else {
5609
+ break;
5610
+ }
5611
+ }
5612
+ if (trailingEmptyLines >= PADDING_LINES) {
5613
+ return content;
5614
+ }
5615
+ const linesToAdd = PADDING_LINES - trailingEmptyLines;
5616
+ return (content + '\n'.repeat(linesToAdd));
5617
+ }
5618
+ /**
5619
+ * TODO: [🧠] Maybe export
5620
+ */
5621
+
5566
5622
  /**
5567
5623
  * Removes Markdown (or HTML) comments
5568
5624
  *
@@ -5608,6 +5664,7 @@
5608
5664
  if (!isFlatPipeline(pipelineString)) {
5609
5665
  return pipelineString;
5610
5666
  }
5667
+ pipelineString = spaceTrim__default["default"](pipelineString);
5611
5668
  const pipelineStringLines = pipelineString.split('\n');
5612
5669
  const potentialReturnStatement = pipelineStringLines.pop();
5613
5670
  let returnStatement;
@@ -5642,7 +5699,7 @@
5642
5699
  ${returnStatement}
5643
5700
  `));
5644
5701
  // <- TODO: Maybe use book` notation
5645
- return pipelineString;
5702
+ return padBook(pipelineString);
5646
5703
  }
5647
5704
  /**
5648
5705
  * TODO: Unit test