@promptbook/remote-server 0.81.0-9 → 0.82.0-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 (108) hide show
  1. package/README.md +25 -4
  2. package/esm/index.es.js +6 -6
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/books/index.d.ts +38 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +12 -4
  6. package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -2
  7. package/esm/typings/src/_packages/node.index.d.ts +0 -2
  8. package/esm/typings/src/_packages/remote-client.index.d.ts +7 -3
  9. package/esm/typings/src/_packages/remote-server.index.d.ts +2 -2
  10. package/esm/typings/src/_packages/templates.index.d.ts +2 -2
  11. package/esm/typings/src/_packages/types.index.d.ts +32 -30
  12. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  13. package/esm/typings/src/_packages/wizzard.index.d.ts +44 -0
  14. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  15. package/esm/typings/src/cli/cli-commands/run.d.ts +2 -2
  16. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +11 -0
  17. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
  18. package/esm/typings/src/commands/index.d.ts +1 -1
  19. package/esm/typings/src/config.d.ts +3 -3
  20. package/esm/typings/src/conversion/compilePipeline.d.ts +1 -4
  21. package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +18 -0
  22. package/esm/typings/src/conversion/{precompilePipeline.d.ts → parsePipeline.d.ts} +3 -3
  23. package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -3
  24. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +7 -7
  25. package/esm/typings/src/errors/utils/getErrorReportUrl.d.ts +1 -1
  26. package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +9 -4
  27. package/esm/typings/src/formfactors/image-generator/ImageGeneratorFormfactorDefinition.d.ts +24 -0
  28. package/esm/typings/src/formfactors/index.d.ts +31 -9
  29. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
  30. package/esm/typings/src/high-level-abstractions/index.d.ts +3 -3
  31. package/esm/typings/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +3 -0
  32. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  33. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +1 -1
  34. package/esm/typings/src/llm-providers/_common/register/{$provideLlmToolsForCli.d.ts → $provideLlmToolsForWizzardOrCli.d.ts} +2 -2
  35. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
  36. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
  37. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  38. package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
  39. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -2
  40. package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +1 -0
  41. package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +2 -0
  42. package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +1 -0
  43. package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +1 -0
  44. package/esm/typings/src/llm-providers/google/register-configuration.d.ts +1 -0
  45. package/esm/typings/src/llm-providers/google/register-constructor.d.ts +1 -0
  46. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +1 -1
  47. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -0
  48. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -0
  49. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
  50. package/esm/typings/src/llm-providers/vercel/playground/playground.d.ts +1 -1
  51. package/esm/typings/src/other/templates/getBookTemplates.d.ts +22 -0
  52. package/esm/typings/src/personas/preparePersona.d.ts +4 -4
  53. package/esm/typings/src/pipeline/PipelineString.d.ts +0 -3
  54. package/esm/typings/src/pipeline/book-notation.d.ts +14 -0
  55. package/esm/typings/src/pipeline/isValidPipelineString.d.ts +13 -0
  56. package/esm/typings/src/pipeline/isValidPipelineString.test.d.ts +4 -0
  57. package/esm/typings/src/pipeline/validatePipelineString.d.ts +14 -0
  58. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +3 -1
  59. package/esm/typings/src/prepare/preparePipeline.d.ts +4 -2
  60. package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +14 -0
  61. package/esm/typings/src/prepare/prepareTasks.d.ts +1 -1
  62. package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_Error.d.ts +1 -1
  63. package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_ListModels_Request.d.ts +4 -4
  64. package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_ListModels_Response.d.ts +1 -1
  65. package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_Prompt_Progress.d.ts +1 -1
  66. package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_Prompt_Request.d.ts +5 -5
  67. package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_Prompt_Response.d.ts +1 -1
  68. package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/RemoteLlmExecutionToolsOptions.d.ts +7 -7
  69. package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/RemoteServerOptions.d.ts +10 -10
  70. package/esm/typings/src/scrapers/_common/Converter.d.ts +1 -0
  71. package/esm/typings/src/scrapers/_common/Scraper.d.ts +1 -1
  72. package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +3 -0
  73. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +2 -0
  74. package/esm/typings/src/scrapers/_common/utils/scraperFetch.d.ts +3 -0
  75. package/esm/typings/src/scrapers/document/register-constructor.d.ts +1 -0
  76. package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -0
  77. package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +1 -0
  78. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -0
  79. package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +1 -0
  80. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -0
  81. package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +1 -0
  82. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -1
  83. package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +1 -0
  84. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +2 -1
  85. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -1
  86. package/esm/typings/src/scrapers/website/register-constructor.d.ts +1 -0
  87. package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -0
  88. package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +1 -1
  89. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +2 -1
  90. package/esm/typings/src/types/typeAliases.d.ts +8 -2
  91. package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +1 -1
  92. package/esm/typings/src/utils/markdown/{removeContentComments.d.ts → removeMarkdownComments.d.ts} +2 -2
  93. package/esm/typings/src/utils/organization/$sideEffect.d.ts +9 -0
  94. package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
  95. package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +2 -2
  96. package/esm/typings/src/utils/validators/filePath/isRootPath.d.ts +12 -0
  97. package/esm/typings/src/utils/validators/filePath/isRootPath.test.d.ts +4 -0
  98. package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +3 -0
  99. package/esm/typings/src/wizzard/$getCompiledBook.d.ts +16 -0
  100. package/esm/typings/src/wizzard/wizzard.d.ts +51 -7
  101. package/package.json +2 -2
  102. package/umd/index.umd.js +6 -6
  103. package/umd/index.umd.js.map +1 -1
  104. package/esm/typings/src/other/templates/getBookTemplate.d.ts +0 -21
  105. package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +0 -8
  106. /package/esm/typings/src/conversion/{precompilePipeline.test.d.ts → parsePipeline.test.d.ts} +0 -0
  107. /package/esm/typings/src/{llm-providers/remote → remote-server}/startRemoteServer.d.ts +0 -0
  108. /package/esm/typings/src/utils/markdown/{removeContentComments.test.d.ts → removeMarkdownComments.test.d.ts} +0 -0
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
6
  *
