@promptbook/legacy-documents 0.71.0-16 → 0.71.0-18

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 (37) hide show
  1. package/README.md +5 -1
  2. package/esm/index.es.js +17 -17
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/core.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/node.index.d.ts +2 -0
  6. package/esm/typings/src/_packages/types.index.d.ts +8 -8
  7. package/esm/typings/src/_packages/utils.index.d.ts +2 -2
  8. package/esm/typings/src/execution/Executables.d.ts +18 -0
  9. package/esm/typings/src/execution/ExecutionTools.d.ts +9 -3
  10. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -3
  11. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +1 -2
  12. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Response.d.ts +4 -4
  13. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Response.d.ts +3 -3
  14. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +0 -19
  15. package/esm/typings/src/scrapers/_common/Scraper.d.ts +1 -1
  16. package/esm/typings/src/scrapers/_common/register/$provideExecutablesForNode.d.ts +12 -0
  17. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +1 -1
  18. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -2
  19. package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +1 -1
  20. package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +2 -2
  21. package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +1 -1
  22. package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +5 -2
  23. package/esm/typings/src/scrapers/website/utils/createShowdownConverter.d.ts +7 -0
  24. package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +2 -2
  25. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -2
  26. package/esm/typings/src/utils/execCommand/{IExecCommandOptions.d.ts → ExecCommandOptions.d.ts} +2 -6
  27. package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +3 -3
  28. package/esm/typings/src/utils/normalization/IKeywords.d.ts +2 -2
  29. package/esm/typings/src/utils/normalization/parseKeywords.d.ts +2 -2
  30. package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +2 -2
  31. package/esm/typings/src/utils/normalization/searchKeywords.d.ts +2 -2
  32. package/esm/typings/src/utils/unwrapResult.d.ts +4 -4
  33. package/package.json +4 -3
  34. package/umd/index.umd.js +17 -17
  35. package/umd/index.umd.js.map +1 -1
  36. package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +0 -12
  37. /package/esm/typings/src/scrapers/website/utils/{markdownConverter.test.d.ts → createShowdownConverter.test.d.ts} +0 -0
@@ -65,6 +65,7 @@ import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usag
65
65
  import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
66
66
  import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
67
67
  import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
68
+ import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
68
69
  import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
69
70
  import { preparePersona } from '../personas/preparePersona';
70
71
  import { isPipelinePrepared } from '../prepare/isPipelinePrepared';
@@ -153,6 +154,7 @@ export { limitTotalUsage };
153
154
  export { _AnthropicClaudeMetadataRegistration };
154
155
  export { _AzureOpenAiMetadataRegistration };
155
156
  export { joinLlmExecutionTools };
157
+ export { MultipleLlmExecutionTools };
156
158
  export { _OpenAiMetadataRegistration };
157
159
  export { preparePersona };
158
160
  export { isPipelinePrepared };
@@ -3,6 +3,7 @@ import { createCollectionFromDirectory } from '../collection/constructors/create
3
3
  import { $provideExecutionToolsForNode } from '../execution/utils/$provideExecutionToolsForNode';
4
4
  import { $provideLlmToolsConfigurationFromEnv } from '../llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv';
5
5
  import { $provideLlmToolsFromEnv } from '../llm-providers/_common/register/$provideLlmToolsFromEnv';
6
+ import { $provideExecutablesForNode } from '../scrapers/_common/register/$provideExecutablesForNode';
6
7
  import { $provideFilesystemForNode } from '../scrapers/_common/register/$provideFilesystemForNode';
7
8
  import { $provideScrapersForNode } from '../scrapers/_common/register/$provideScrapersForNode';
8
9
  import { FileCacheStorage } from '../storage/file-cache-storage/FileCacheStorage';
@@ -13,6 +14,7 @@ export { createCollectionFromDirectory };
13
14
  export { $provideExecutionToolsForNode };
14
15
  export { $provideLlmToolsConfigurationFromEnv };
15
16
  export { $provideLlmToolsFromEnv };
17
+ export { $provideExecutablesForNode };
16
18
  export { $provideFilesystemForNode };
