@promptbook/remote-server 0.80.0 → 0.81.0-11

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 (64) hide show
  1. package/README.md +7 -0
  2. package/esm/index.es.js +3 -1
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/books/index.d.ts +15 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +2 -6
  6. package/esm/typings/src/_packages/editable.index.d.ts +10 -0
  7. package/esm/typings/src/_packages/templates.index.d.ts +4 -0
  8. package/esm/typings/src/_packages/types.index.d.ts +6 -0
  9. package/esm/typings/src/_packages/utils.index.d.ts +10 -2
  10. package/esm/typings/src/_packages/wizzard.index.d.ts +44 -0
  11. package/esm/typings/src/config.d.ts +26 -0
  12. package/esm/typings/src/execution/ExecutionTools.d.ts +7 -0
  13. package/esm/typings/src/execution/PipelineExecutor.d.ts +2 -2
  14. package/esm/typings/src/execution/PromptbookFetch.d.ts +5 -0
  15. package/esm/typings/src/execution/PromptbookFetch.test-type.d.ts +5 -0
  16. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +2 -2
  17. package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +2 -1
  18. package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +2 -1
  19. package/esm/typings/src/high-level-abstractions/index.d.ts +10 -0
  20. package/esm/typings/src/llm-providers/_common/register/{$provideLlmToolsForCli.d.ts → $provideLlmToolsForWizzardOrCli.d.ts} +2 -2
  21. package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +1 -0
  22. package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +2 -0
  23. package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +1 -0
  24. package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +1 -0
  25. package/esm/typings/src/llm-providers/google/register-configuration.d.ts +1 -0
  26. package/esm/typings/src/llm-providers/google/register-constructor.d.ts +1 -0
  27. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -0
  28. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -0
  29. package/esm/typings/src/other/templates/getBookTemplate.d.ts +21 -0
  30. package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +10 -0
  31. package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +10 -0
  32. package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +1 -1
  33. package/esm/typings/src/scrapers/_common/utils/scraperFetch.d.ts +7 -0
  34. package/esm/typings/src/scrapers/document/register-constructor.d.ts +1 -0
  35. package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -0
  36. package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +1 -0
  37. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -0
  38. package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +1 -0
  39. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -0
  40. package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +1 -0
  41. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -0
  42. package/esm/typings/src/scrapers/website/register-constructor.d.ts +1 -0
  43. package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -0
  44. package/esm/typings/src/types/typeAliases.d.ts +8 -0
  45. package/esm/typings/src/utils/editable/types/PipelineEditableSerialized.d.ts +27 -0
  46. package/esm/typings/src/{conversion → utils/editable}/utils/removePipelineCommand.d.ts +3 -3
  47. package/esm/typings/src/{conversion → utils/editable}/utils/renamePipelineParameter.d.ts +3 -3
  48. package/esm/typings/src/{conversion → utils/editable}/utils/stringifyPipelineJson.d.ts +2 -2
  49. package/esm/typings/src/utils/parameters/numberToString.d.ts +7 -0
  50. package/esm/typings/src/utils/parameters/{replaceParameters.d.ts → templateParameters.d.ts} +6 -2
  51. package/esm/typings/src/utils/parameters/valueToString.d.ts +17 -0
  52. package/esm/typings/src/utils/parameters/valueToString.test.d.ts +1 -0
  53. package/esm/typings/src/utils/serialization/asSerializable.d.ts +4 -0
  54. package/esm/typings/src/version.d.ts +7 -0
  55. package/esm/typings/src/wizzard/wizzard.d.ts +51 -0
  56. package/package.json +2 -2
  57. package/umd/index.umd.js +3 -1
  58. package/umd/index.umd.js.map +1 -1
  59. package/esm/typings/src/utils/formatNumber.d.ts +0 -6
  60. /package/esm/typings/src/{conversion → utils/editable}/utils/removePipelineCommand.test.d.ts +0 -0
  61. /package/esm/typings/src/{conversion → utils/editable}/utils/renamePipelineParameter.test.d.ts +0 -0
  62. /package/esm/typings/src/{conversion → utils/editable}/utils/stringifyPipelineJson.test.d.ts +0 -0
  63. /package/esm/typings/src/utils/{formatNumber.test.d.ts → parameters/numberToString.test.d.ts} +0 -0
  64. /package/esm/typings/src/utils/parameters/{replaceParameters.test.d.ts → templateParameters.test.d.ts} +0 -0