7
7
  * @public exported from `@promptbook/core`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _AnthropicClaudeMetadataRegistration: Registration;
@@ -5,7 +5,9 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
6
  *
7
7
  * @public exported from `@promptbook/anthropic-claude`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
10
+ *
9
11
  */
10
12
  export declare const _AnthropicClaudeRegistration: Registration;
11
13
  /**
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
6
  *
7
7
  * @public exported from `@promptbook/core`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _AzureOpenAiMetadataRegistration: Registration;
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
6
  *
7
7
  * @public exported from `@promptbook/azure-openai`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _AzureOpenAiRegistration: Registration;
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
6
  *
7
7
  * @public exported from `@promptbook/core`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _GoogleMetadataRegistration: Registration;
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
6
  *
7
7
  * @public exported from `@promptbook/google`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _GoogleRegistration: Registration;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ts-node
2
2
  export {};
3
3
  /**
4
- * TODO: [main] !!! Test here that `systemMessage`, `temperature` and `seed` are working correctly
4
+ * TODO: [main] !!3 Test here that `systemMessage`, `temperature` and `seed` are working correctly
5
5
  * Note: [⚫] Code in this file should never be published in any package
6
6
  */
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
6
  *
7
7
  * @public exported from `@promptbook/core`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _OpenAiMetadataRegistration: Registration;
@@ -14,6 +15,7 @@ export declare const _OpenAiMetadataRegistration: Registration;
14
15
  * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
15
16
  *
16
17
  * @public exported from `@promptbook/core`
18
+ * @public exported from `@promptbook/wizzard`
17
19
  * @public exported from `@promptbook/cli`
18
20
  */
19
21
  export declare const _OpenAiAssistantMetadataRegistration: Registration;
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
6
  *
7
7
  * @public exported from `@promptbook/openai`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _OpenAiRegistration: Registration;