17
19
  export { $provideScrapersForNode };
18
20
  export { FileCacheStorage };
@@ -19,6 +19,7 @@ import type { CommonToolsOptions } from '../execution/CommonToolsOptions';
19
19
  import type { CreatePipelineExecutorOptions } from '../execution/createPipelineExecutor/00-CreatePipelineExecutorOptions';
20
20
  import type { CreatePipelineExecutorSettings } from '../execution/createPipelineExecutor/00-CreatePipelineExecutorSettings';
21
21
  import type { EmbeddingVector } from '../execution/EmbeddingVector';
22
+ import type { Executables } from '../execution/Executables';
22
23
  import type { ExecutionTools } from '../execution/ExecutionTools';
23
24
  import type { FilesystemTools } from '../execution/FilesystemTools';
24
25
  import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
@@ -49,7 +50,6 @@ import type { AnthropicClaudeExecutionToolsDirectOptions } from '../llm-provider
49
50
  import type { AnthropicClaudeExecutionToolsProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
50
51
  import type { AzureOpenAiExecutionToolsOptions } from '../llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions';
51
52
  import type { LangtailExecutionToolsOptions } from '../llm-providers/langtail/LangtailExecutionToolsOptions';
52
- import type { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
53
53
  import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions';
54
54
  import type { PromptbookServer_Error } from '../llm-providers/remote/interfaces/PromptbookServer_Error';
55
55
  import type { PromptbookServer_ListModels_Request } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Request';
@@ -222,13 +222,13 @@ import type { number_gigabytes } from '../types/typeAliases';
222
222
  import type { number_terabytes } from '../types/typeAliases';
223
223
  import type { Registered } from '../utils/$Register';
224
224
  import type { Registration } from '../utils/$Register';
225
- import type { IExecCommandOptions } from '../utils/execCommand/IExecCommandOptions';
226
- import type { IExecCommandOptionsAdvanced } from '../utils/execCommand/IExecCommandOptions';
225
+ import type { ExecCommandOptions } from '../utils/execCommand/ExecCommandOptions';
226
+ import type { ExecCommandOptionsAdvanced } from '../utils/execCommand/ExecCommandOptions';
227
227
  import type { FromtoItems } from '../utils/FromtoItems';
228
228
  import type { CodeBlock } from '../utils/markdown/extractAllBlocksFromMarkdown';
229
229
  import type { MarkdownSection } from '../utils/markdown/parseMarkdownSection';
230
230
  import type { string_keyword } from '../utils/normalization/IKeywords';
231
- import type { IKeywords } from '../utils/normalization/IKeywords';
231
+ import type { Keywords } from '../utils/normalization/IKeywords';
232
232
  import type { string_kebab_case } from '../utils/normalization/normalize-to-kebab-case';
233
233
  import type { string_camelCase } from '../utils/normalization/normalizeTo_camelCase';
234
234
  import type { string_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
@@ -259,6 +259,7 @@ export type { CommonToolsOptions };
259
259
  export type { CreatePipelineExecutorOptions };
260
260
  export type { CreatePipelineExecutorSettings };
261
261
  export type { EmbeddingVector };
262
+ export type { Executables };
262
263
  export type { ExecutionTools };
263
264
  export type { FilesystemTools };
264
265
  export type { LlmExecutionTools };
@@ -289,7 +290,6 @@ export type { AnthropicClaudeExecutionToolsDirectOptions };
289
290
  export type { AnthropicClaudeExecutionToolsProxiedOptions };
290
291
  export type { AzureOpenAiExecutionToolsOptions };
291
292
  export type { LangtailExecutionToolsOptions };
292
- export type { MultipleLlmExecutionTools };
293
293
  export type { OpenAiExecutionToolsOptions };
294
294
  export type { PromptbookServer_Error };
295
295
  export type { PromptbookServer_ListModels_Request };
@@ -462,13 +462,13 @@ export type { number_gigabytes };
462
462
  export type { number_terabytes };
463
463
  export type { Registered };
464
464
  export type { Registration };
465
- export type { IExecCommandOptions };
466
- export type { IExecCommandOptionsAdvanced };
465
+ export type { ExecCommandOptions };
466
+ export type { ExecCommandOptionsAdvanced };
467
467
  export type { FromtoItems };
468
468
  export type { CodeBlock };
469
469
  export type { MarkdownSection };
470
470
  export type { string_keyword };
471
- export type { IKeywords };
471
+ export type { Keywords };
472
472
  export type { string_kebab_case };
473
473
  export type { string_camelCase };
474
474
  export type { string_PascalCase };
@@ -24,7 +24,7 @@ import { capitalize } from '../utils/normalization/capitalize';
24
24
  import { decapitalize } from '../utils/normalization/decapitalize';
25
25
  import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
26
26
  import type { string_keyword } from '../utils/normalization/IKeywords';
27
- import type { IKeywords } from '../utils/normalization/IKeywords';
27
+ import type { Keywords } from '../utils/normalization/IKeywords';
28
28
  import { isValidKeyword } from '../utils/normalization/isValidKeyword';
29
29
  import { nameToUriPart } from '../utils/normalization/nameToUriPart';
30
30
  import { nameToUriParts } from '../utils/normalization/nameToUriParts';
@@ -95,7 +95,7 @@ export { capitalize };
95
95
  export { decapitalize };
96
96
  export { DIACRITIC_VARIANTS_LETTERS };
97
97
  export type { string_keyword };
98
- export type { IKeywords };
98
+ export type { Keywords };
99
99
  export { isValidKeyword };
100
100
  export { nameToUriPart };
101
101
  export { nameToUriParts };
@@ -0,0 +1,18 @@
1
+ import type { string_executable_path } from '../types/typeAliases';
2
+ /**
3
+ * Paths to the external programs executables
4
+ */
5
+ export type Executables = {
6
+ /**
7
+ * Path to the `pandoc` executable
8
+ *
9
+ * @example 'C:/Users/me/AppData/Local/Pandoc/pandoc.exe'
10
+ */
11
+ pandocPath?: string_executable_path;
12
+ /**
13
+ * Path to the LibreOffice executable
14
+ *
15
+ * @example 'C:/Program Files/LibreOffice/program/swriter.exe'
16
+ */
17
+ libreOfficePath?: string_executable_path;
18
+ };
@@ -1,5 +1,6 @@
1
1
  import type { Scraper } from '../scrapers/_common/Scraper';
2
2
  import type { Arrayable } from '../types/Arrayable';
3
+ import type { Executables } from './Executables';
3
4
  import type { FilesystemTools } from './FilesystemTools';
4
5
  import type { LlmExecutionTools } from './LlmExecutionTools';
5
6
  import type { ScriptExecutionTools } from './ScriptExecutionTools';
@@ -26,6 +27,14 @@ export type ExecutionTools = {
26
27
  * @default undefined - If not provided, no filesystem operations will be possible
27
28
  */
28
29
  readonly fs?: FilesystemTools;
30
+ /**
31
+ * Scrapers for extracting knowledge from external sources
32
+ *
33
+ * Tip: Use `$provideExecutablesForNode`
34
+ *
35
+ * @default [] - If not provided, no external knowledge extraction will be possible
36
+ */
37
+ readonly executables?: Executables;
29
38
  /**
30
39
  * Scrapers for extracting knowledge from external sources
31
40
  *
@@ -51,6 +60,3 @@ export type ExecutionTools = {
51
60
  */
52
61
  readonly userInterface?: UserInterfaceTools;
53
62
  };
54
- /**
55
- * TODO: !!!!!! Move here also the executables and make $provideXxxxForNode
56
- */
@@ -1,9 +1,17 @@
1
1
  import type { AutomaticTranslator } from './AutomaticTranslator';
2
2
  import type { TranslatorOptions } from './TranslatorOptions';
3
- interface LindatAutomaticTranslatorOptions extends TranslatorOptions {
4
- apiUrl?: URL;
5
- }
6
3
  /**
4
+ * @@@
5
+ */
6
+ type LindatAutomaticTranslatorOptions = TranslatorOptions & {
7
+ /**
8
+ * @@@
9
+ */
10
+ readonly apiUrl?: URL;
11
+ };
12
+ /**
13
+ * @@@
14
+ *
7
15
  * @private still in development [🏳]
8
16
  */
9
17
  export declare class LindatAutomaticTranslator implements AutomaticTranslator {
@@ -15,8 +15,7 @@ import type { string_title } from '../../types/typeAliases';
15
15
  * Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
16
16
  *
17
17
  * Note: Internal utility of `joinLlmExecutionTools` but exposed type
18
- * @public exported from `@promptbook/types`
19
- * TODO: !!!!!! Export as runtime class not just type
18
+ * @public exported from `@promptbook/core`
20
19
  */
21
20
  export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
22
21
  /**
@@ -4,12 +4,12 @@ import type { AvailableModel } from '../../../execution/AvailableModel';
4
4
  *
5
5
  * This is sent from server to client when models are listed
6
6
  */
7
- export interface PromptbookServer_ListModels_Response {
7
+ export type PromptbookServer_ListModels_Response = {
8
8
  /**
9
9
  * Available models that can be used
10
10
  */
11
- models: Array<AvailableModel>;
12
- }
11
+ readonly models: Array<AvailableModel>;
12
+ };
13
13
  /**
14
14
  * TODO: [👒] Listing models (and checking configuration) probbably should go through REST API not Socket.io
15
- */
15
+ */
@@ -4,9 +4,9 @@ import type { PromptResult } from '../../../execution/PromptResult';
4
4
  *
5
5
  * This is sent from server to client when the generated text is completed
6
6
  */
7
- export interface PromptbookServer_Prompt_Response {
7
+ export type PromptbookServer_Prompt_Response = {
8
8
  /**
9
9
  * The result of the prompt
10
10
  */
11
- promptResult: PromptResult;
12
- }
11
+ readonly promptResult: PromptResult;
12
+ };
@@ -33,25 +33,6 @@ export type PrepareAndScrapeOptions = {
33
33
  * @default MAX_PARALLEL_COUNT
34
34
  */
35
35
  readonly maxParallelCount?: number;
36
- /**
37
- * Path to the external programs executables
38
- *
39
- * TODO: !!!!!! Transform to scrapers and make them Classy
40
- */
41
- readonly externalProgramsPaths?: {
42
- /**
43
- * Path to the `pandoc` executable
44
- *
45
- * @example 'C:/Users/me/AppData/Local/Pandoc/pandoc.exe'
46
- */
47
- readonly pandocPath?: string;
48
- /**
49
- * Path to the LibreOffice executable
50
- *
51
- * @example 'C:/Program Files/LibreOffice/program/swriter.exe'
52
- */
53
- readonly libreOfficePath?: string;
54
- };
55
36
  /**
56
37
  * If true, the missing software is automatically installed
57
38
  */
@@ -61,6 +61,6 @@ export type ScraperSourceHandler = {
61
61
  * TODO: [🔼] Export via types
62
62
  */
63
63
  /**
64
- * TODO: !!!!!! Test that this is catched
65
64
  * Note: [⚫] Code in this file should never be published in any package
65
+ * <- TODO: !!!!!! Test that this is catched
66
66
  */
@@ -0,0 +1,12 @@
1
+ import type { Executables } from '../../../execution/Executables';
2
+ import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
3
+ /**
4
+ * @@@
5
+ *
6
+ * @public exported from `@promptbook/node`
7
+ */
8
+ export declare function $provideExecutablesForNode(options?: PrepareAndScrapeOptions): Promise<Executables>;
9
+ /**
10
+ * TODO: [🧠] THis should be maybe in different folder
11
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
12
+ */
@@ -2,7 +2,7 @@ import type { ExecutionTools } from '../../../execution/ExecutionTools';
2
2
  import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
3
3
  import type { Scraper } from '../Scraper';
4
4
  /**
5
- * @@@!!!!!!
5
+ * @@@
6
6
  *
7
7
  * 1) @@@
8
8
  * 2) @@@
@@ -2,14 +2,14 @@ import type { ExecutionTools } from '../../../execution/ExecutionTools';
2
2
  import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
3
3
  import type { Scraper } from '../Scraper';
4
4
  /**
5
- * !!!!!!
5
+ * @@@
6
6
  *
7
7
  * 1) @@@
8
8
  * 2) @@@
9
9
  *
10
10
  * @public exported from `@promptbook/node`
11
11
  */
12
- export declare function $provideScrapersForNode(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options?: PrepareAndScrapeOptions): Promise<Array<Scraper>>;
12
+ export declare function $provideScrapersForNode(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options?: PrepareAndScrapeOptions): Promise<Array<Scraper>>;
13
13
  /**
14
14
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
15
15
  */
@@ -23,7 +23,7 @@ export declare class DocumentScraper implements Converter, Scraper {
23
23
  * Markdown scraper is used internally
24
24
  */
25
25
  private readonly markdownScraper;
26
- constructor(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options: PrepareAndScrapeOptions);
26
+ constructor(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options: PrepareAndScrapeOptions);
27
27
  /**
28
28
  * Convert the `.docx` or `.odt` to `.md` file and returns intermediate source
29
29
  *
@@ -7,7 +7,7 @@ import type { Scraper } from '../_common/Scraper';
7
7
  import type { ScraperSourceHandler } from '../_common/Scraper';
8
8
  import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
9
9
  /**
10
- * Scraper for .docx files
10
+ * Scraper for old document files (like .doc and .rtf)
11
11
  *
12
12
  * @see `documentationUrl` for more details
13
13
  * @public exported from `@promptbook/legacy-documents`
@@ -23,7 +23,7 @@ export declare class LegacyDocumentScraper implements Converter, Scraper {
23
23
  * Document scraper is used internally
24
24
  */
25
25
  private readonly documentScraper;
26
- constructor(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options: PrepareAndScrapeOptions);
26
+ constructor(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options: PrepareAndScrapeOptions);
27
27
  /**
28
28
  * Convert the `.doc` or `.rtf` to `.doc` file and returns intermediate source
29
29
  *
@@ -7,7 +7,7 @@ import type { Converter } from '../_common/Converter';
7
7
  import type { ScraperAndConverterMetadata } from '../_common/register/ScraperAndConverterMetadata';
8
8
  import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
9
9
  /**
10
- * Scraper for .docx files
10
+ * Scraper for .pdf files
11
11
  *
12
12
  * @see `documentationUrl` for more details
13
13
  * @public exported from `@promptbook/pdf`
@@ -8,7 +8,7 @@ import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOpti
8
8
  import type { ScraperAndConverterMetadata } from '../_common/register/ScraperAndConverterMetadata';
9
9
  import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
10
10
  /**
11
- * Scraper for .docx files
11
+ * Scraper for websites
12
12
  *
13
13
  * @see `documentationUrl` for more details
14
14
  * @public exported from `@promptbook/website-crawler`
@@ -24,6 +24,10 @@ export declare class WebsiteScraper implements Converter, Scraper {
24
24
  * Markdown scraper is used internally
25
25
  */
26
26
  private readonly markdownScraper;
27
+ /**
28
+ * Showdown converter is used internally
29
+ */
30
+ private readonly showdownConverter;
27
31
  constructor(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options: PrepareAndScrapeOptions);
28
32
  /**
29
33
  * Convert the website to `.md` file and returns intermediate source
@@ -39,7 +43,6 @@ export declare class WebsiteScraper implements Converter, Scraper {
39
43
  scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
40
44
  }
41
45
  /**
42
- * TODO: !!!!!! Put into separate package
43
46
  * TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
44
47
  * TODO: [🪂] Do it in parallel 11:11
45
48
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
@@ -0,0 +1,7 @@
1
+ import { Converter as ShowdownConverter } from 'showdown';
2
+ /**
3
+ * Create a new showdown converter instance
4
+ *
5
+ * @private utility of `WebsiteScraper`
6
+ */
7
+ export declare function createShowdownConverter(): ShowdownConverter;
@@ -13,7 +13,7 @@ import type { Expectations } from './Expectations';
13
13
  /**
14
14
  * Common properties of all templates
15
15
  */
16
- export interface TemplateJsonCommon {
16
+ export type TemplateJsonCommon = {
17
17
  /**
18
18
  * Name of the template
19
19
  * - It must be unique across the pipeline
@@ -93,7 +93,7 @@ export interface TemplateJsonCommon {
93
93
  * Name of the parameter that is the result of the template
94
94
  */
95
95
  readonly resultingParameterName: string_name;
96
- }
96
+ };
97
97
  /**
98
98
  * TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
99
99
  * TODO: [♈] Probbably move expectations from templates to parameters
@@ -1,4 +1,4 @@
1
- import type { IExecCommandOptions } from './IExecCommandOptions';
1
+ import type { ExecCommandOptions } from './ExecCommandOptions';
2
2
  /**
3
3
  * Run one command in a shell
4
4
  *
@@ -8,7 +8,7 @@ import type { IExecCommandOptions } from './IExecCommandOptions';
8
8
  *
9
9
  * @public exported from `@promptbook/node`
10
10
  */
11
- export declare function $execCommand(options: IExecCommandOptions): Promise<string>;
11
+ export declare function $execCommand(options: ExecCommandOptions): Promise<string>;
12
12
  /**
13
13
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
14
14
  */
@@ -4,16 +4,12 @@
4
4
  type RequiredAndOptional<TBase, TRequired extends keyof TBase, TOptional extends keyof TBase> = Pick<TBase, TRequired> & Partial<Pick<TBase, TOptional>>;
5
5
  /**
6
6
  * Simple options for `execCommand`
7
- *
8
- * TODO: !!!!!! Rename - remove I prefix
9
7
  */
10
- export type IExecCommandOptions = string | RequiredAndOptional<IExecCommandOptionsAdvanced, 'command', 'args' | 'cwd' | 'crashOnError' | 'timeout'>;
8
+ export type ExecCommandOptions = string | RequiredAndOptional<ExecCommandOptionsAdvanced, 'command', 'args' | 'cwd' | 'crashOnError' | 'timeout'>;
11
9
  /**
12
10
  * Advanced options for `execCommand`
13
- *
14
- * TODO: !!!!!! Rename - remove I prefix
15
11
  */
16
- export type IExecCommandOptionsAdvanced = {
12
+ export type ExecCommandOptionsAdvanced = {
17
13
  readonly command: string;
18
14
  readonly args: string[];
19
15
  readonly cwd: string;
@@ -1,10 +1,10 @@
1
- import type { IExecCommandOptions } from './IExecCommandOptions';
2
- import type { IExecCommandOptionsAdvanced } from './IExecCommandOptions';
1
+ import type { ExecCommandOptions } from './ExecCommandOptions';
2
+ import type { ExecCommandOptionsAdvanced } from './ExecCommandOptions';
3
3
  /**
4
4
  * Normalize options for `execCommand` and `execCommands`
5
5
  *
6
6
  * @private internal utility of `execCommand` and `execCommands`
7
7
  */
8
- export declare function execCommandNormalizeOptions(options: IExecCommandOptions): Pick<IExecCommandOptionsAdvanced, 'command' | 'args' | 'cwd' | 'crashOnError' | 'timeout'> & {
8
+ export declare function execCommandNormalizeOptions(options: ExecCommandOptions): Pick<ExecCommandOptionsAdvanced, 'command' | 'args' | 'cwd' | 'crashOnError' | 'timeout'> & {
9
9
  humanReadableCommand: string;
10
10
  };
@@ -2,7 +2,7 @@
2
2
  * Semantic helper
3
3
  *
4
4
  * Keyword is string without diacritics in lowercase [a-z1-9]
5
- * Words are splitted between multiple keywords @see IKeywords
5
+ * Words are splitted between multiple keywords @see Keywords
6
6
  *
7
7
  * For example `"keyword"`
8
8
  *
@@ -15,7 +15,7 @@ export type string_keyword = string;
15
15
  *
16
16
  * @public exported from `@promptbook/utils`
17
17
  */
18
- export type IKeywords = Set<string_keyword>;
18
+ export type Keywords = Set<string_keyword>;
19
19
  /**
20
20
  * TODO: [🌮] Keywords with weight
21
21
  */
@@ -1,5 +1,5 @@
1
1
  import type { really_unknown } from '../organization/really_unknown';
2
- import type { IKeywords } from './IKeywords';
2
+ import type { Keywords } from './IKeywords';
3
3
  /**
4
4
  * Parses keywords from any object and recursively walks through
5
5
  *
@@ -9,7 +9,7 @@ import type { IKeywords } from './IKeywords';
9
9
  * @returns {Set} of keywords without diacritics in lowercase
10
10
  * @public exported from `@promptbook/utils`
11
11
  */
12
- export declare function parseKeywords(input: really_unknown): IKeywords;
12
+ export declare function parseKeywords(input: really_unknown): Keywords;
13
13
  /**
14
14
  * Note: Not using spread in input param because of keeping second parameter for options
15
15
  * TODO: [🌺] Use some intermediate util splitWords
@@ -1,4 +1,4 @@
1
- import type { IKeywords } from './IKeywords';
1
+ import type { Keywords } from './IKeywords';
2
2
  /**
3
3
  * Parses keywords from a string
4
4
  *
@@ -6,4 +6,4 @@ import type { IKeywords } from './IKeywords';
6
6
  * @returns {Set} of keywords without diacritics in lowercase
7
7
  * @public exported from `@promptbook/utils`
8
8
  */
9
- export declare function parseKeywordsFromString(input: string): IKeywords;
9
+ export declare function parseKeywordsFromString(input: string): Keywords;
@@ -1,4 +1,4 @@
1
- import type { IKeywords } from './IKeywords';
1
+ import type { Keywords } from './IKeywords';
2
2
  /**
3
3
  * @@@
4
4
  *
@@ -7,4 +7,4 @@ import type { IKeywords } from './IKeywords';
7
7
  * @returns
8
8
  * @public exported from `@promptbook/utils`
9
9
  */
10
- export declare function searchKeywords(haystack: IKeywords, needle: IKeywords): boolean;
10
+ export declare function searchKeywords(haystack: Keywords, needle: Keywords): boolean;
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Additional options for `unwrapResult`
3
3
  */
4
- interface UnwrapResultOptions {
4
+ type UnwrapResultOptions = {
5
5
  /**
6
6
  * If true, the text is trimmed before processing
7
7
  */
8
- isTrimmed?: boolean;
8
+ readonly isTrimmed?: boolean;
9
9
  /**
10
10
  * If true, the introduce sentence is removed
11
11
  *
@@ -15,8 +15,8 @@ interface UnwrapResultOptions {
15
15
  *
16
16
  * @default true
17
17
  */
18
- isIntroduceSentenceRemoved?: boolean;
19
- }
18
+ readonly isIntroduceSentenceRemoved?: boolean;
19
+ };
20
20
  /**
21
21
  * Removes quotes and optional introduce text from a string
22
22
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/legacy-documents",
3
- "version": "0.71.0-16",
3
+ "version": "0.71.0-18",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -11,6 +11,7 @@
11
11
  "contributors": [
12
12
  "Pavol Hejný <me@pavolhejny.com> (https://www.pavolhejny.com/)"
13
13
  ],
14
+ "todo-0": "TODO: [❇️] Make better list of keywords",
14
15
  "keywords": [
15
16
  "ai",
16
17
  "llm",
@@ -51,14 +52,14 @@
51
52
  "module": "./esm/index.es.js",
52
53
  "typings": "./esm/typings/src/_packages/legacy-documents.index.d.ts",
53
54
  "peerDependencies": {
54
- "@promptbook/core": "0.71.0-16"
55
+ "@promptbook/core": "0.71.0-18"
55
56
  },
56
57
  "dependencies": {
57
58
  "colors": "1.4.0",
58
59
  "crypto-js": "4.2.0",
59
60
  "papaparse": "5.4.1",
60
61
  "prettier": "2.8.1",
61
- "spacetrim": "0.11.39",
62
+ "spacetrim": "0.11.59",
62
63
  "waitasecond": "1.11.83"
63
64
  }
64
65
  }