@@ -0,0 +1,5 @@
1
+ export {};
2
+ /**
3
+ * Note: [⚪] This should never be in any released package
4
+ * TODO: Is this a good pattern to do type testing?
5
+ */
@@ -1,7 +1,7 @@
1
1
  import type { Promisable, ReadonlyDeep } from 'type-fest';
2
2
  import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
3
3
  import type { TaskProgress } from '../../types/TaskProgress';
4
- import type { Parameters } from '../../types/typeAliases';
4
+ import type { InputParameters } from '../../types/typeAliases';
5
5
  import type { PipelineExecutorResult } from '../PipelineExecutorResult';
6
6
  import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
7
7
  /**
@@ -13,7 +13,7 @@ type ExecutePipelineOptions = Required<CreatePipelineExecutorOptions> & {
13
13
  /**
14
14
  * @@@
15
15
  */
16
- readonly inputParameters: Readonly<Parameters>;
16
+ readonly inputParameters: Readonly<InputParameters>;
17
17
  /**
18
18
  * @@@
19
19
  */
@@ -1,8 +1,9 @@
1
+ import type { PromptbookFetch } from '../../execution/PromptbookFetch';
1
2
  import type { string_name } from '../../types/typeAliases';
2
3
  /**
3
4
  * @private still in development
4
5
  */
5
- export declare function isDomainNameFree(name: string_name): Promise<boolean>;
6
+ export declare function isDomainNameFree(name: string_name, fetch: PromptbookFetch): Promise<boolean>;
6
7
  /**
7
8
  * TODO: [🍓][🧠] Test and implement `isDomainNameFree`
8
9
  * TODO: Export via some (and probably new) NPM package
@@ -1,8 +1,9 @@
1
+ import type { PromptbookFetch } from '../../execution/PromptbookFetch';
1
2
  import type { string_name } from '../../types/typeAliases';
2
3
  /**
3
4
  * @private still in development
4
5
  */
5
- export declare function isGithubNameFree(name: string_name): Promise<boolean>;
6
+ export declare function isGithubNameFree(name: string_name, fetch: PromptbookFetch): Promise<boolean>;
6
7
  /**
7
8
  * TODO: [🍓][🧠] Test and implement `isGithubNameFree`
8
9
  * TODO: Export via some (and probably new) NPM package
@@ -18,6 +18,11 @@ export declare const HIGH_LEVEL_ABSTRACTIONS: readonly [{
18
18
  readonly knowledgePieces: import("../_packages/types.index").KnowledgePiecePreparedJson[];
19
19
  readonly personas: (import("../_packages/types.index").PersonaJson | import("../_packages/types.index").PersonaPreparedJson)[];
20
20
  readonly preparations: import("../_packages/types.index").PreparationJson[];
21
+ readonly sources: readonly {
22
+ type: "BOOK";
23
+ path: string | null;
24
+ content: import("../pipeline/PipelineString").PipelineString;
25
+ }[];
21
26
  readonly formfactorName?: "CHATBOT" | "GENERATOR" | "GENERIC" | "EXPERIMENTAL_MATCHER" | "SHEETS" | "TRANSLATOR" | undefined;
22
27
  }>): void;
23
28
  }, {
@@ -35,6 +40,11 @@ export declare const HIGH_LEVEL_ABSTRACTIONS: readonly [{
35
40
  readonly knowledgePieces: import("../_packages/types.index").KnowledgePiecePreparedJson[];
36
41
  readonly personas: (import("../_packages/types.index").PersonaJson | import("../_packages/types.index").PersonaPreparedJson)[];
37
42
  readonly preparations: import("../_packages/types.index").PreparationJson[];
43
+ readonly sources: readonly {
44
+ type: "BOOK";
45
+ path: string | null;
46
+ content: import("../pipeline/PipelineString").PipelineString;
47
+ }[];
38
48
  readonly formfactorName?: "CHATBOT" | "GENERATOR" | "GENERIC" | "EXPERIMENTAL_MATCHER" | "SHEETS" | "TRANSLATOR" | undefined;
39
49
  }>): void;
40
50
  }];
@@ -5,9 +5,9 @@ import type { LlmExecutionToolsWithTotalUsage } from '../utils/count-total-usage
5
5
  *
6
6
  * @private within the repository - for CLI utils
7
7
  */