@@ -14,6 +15,7 @@ export declare const _OpenAiRegistration: Registration;
14
15
  * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
15
16
  *
16
17
  * @public exported from `@promptbook/openai`
18
+ * @public exported from `@promptbook/wizzard`
17
19
  * @public exported from `@promptbook/cli`
18
20
  */
19
21
  export declare const _OpenAiAssistantRegistration: Registration;
@@ -9,7 +9,7 @@ import type { EmbeddingPrompt } from '../../types/Prompt';
9
9
  import type { string_markdown } from '../../types/typeAliases';
10
10
  import type { string_markdown_text } from '../../types/typeAliases';
11
11
  import type { string_title } from '../../types/typeAliases';
12
- import type { RemoteLlmExecutionToolsOptions } from './interfaces/RemoteLlmExecutionToolsOptions';
12
+ import type { RemoteLlmExecutionToolsOptions } from '../../remote-server/interfaces/RemoteLlmExecutionToolsOptions';
13
13
  /**
14
14
  * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
15
15
  *
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ts-node
2
2
  export {};
3
3
  /**
4
- * TODO: [main] !!! Test here that `systemMessage`, `temperature` and `seed` are working correctly
4
+ * TODO: [main] !!3 Test here that `systemMessage`, `temperature` and `seed` are working correctly
5
5
  * Note: [⚫] Code in this file should never be published in any package
6
6
  */
@@ -0,0 +1,22 @@
1
+ import type { string_formfactor_name } from '../../formfactors/_common/string_formfactor_name';
2
+ import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
3
+ /**
4
+ * @@@
5
+ *
6
+ * @singleton
7
+ * @private internal cache of `getBookTemplate`
8
+ */
9
+ export declare let pipelines: Array<PipelineJson> | null;
10
+ /**
11
+ * Get template for new book
12
+ *
13
+ * @param formfactorName - optional filter for FORMFACTOR - get only pipelines for this formfactor
14
+ * @returns list of pipelines
15
+ * @public exported from `@promptbook/templates`
16
+ */
17
+ export declare function getBookTemplates(formfactorName?: string_formfactor_name): ReadonlyArray<PipelineJson>;
18
+ /**
19
+ * TODO: Unit test
20
+ * TODO: [🧠] Which is the best place for this function
21
+ * TODO: !!6 For GENERIC template ensure at least one pipeline is present for typescript in `getBookTemplates`
22
+ */
@@ -10,8 +10,8 @@ import type { string_persona_description } from '../types/typeAliases';
10
10
  */
11
11
  export declare function preparePersona(personaDescription: string_persona_description, tools: Pick<ExecutionTools, 'llm'>, options: PrepareAndScrapeOptions): Promise<PersonaPreparedJson['modelRequirements']>;
12
12
  /**
13
- * TODO: [🔃][main] !! If the persona was prepared with different version or different set of models, prepare it once again
14
- * TODO: [🏢] !! Check validity of `modelName` in pipeline
15
- * TODO: [🏢] !! Check validity of `systemMessage` in pipeline
16
- * TODO: [🏢] !! Check validity of `temperature` in pipeline
13
+ * TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
14
+ * TODO: [🏢] Check validity of `modelName` in pipeline
15
+ * TODO: [🏢] Check validity of `systemMessage` in pipeline
16
+ * TODO: [🏢] Check validity of `temperature` in pipeline
17
17
  */
@@ -7,6 +7,3 @@
7
7
  export type PipelineString = string & {
8
8
  readonly _type: 'Promptbook';
9
9
  };
10
- /**
11
- * TODO: [💩] Better validation (validatePipelineString) or remove branded type and make it just string
12
- */
@@ -0,0 +1,14 @@
1
+ import type { PipelineString } from './PipelineString';
2
+ /**
3
+ * Tag function for notating a pipeline with a book\`...\ notation as template literal
4
+ *
5
+ * @param strings @@@
6
+ * @param values @@@
7
+ * @returns the pipeline string
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare function book(strings: TemplateStringsArray, ...values: Array<string>): PipelineString;
11
+ /**
12
+ * TODO: [🧠][🈴] Where is the best location for this file
13
+ * Note: [💞] Ignore a discrepancy between file name and entity name
14
+ */
@@ -0,0 +1,13 @@
1
+ import type { PipelineString } from './PipelineString';
2
+ /**
3
+ * Function `isValidPipelineString` will validate the if the string is a valid pipeline string
4
+ * 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.
5
+ *
6
+ * @param {string} pipelineString the candidate for a pipeline string
7
+ * @returns {boolean} if the string is a valid pipeline string
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare function isValidPipelineString(pipelineString: string): pipelineString is PipelineString;
11
+ /**
12
+ * TODO: [🧠][🈴] Where is the best location for this file
13
+ */
@@ -0,0 +1,4 @@
1
+ export {};
2
+ /**
3
+ * TODO: [🧠][🈴] Where is the best location for this file
4
+ */
@@ -0,0 +1,14 @@
1
+ import type { PipelineString } from './PipelineString';
2
+ /**
3
+ * Function `validatePipelineString` will validate the if the string is a valid pipeline string
4
+ * 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.
5
+ *
6
+ * @param {string} pipelineString the candidate for a pipeline string
7
+ * @returns {PipelineString} the same string as input, but validated as valid
8
+ * @throws {ParseError} if the string is not a valid pipeline string
9
+ * @public exported from `@promptbook/core`
10
+ */
11
+ export declare function validatePipelineString(pipelineString: string): PipelineString;
12
+ /**
13
+ * TODO: [🧠][🈴] Where is the best location for this file
14
+ */
@@ -2,11 +2,13 @@ import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
2
2
  /**
3
3
  * Determine if the pipeline is fully prepared
4
4
  *
5
+ * @see https://github.com/webgptorg/promptbook/discussions/196
6
+ *
5
7
  * @public exported from `@promptbook/core`
6
8
  */
7
9
  export declare function isPipelinePrepared(pipeline: PipelineJson): boolean;
8
10
  /**
9
- * TODO: [🔃][main] !! If the pipeline was prepared with different version or different set of models, prepare it once again
11
+ * TODO: [🔃][main] If the pipeline was prepared with different version or different set of models, prepare it once again
10
12
  * TODO: [🐠] Maybe base this on `makeValidator`
11
13
  * TODO: [🧊] Pipeline can be partially prepared, this should return true ONLY if fully prepared
12
14
  * TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
@@ -2,7 +2,9 @@ import type { ExecutionTools } from '../execution/ExecutionTools';
2
2
  import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
3
3
  import type { PrepareAndScrapeOptions } from './PrepareAndScrapeOptions';
4
4
  /**
5
- * Prepare pipeline from string (markdown) format to JSON format
5
+ * Prepare pipeline locally
6
+ *
7
+ * @see https://github.com/webgptorg/promptbook/discussions/196
6
8
  *
7
9
  * Note: This function does not validate logic of the pipeline
8
10
  * Note: This function acts as part of compilation process
@@ -11,7 +13,7 @@ import type { PrepareAndScrapeOptions } from './PrepareAndScrapeOptions';
11
13
  */
12
14
  export declare function preparePipeline(pipeline: PipelineJson, tools: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options: PrepareAndScrapeOptions): Promise<PipelineJson>;
13
15
  /**
14
- * TODO: Write tests for `preparePipeline`
16
+ * TODO: Write tests for `preparePipeline` and `preparePipelineOnRemoteServer`
15
17
  * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
16
18
  * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
17
19
  * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
@@ -0,0 +1,14 @@
1
+ import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions';
2
+ import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
3
+ /**
4
+ * Prepare pipeline on remote server
5
+ *
6
+ * @see https://github.com/webgptorg/promptbook/discussions/196
7
+ *
8
+ * Note: This function does not validate logic of the pipeline
9
+ * Note: This function acts as part of compilation process
10
+ * Note: When the pipeline is already prepared, it returns the same pipeline
11
+ *
12
+ * @public exported from `@promptbook/remote-client`
13
+ */
14
+ export declare function preparePipelineOnRemoteServer<TCustomOptions = undefined>(pipeline: PipelineJson, options: RemoteServerOptions<TCustomOptions>): Promise<PipelineJson>;
@@ -25,7 +25,7 @@ export {};
25
25
  * TODO: [😂] Adding knowledge should be convert to async high-level abstractions, simmilar thing with expectations to sync high-level abstractions