8
- export declare function $provideLlmToolsForCli(options?: Pick<CacheLlmToolsOptions, 'isCacheReloaded'>): LlmExecutionToolsWithTotalUsage;
8
+ export declare function $provideLlmToolsForWizzardOrCli(options?: Pick<CacheLlmToolsOptions, 'isCacheReloaded'>): LlmExecutionToolsWithTotalUsage;
9
9
  /**
10
- * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
10
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
11
11
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
12
12
  * TODO: [🥃] Allow `ptbk make` without llm tools
13
13
  * TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
@@ -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;
@@ -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;
@@ -0,0 +1,21 @@
1
+ import type { PipelineCollection } from '../../collection/PipelineCollection';
2
+ import type { string_formfactor_name } from '../../formfactors/_common/string_formfactor_name';
3
+ import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
4
+ /**
5
+ * @@@
6
+ *
7
+ * @singleton
8
+ * @private internal cache of `getBookTemplate`
9
+ */
10
+ export declare let templatesPipelineCollection: PipelineCollection | null;
11
+ /**
12
+ * Get template for new book
13
+ *
14
+ * @public exported from `@promptbook/templates`
15
+ */
16
+ export declare function getBookTemplate(formfactorName: string_formfactor_name): PipelineJson;
17
+ /**
18
+ * TODO: !!!!!! Test
19
+ * TODO: [🧠] Which is the best place for this function
20
+ * TODO: !!!!!! `book string template notation
21
+ */
@@ -0,0 +1,10 @@
1
+ import type { PipelineCollection } from '../../collection/PipelineCollection';
2
+ /**
3
+ * Get pipeline collection for Untitled Promptbook project
4
+ *
5
+ * ⚠️ WARNING: This code has been generated by `@promptbook/cli` so that any manual changes will be overwritten
6
+ *
7
+ * @generated
8
+ * @returns {PipelineCollection} Library of promptbooks for Untitled Promptbook project
9
+ */
10
+ export declare function getTemplatesPipelineCollection(): PipelineCollection;
@@ -3,7 +3,9 @@ import type { ModelRequirements } from '../../types/ModelRequirements';
3
3
  import type { string_filename } from '../../types/typeAliases';
4
4
  import type { string_markdown_text } from '../../types/typeAliases';
5
5
  import type { string_pipeline_url } from '../../types/typeAliases';
6
+ import type { string_relative_filename } from '../../types/typeAliases';
6
7
  import type { string_semantic_version } from '../../types/typeAliases';
8
+ import type { PipelineString } from '../PipelineString';
7
9
  import type { KnowledgePiecePreparedJson } from './KnowledgePieceJson';
8
10
  import type { KnowledgeSourceJson } from './KnowledgeSourceJson';
9
11
  import type { KnowledgeSourcePreparedJson } from './KnowledgeSourceJson';
@@ -91,6 +93,14 @@ export type PipelineJson = {
91
93
  * @see https://github.com/webgptorg/promptbook/discussions/78
92
94
  */
93
95
  readonly preparations: Array<PreparationJson>;
96
+ /**
97
+ * Backup of the original book source
98
+ */
99
+ readonly sources: ReadonlyArray<{
100
+ type: 'BOOK';
101
+ path: string_relative_filename | null;
102
+ content: PipelineString;
103
+ }>;
94
104
  };
95
105
  /**
96
106
  * TODO: [🛳] Default PERSONA for the pipeline `defaultPersonaName` (same as `defaultModelRequirements`)
@@ -8,4 +8,4 @@ import type { ScraperSourceHandler } from '../Scraper';
8
8
  *
9
9
  * @public exported from `@promptbook/core`
10
10
  */