26
26
  * TODO: [🧠] Add context to each task (if missing)
27
27
  * TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
28
- * TODO: [♨][main] !!! Prepare index the examples and maybe tasks
28
+ * TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
29
29
  * TODO: Write tests for `preparePipeline`
30
30
  * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
31
31
  * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
@@ -1,4 +1,4 @@
1
- import type { ErrorJson } from '../../../errors/utils/ErrorJson';
1
+ import type { ErrorJson } from '../../errors/utils/ErrorJson';
2
2
  /**
3
3
  * Socket.io error for remote text generation
4
4
  *
@@ -1,13 +1,13 @@
1
- import type { string_user_id } from '../../../types/typeAliases';
2
- import type { LlmToolsConfiguration } from '../../_common/register/LlmToolsConfiguration';
3
- import type { CollectionRemoteServerClientOptions } from './RemoteServerOptions';
1
+ import type { LlmToolsConfiguration } from '../../llm-providers/_common/register/LlmToolsConfiguration';
2
+ import type { string_user_id } from '../../types/typeAliases';
3
+ import type { ApplicationRemoteServerClientOptions } from './RemoteServerOptions';
4
4
  /**
5
5
  * Socket.io progress for remote text generation
6
6
  *
7
7
  * This is a request from client to server
8
8
  */
9
9
  export type PromptbookServer_ListModels_Request<TCustomOptions> = PromptbookServer_ListModels_CollectionRequest<TCustomOptions> | PromptbookServer_ListModels_AnonymousRequest;
10
- export type PromptbookServer_ListModels_CollectionRequest<TCustomOptions> = CollectionRemoteServerClientOptions<TCustomOptions> & {
10
+ export type PromptbookServer_ListModels_CollectionRequest<TCustomOptions> = ApplicationRemoteServerClientOptions<TCustomOptions> & {
11
11
  /**
12
12
  * Application mode
13
13
  */
@@ -1,4 +1,4 @@
1
- import type { AvailableModel } from '../../../execution/AvailableModel';
1
+ import type { AvailableModel } from '../../execution/AvailableModel';
2
2
  /**
3
3
  * Socket.io error for remote text generation
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { TaskProgress } from '../../../types/TaskProgress';
1
+ import type { TaskProgress } from '../../types/TaskProgress';
2
2
  /**
3
3
  * Socket.io progress for remote text generation
4
4
  *
@@ -1,14 +1,14 @@
1
- import type { Prompt } from '../../../types/Prompt';
2
- import type { string_user_id } from '../../../types/typeAliases';
3
- import type { LlmToolsConfiguration } from '../../_common/register/LlmToolsConfiguration';
4
- import type { CollectionRemoteServerClientOptions } from './RemoteServerOptions';
1
+ import type { LlmToolsConfiguration } from '../../llm-providers/_common/register/LlmToolsConfiguration';
2
+ import type { Prompt } from '../../types/Prompt';
3
+ import type { string_user_id } from '../../types/typeAliases';
4
+ import type { ApplicationRemoteServerClientOptions } from './RemoteServerOptions';
5
5
  /**
6
6
  * Socket.io progress for remote text generation
7
7
  *
8
8
  * This is a request from client to server
9
9
  */
10
10
  export type PromptbookServer_Prompt_Request<TCustomOptions> = PromptbookServer_Prompt_CollectionRequest<TCustomOptions> | PromptbookServer_Prompt_AnonymousRequest;
11
- export type PromptbookServer_Prompt_CollectionRequest<TCustomOptions> = CollectionRemoteServerClientOptions<TCustomOptions> & {
11
+ export type PromptbookServer_Prompt_CollectionRequest<TCustomOptions> = ApplicationRemoteServerClientOptions<TCustomOptions> & {
12
12
  /**
13
13
  * Application mode
14
14
  */
@@ -1,4 +1,4 @@
1
- import type { PromptResult } from '../../../execution/PromptResult';
1
+ import type { PromptResult } from '../../execution/PromptResult';
2
2
  /**
3
3
  * Socket.io error for remote text generation
4
4
  *
@@ -1,9 +1,9 @@
1
- import type { CommonToolsOptions } from '../../../execution/CommonToolsOptions';
2
- import type { string_base_url } from '../../../types/typeAliases';
3
- import type { string_uri } from '../../../types/typeAliases';
4
- import type { string_user_id } from '../../../types/typeAliases';
5
- import type { LlmToolsConfiguration } from '../../_common/register/LlmToolsConfiguration';
6
- import type { CollectionRemoteServerClientOptions } from './RemoteServerOptions';
1
+ import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
2
+ import type { LlmToolsConfiguration } from '../../llm-providers/_common/register/LlmToolsConfiguration';
3
+ import type { string_base_url } from '../../types/typeAliases';
4
+ import type { string_uri } from '../../types/typeAliases';
5
+ import type { string_user_id } from '../../types/typeAliases';
6
+ import type { ApplicationRemoteServerClientOptions } from './RemoteServerOptions';
7
7
  /**
8
8
  * Options for `RemoteLlmExecutionTools`
9
9
  *
@@ -47,7 +47,7 @@ export type RemoteLlmExecutionToolsOptions<TCustomOptions> = CommonToolsOptions
47
47
  * Use anonymous server with client identification and fixed collection
48
48
  */
49
49
  readonly isAnonymous: false;
50
- } & CollectionRemoteServerClientOptions<TCustomOptions>));
50
+ } & ApplicationRemoteServerClientOptions<TCustomOptions>));
51
51
  /**
52
52
  * TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
53
53
  * TODO: [🧠][🧜‍♂️] Maybe join remoteUrl and path into single value
@@ -1,10 +1,10 @@
1
1
  import type { Promisable } from 'type-fest';
2
- import type { PipelineCollection } from '../../../collection/PipelineCollection';
3
- import type { CommonToolsOptions } from '../../../execution/CommonToolsOptions';
4
- import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
5
- import type { string_app_id } from '../../../types/typeAliases';
6
- import type { string_uri } from '../../../types/typeAliases';
7
- import type { string_user_id } from '../../../types/typeAliases';
2
+ import type { PipelineCollection } from '../../collection/PipelineCollection';
3
+ import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
4
+ import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
5
+ import type { string_app_id } from '../../types/typeAliases';
6
+ import type { string_uri } from '../../types/typeAliases';
7
+ import type { string_user_id } from '../../types/typeAliases';
8
8
  /**
9
9
  * @@@
10
10
  *
@@ -31,14 +31,14 @@ export type RemoteServerOptions<TCustomOptions> = CommonToolsOptions & {
31
31
  * @example '/promptbook/socket.io'
32
32
  */
33
33
  readonly path: string_uri;
34
- } & (AnonymousRemoteServerOptions | CollectionRemoteServerOptions<TCustomOptions> | (AnonymousRemoteServerOptions & CollectionRemoteServerOptions<TCustomOptions>));
34
+ } & (AnonymousRemoteServerOptions | ApplicationRemoteServerOptions<TCustomOptions> | (AnonymousRemoteServerOptions & ApplicationRemoteServerOptions<TCustomOptions>));
35
35
  export type AnonymousRemoteServerOptions = {
36
36
  /**
37
37
  * Enable anonymous mode
38
38
  */
39
39
  readonly isAnonymousModeAllowed: true;
40
40
  };