11
- export declare function makeKnowledgeSourceHandler(knowledgeSource: SetOptional<KnowledgeSourceJson, 'name'>, tools: Pick<ExecutionTools, 'fs'>, options?: Pick<PrepareAndScrapeOptions, 'rootDirname' | 'isVerbose'>): Promise<ScraperSourceHandler>;
11
+ export declare function makeKnowledgeSourceHandler(knowledgeSource: SetOptional<KnowledgeSourceJson, 'name'>, tools: Pick<ExecutionTools, 'fs' | 'fetch'>, options?: Pick<PrepareAndScrapeOptions, 'rootDirname' | 'isVerbose'>): Promise<ScraperSourceHandler>;
@@ -0,0 +1,7 @@
1
+ import type { PromptbookFetch } from '../../../execution/PromptbookFetch';
2
+ /**
3
+ * The built-in `fetch' function with a lightweight error handling wrapper as default fetch function used in Promptbook scrapers
4
+ *
5
+ * @private as default `fetch` function used in Promptbook scrapers
6
+ */
7
+ export declare const scraperFetch: PromptbookFetch;
@@ -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;
@@ -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;
@@ -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;
@@ -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,5 +1,6 @@
1
1
  import type { TupleToUnion } from 'type-fest';
2
2
  import { RESERVED_PARAMETER_NAMES } from '../constants';
3
+ import type { really_unknown } from '../utils/organization/really_unknown';
3
4
  /**
4
5
  * Semantic helper
5
6
  */
@@ -107,6 +108,13 @@ export type string_parameter_value = string;
107
108
  * @see https://ptbk.io/parameters
108
109
  */
109
110
  export type Parameters = Exclude<Record<string_parameter_name, string_parameter_value>, ReservedParameters>;
111
+ /**
112
+ * Parameters to pass to execution of the pipeline
113
+ *
114
+ * Note: [🚉] This should be fully serializable as JSON
115
+ * @see https://ptbk.io/parameters
116
+ */
117
+ export type InputParameters = Exclude<Record<string_parameter_name, really_unknown>, ReservedParameters>;
110
118
  /**
111
119
  * Semantic helper
112
120
  * Unique identifier of reserved parameter
@@ -0,0 +1,27 @@
1
+ import type { ErrorJson } from '../../../errors/utils/ErrorJson';
2
+ import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
3
+ import type { string_date_iso8601 } from '../../../types/typeAliases';
4
+ /**
5
+ * Represents a single pipeline in PromptbookStudio
6
+ *
7
+ * This is simple extension of PipelineJson with additional metadata
8
+ * Note: There are two similar entities:
9
+ * 1) Type (interface) `PipelineEditableSerialized` which represents just data in database
10
+ * 2) Class `PipelineEditable` which implements `PipelineEditableSerialized` and adds error handling and editing capabilities
11
+ *
12
+ * @public exported from `@promptbook/editable`
13
+ */
14
+ export type PipelineEditableSerialized = PipelineJson & {
15
+ /**
16
+ * When was the pipeline created
17
+ */
18
+ readonly createdAt: string_date_iso8601;
19
+ /**
20
+ * When was the pipeline last modified
21
+ */
22
+ readonly updatedAt: string_date_iso8601 | null;
23
+ /**
24
+ * Known errors to transfer to new PipelineEditable
25
+ */
26
+ readonly knownErrors: Array<ErrorJson>;
27
+ };
@@ -1,5 +1,5 @@
1
- import type { CommandType } from '../../commands/_common/types/CommandType';
2
- import type { PipelineString } from '../../pipeline/PipelineString';
1
+ import type { CommandType } from '../../../commands/_common/types/CommandType';
2
+ import type { PipelineString } from '../../../pipeline/PipelineString';
3
3
  /**
4
4
  * Options for `removePipelineCommand`
5
5
  */