41
- export type CollectionRemoteServerOptions<TCustomOptions> = {
41
+ export type ApplicationRemoteServerOptions<TCustomOptions> = {
42
42
  /**
43
43
  * Enable application mode
44
44
  */
@@ -52,9 +52,9 @@ export type CollectionRemoteServerOptions<TCustomOptions> = {
52
52
  /**
53
53
  * Creates llm execution tools for each client
54
54
  */
55
- createLlmExecutionTools(options: CollectionRemoteServerClientOptions<TCustomOptions>): Promisable<LlmExecutionTools>;
55
+ createLlmExecutionTools(options: ApplicationRemoteServerClientOptions<TCustomOptions>): Promisable<LlmExecutionTools>;
56
56
  };
57
- export type CollectionRemoteServerClientOptions<TCustomOptions> = {
57
+ export type ApplicationRemoteServerClientOptions<TCustomOptions> = {
58
58
  /**
59
59
  * @@@
60
60
  */
@@ -4,6 +4,7 @@ import type { ScraperIntermediateSource } from './ScraperIntermediateSource';
4
4
  /**
5
5
  * @@@
6
6
  *
7
+ * Note: [🌏] Converters are not usable in browser because they produce a files
7
8
  */
8
9
  export type Converter = {
9
10
  /**
@@ -7,7 +7,6 @@ import type { string_url } from '../../types/typeAliases';
7
7
  import type { ScraperAndConverterMetadata } from './register/ScraperAndConverterMetadata';
8
8
  /**
9
9
  * @@@
10
- *
11
10
  */
12
11
  export type Scraper = {
13
12
  /**
@@ -53,6 +52,7 @@ export type ScraperSourceHandler = {
53
52
  asText(): Promisable<string>;
54
53
  };
55
54
  /**
55
+ * TODO: [🧠] Maybe split `ScraperSourceHandler` into `ScraperWebsiteSourceHandler` + `ScraperFileSourceHandler`
56
56
  * TODO: [🥽] Add ` asBlob(): Promisable<Blob>;` or asFile
57
57
  * TODO: [🐝] @@@ Annotate all
58
58
  * TODO: [🔼] Export via types
@@ -9,3 +9,6 @@ export type ScraperIntermediateSource = IDestroyable & {
9
9
  */
10
10
  readonly filename: string_absolute_filename;
11
11
  };
12
+ /**
13
+ * Note: [🌏] Converters can be used only in node because they uses `ScraperIntermediateSource` which uses file system
14
+ */
@@ -28,6 +28,8 @@ export type ScraperAndConverterMetadata = Registered & {
28
28
  readonly mimeTypes: ReadonlyArray<string_mime_type>;
29
29
  /**
30
30
  * @@@
31
+ *
32
+ * Note: [🌏] Only `MarkdownScraper` makes sense to be available in the browser, for scraping non-markdown sources in the browser use a remote server
31
33
  */
32
34
  readonly isAvilableInBrowser: boolean;
33
35
  /**
@@ -5,3 +5,6 @@ import type { PromptbookFetch } from '../../../execution/PromptbookFetch';
5
5
  * @private as default `fetch` function used in Promptbook scrapers
6
6
  */
7
7
  export declare const scraperFetch: PromptbookFetch;
8
+ /**
9
+ * TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
10
+ */
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
6
6
  *
7
7
  * @public exported from `@promptbook/documents`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _DocumentScraperRegistration: Registration;
@@ -19,6 +19,7 @@ export declare const documentScraperMetadata: import("type-fest/source/readonly-
19
19
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
20
20
  *
21
21
  * @public exported from `@promptbook/core`
22
+ * @public exported from `@promptbook/wizzard`
22
23
  * @public exported from `@promptbook/cli`
23
24
  */
24
25
  export declare const _DocumentScraperMetadataRegistration: Registration;
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
6
6
  *
7
7
  * @public exported from `@promptbook/legacy-documents`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _LegacyDocumentScraperRegistration: Registration;
@@ -19,6 +19,7 @@ export declare const legacyDocumentScraperMetadata: import("type-fest/source/rea
19
19
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
20
20
  *
21
21
  * @public exported from `@promptbook/core`
22
+ * @public exported from `@promptbook/wizzard`
22
23
  * @public exported from `@promptbook/cli`
23
24
  */
24
25
  export declare const _LegacyDocumentScraperMetadataRegistration: Registration;
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
6
6
  *
7
7
  * @public exported from `@promptbook/markdown-utils`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _MarkdownScraperRegistration: Registration;
@@ -19,6 +19,7 @@ export declare const markdownScraperMetadata: import("type-fest/source/readonly-
19
19
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
20
20
  *
21
21
  * @public exported from `@promptbook/core`
22
+ * @public exported from `@promptbook/wizzard`
22
23
  * @public exported from `@promptbook/cli`
23
24
  */
24
25
  export declare const _MarkdownScraperMetadataRegistration: Registration;
@@ -37,4 +37,5 @@ export declare class PdfScraper implements Converter, Scraper {
37
37
  * TODO: [👣] Converted pdf documents can act as cached items - there is no need to run conversion each time
38
38
  * TODO: [🪂] Do it in parallel 11:11
39
39
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
40
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
40
41
  */
@@ -12,7 +12,7 @@ export declare const createPdfScraper: ((tools: Pick<ExecutionTools, 'llm'>, opt
12
12
  className: string;
13
13
  mimeTypes: string[];
14
14
  documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
15
- isAvilableInBrowser: true;
15
+ isAvilableInBrowser: false;
16
16
  requiredExecutables: never[];
17
17
  }>;
18
18
  /**
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
6
6
  *
7
7
  * @public exported from `@promptbook/pdf`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _PdfScraperRegistration: Registration;
@@ -10,7 +10,7 @@ export declare const pdfScraperMetadata: import("type-fest/source/readonly-deep"
10
10
  className: string;
11
11
  mimeTypes: string[];
12
12
  documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
13
- isAvilableInBrowser: true;
13
+ isAvilableInBrowser: false;
14
14
  requiredExecutables: never[];
15
15
  }>;
16
16
  /**
@@ -19,6 +19,7 @@ export declare const pdfScraperMetadata: import("type-fest/source/readonly-deep"
19
19
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
20
20
  *
21
21
  * @public exported from `@promptbook/core`
22
+ * @public exported from `@promptbook/wizzard`
22
23
  * @public exported from `@promptbook/cli`
23
24
  */
24
25
  export declare const _PdfScraperMetadataRegistration: Registration;
@@ -12,7 +12,9 @@ export declare const createWebsiteScraper: ((tools: Pick<ExecutionTools, 'llm'>,
12
12
  className: string;
13
13
  mimeTypes: string[];
14
14
  documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
15
- isAvilableInBrowser: false;
15
+ isAvilableInBrowser: false; /**
16
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
17
+ */
16
18
  requiredExecutables: never[];
17
19
  }>;
18
20
  /**
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
5
5
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
6
6
  *
7
7
  * @public exported from `@promptbook/website-crawler`
8
+ * @public exported from `@promptbook/wizzard`
8
9
  * @public exported from `@promptbook/cli`
9
10
  */
10
11
  export declare const _WebsiteScraperRegistration: Registration;
@@ -19,6 +19,7 @@ export declare const websiteScraperMetadata: import("type-fest/source/readonly-d
19
19
  * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
20
20
  *
21
21
  * @public exported from `@promptbook/core`
22
+ * @public exported from `@promptbook/wizzard`
22
23
  * @public exported from `@promptbook/cli`
23
24
  */
24
25
  export declare const _WebsiteScraperMetadataRegistration: Registration;
@@ -1,4 +1,4 @@
1
1
  export {};
2
2
  /**
3
- * TODO: !! Make shared test between JavascriptEvalExecutionTools and JavascriptExecutionTools to test the same functionality when implemented via vm2
3
+ * TODO: Make shared test between JavascriptEvalExecutionTools and JavascriptExecutionTools to test the same functionality when implemented via vm2
4
4
  */