@@ -16,7 +16,7 @@ type RemovePipelineCommandOptions = {
16
16
  /**
17
17
  * Function `removePipelineCommand` will remove one command from pipeline string
18
18
  *
19
- * @public exported from `@promptbook/core` <- Note: [👖] This utility is so tightly interconnected with the Promptbook that it is not exported as util but in core
19
+ * @public exported from `@promptbook/editable`
20
20
  */
21
21
  export declare function removePipelineCommand(options: RemovePipelineCommandOptions): PipelineString;
22
22
  export {};
@@ -1,5 +1,5 @@
1
- import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
2
- import type { string_name } from '../../types/typeAliases';
1
+ import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
2
+ import type { string_name } from '../../../types/typeAliases';
3
3
  type RenameParameterOptions = {
4
4
  /**
5
5
  * Pipeline to search and replace for parameters
@@ -20,7 +20,7 @@ type RenameParameterOptions = {
20
20
  * In other words, it will find all parameters that are not used in the task itseld and all its dependencies
21
21
  *
22
22
  * @throws {PipelineLogicError} If the new parameter name is already used in the pipeline
23
- * @public exported from `@promptbook/core` <- Note: [👖] This utility is so tightly interconnected with the Promptbook that it is not exported as util but in core
23
+ * @public exported from `@promptbook/editable`
24
24
  */
25
25
  export declare function renamePipelineParameter(options: RenameParameterOptions): PipelineJson;
26
26
  export {};
@@ -1,11 +1,11 @@
1
- import type { string_json } from '../../types/typeAliases';
1
+ import type { string_json } from '../../../types/typeAliases';
2
2
  /**
3
3
  * Stringify the PipelineJson with proper formatting
4
4
  *
5
5
  * Note: [0] It can be used for more JSON types like whole collection of pipelines, single knowledge piece, etc.
6
6
  * Note: In contrast to JSON.stringify, this function ensures that **embedding index** is on single line
7
7
  *
8
- * @public exported from `@promptbook/core`
8
+ * @public exported from `@promptbook/editable`
9
9
  */
10
10
  export declare function stringifyPipelineJson<TType>(pipeline: TType): string_json<TType>;
11
11
  /**
@@ -0,0 +1,7 @@
1
+ import type { string_parameter_value } from '../../types/typeAliases';
2
+ /**
3
+ * Format either small or big number
4
+ *
5
+ * @public exported from `@promptbook/utils`
6
+ */
7
+ export declare function numberToString(value: number): string_parameter_value;
@@ -1,12 +1,16 @@
1
- import type { Parameters } from '../../types/typeAliases';
1
+ import type { string_parameter_name } from '../../types/typeAliases';
2
2
  import type { string_template } from '../../types/typeAliases';
3
+ import type { really_unknown } from '../organization/really_unknown';
3
4
  /**
4
5
  * Replaces parameters in template with values from parameters object
5
6
  *
7
+ * Note: This function is not places strings into string,
8
+ * It's more complex and can handle this operation specifically for LLM models
9
+ *
6
10
  * @param template the template with parameters in {curly} braces
7
11
  * @param parameters the object with parameters
8
12
  * @returns the template with replaced parameters
9
13
  * @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
10
14
  * @public exported from `@promptbook/utils`
11
15
  */
12
- export declare function replaceParameters(template: string_template, parameters: Parameters): string;
16
+ export declare function templateParameters(template: string_template, parameters: Record<string_parameter_name, really_unknown>): string;
@@ -0,0 +1,17 @@
1
+ import type { string_parameter_value } from '../../types/typeAliases';
2
+ import type { really_unknown } from '../organization/really_unknown';
3
+ /**
4
+ * Function `valueToString` will convert the given value to string
5
+ * This is useful and used in the `templateParameters` function
6
+ *
7
+ * Note: This function is not just calling `toString` method
8
+ * It's more complex and can handle this conversion specifically for LLM models
9
+ * See `VALUE_STRINGS`
10
+ *
11
+ * Note: There are 2 similar functions
12
+ * - `valueToString` converts value to string for LLM models as human-readable string
13
+ * - `asSerializable` converts value to string to preserve full information to be able to convert it back
14
+ *
15
+ * @public exported from `@promptbook/utils`
16
+ */
17
+ export declare function valueToString(value: really_unknown): string_parameter_value;
@@ -6,6 +6,10 @@ import type { really_any } from '../organization/really_any';
6
6
  * For example:
7
7
  * - `Date` objects will be converted to string
8
8
  *
9
+ * Note: There are 2 similar functions
10
+ * - `valueToString` converts value to string for LLM models as human-readable string
11
+ * - `asSerializable` converts value to string to preserve full information to be able to convert it back
12
+ *
9
13
  * @private Internal helper function
10
14
  */
11
15
  export declare function asSerializable(value: really_any): really_any;
@@ -2,15 +2,22 @@ import type { string_semantic_version } from './types/typeAliases';
2
2
  /**
3
3
  * The version of the Book language
4
4
  *
5
+ * @generated
5
6
  * @see https://github.com/webgptorg/book
6
7
  */
7
8
  export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
8
9
  /**
9
10
  * The version of the Promptbook engine
10
11
  *
12
+ * @generated
11
13
  * @see https://github.com/webgptorg/promptbook
12
14
  */
13
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
+ /**
17
+ * @@@
18
+ *
19
+ * @generated
20
+ */
14
21
  export type string_promptbook_version = string_semantic_version;
15
22
  /**
16
23
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
@@ -0,0 +1,51 @@
1
+ import { Promisable } from 'type-fest';
2
+ import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
3
+ import type { ExecutionTools } from '../execution/ExecutionTools';
4
+ import type { PipelineExecutorResult } from '../execution/PipelineExecutorResult';
5
+ import type { PipelineString } from '../pipeline/PipelineString';
6
+ import type { TaskProgress } from '../types/TaskProgress';
7
+ import type { InputParameters } from '../types/typeAliases';
8
+ import type { string_filename } from '../types/typeAliases';
9
+ import type { string_pipeline_url } from '../types/typeAliases';
10
+ /**
11
+ * Look at `wizzard` for more details
12
+ *
13
+ * @private just for single instance
14
+ */
15
+ declare class Wizzard {
16
+ /**
17
+ * @@@!!!!!!
18
+ */
19
+ execute(book: string_pipeline_url, inputParameters: InputParameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<PipelineExecutorResult>;
20
+ private executionTools;
21
+ /**
22
+ * @@@!!!
23
+ *
24
+ * @param pipelineSource
25
+ */
26
+ getExecutionTools(): Promise<ExecutionTools>;
27
+ /**
28
+ * TODO: Make standalone function from this exported from node and used here and in `ptbk run`
29
+ * @@@!!!
30
+ *
31
+ * Strategies:
32
+ * 1) @@@!!!
33
+ * 2) @@@!!!
34
+ *
35
+ * @param pipelineSource
36
+ */
37
+ getPipeline(pipelineSource: string_filename | string_pipeline_url | PipelineString): Promise<PipelineJson>;
38
+ }
39
+ /**
40
+ * 🧙‍♂️ @@@
41
+ *
42
+ * @singleton
43
+ * @public exported from `@promptbook/wizzard`
44
+ */
45
+ export declare const wizzard: Wizzard;
46
+ export {};
47
+ /**
48
+ * TODO: !!!!!! Mark in jsdoc as non-pure
49
+ * TODO: !!!!!! Add to readmes - one markdown here imported in all packages
50
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
51
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-server",
3
- "version": "0.80.0",
3
+ "version": "0.81.0-11",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "--note-0": " <- [🐊]",
6
6
  "private": false,
@@ -54,7 +54,7 @@
54
54
  "module": "./esm/index.es.js",
55
55
  "typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
56
56
  "peerDependencies": {
57
- "@promptbook/core": "0.80.0"
57
+ "@promptbook/core": "0.81.0-11"
58
58
  },
59
59
  "dependencies": {
60
60
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -14,15 +14,17 @@
14
14
  /**
15
15
  * The version of the Book language
16
16
  *
17
+ * @generated
17
18
  * @see https://github.com/webgptorg/book
18
19
  */
19
20
  var BOOK_LANGUAGE_VERSION = '1.0.0';
20
21
  /**
21
22
  * The version of the Promptbook engine
22
23
  *
24
+ * @generated
23
25
  * @see https://github.com/webgptorg/promptbook
24
26
  */
25
- var PROMPTBOOK_ENGINE_VERSION = '0.80.0-1';
27
+ var PROMPTBOOK_ENGINE_VERSION = '0.81.0-10';
26
28
  /**
27
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
28
30
  * Note: [💞] Ignore a discrepancy between file name and entity name