@promptbook/legacy-documents 0.72.0-14 โ 0.72.0-23
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.
- package/README.md +1 -1
- package/esm/index.es.js +136 -136
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/cli.index.d.ts +0 -4
- package/esm/typings/src/_packages/core.index.d.ts +22 -20
- package/esm/typings/src/_packages/node.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +12 -10
- package/esm/typings/src/_packages/utils.index.d.ts +2 -2
- package/esm/typings/src/collection/PipelineCollection.d.ts +1 -1
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +2 -2
- package/esm/typings/src/collection/collectionToJson.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +5 -5
- package/esm/typings/src/config.d.ts +21 -14
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +12 -0
- package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +11 -0
- package/esm/typings/src/executables/apps/locatePandoc.d.ts +11 -0
- package/esm/typings/src/executables/locateApp.d.ts +33 -0
- package/esm/typings/src/executables/locateApp.test.d.ts +1 -0
- package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +12 -0
- package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +12 -0
- package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +12 -0
- package/esm/typings/src/execution/EmbeddingVector.d.ts +1 -1
- package/esm/typings/src/execution/Executables.d.ts +18 -0
- package/esm/typings/src/execution/ExecutionTools.d.ts +9 -3
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +2 -2
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +29 -6
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +2 -11
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +4 -13
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +9 -14
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -3
- package/esm/typings/src/execution/utils/addUsage.d.ts +1 -1
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +2 -2
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForCli.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +4 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +4 -5
- package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +0 -1
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Response.d.ts +3 -3
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Response.d.ts +2 -2
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +4 -23
- package/esm/typings/src/prepare/prepareTemplates.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +2 -9
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +2 -2
- package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +2 -2
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +3 -3
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +2 -2
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +1 -1
- package/esm/typings/src/types/Arrayable.d.ts +1 -1
- package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +7 -0
- package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +4 -4
- package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +2 -2
- package/esm/typings/src/types/Prompt.d.ts +1 -1
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +1 -1
- package/esm/typings/src/utils/$Register.d.ts +1 -1
- package/esm/typings/src/utils/FromtoItems.d.ts +1 -1
- package/esm/typings/src/utils/arrayableToArray.d.ts +1 -1
- package/esm/typings/src/utils/emojis.d.ts +1 -1
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -2
- package/esm/typings/src/utils/execCommand/{IExecCommandOptions.d.ts โ ExecCommandOptions.d.ts} +2 -6
- package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +3 -3
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
- package/esm/typings/src/utils/files/isExecutable.d.ts +11 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -1
- package/esm/typings/src/utils/normalization/IKeywords.d.ts +2 -2
- package/esm/typings/src/utils/normalization/parseKeywords.d.ts +2 -2
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +2 -2
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +2 -2
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -1
- package/esm/typings/src/utils/organization/keepUnused.d.ts +1 -1
- package/esm/typings/src/utils/random/$randomSeed.d.ts +1 -1
- package/esm/typings/src/utils/sets/intersection.d.ts +1 -1
- package/esm/typings/src/utils/sets/union.d.ts +1 -1
- package/esm/typings/src/utils/unwrapResult.d.ts +4 -4
- package/package.json +4 -3
- package/umd/index.umd.js +136 -136
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/_packages/website-crawler.index.d.ts +0 -8
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +0 -29
- package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +0 -47
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +0 -20
- package/esm/typings/src/scrapers/website/playground/website-scraper-playground.d.ts +0 -5
- package/esm/typings/src/scrapers/website/register-constructor.d.ts +0 -13
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +0 -24
- package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +0 -12
- /package/esm/typings/src/{scrapers/website/WebsiteScraper.test.d.ts โ executables/apps/locateLibreoffice.test.d.ts} +0 -0
- /package/esm/typings/src/{scrapers/website/utils/markdownConverter.test.d.ts โ executables/apps/locatePandoc.test.d.ts} +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PROMPTBOOK_VERSION } from '../version';
|
|
2
|
-
import { createWebsiteScraper } from '../scrapers/website/createWebsiteScraper';
|
|
3
|
-
import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
|
|
4
|
-
import { WebsiteScraper } from '../scrapers/website/WebsiteScraper';
|
|
5
|
-
export { PROMPTBOOK_VERSION };
|
|
6
|
-
export { createWebsiteScraper };
|
|
7
|
-
export { _WebsiteScraperRegistration };
|
|
8
|
-
export { WebsiteScraper };
|
package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { CsvSettings } from '../../formats/csv/CsvSettings';
|
|
2
|
-
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
3
|
-
export type CreatePipelineExecutorSettings = Omit<PrepareAndScrapeOptions, 'llmTools'> & {
|
|
4
|
-
/**
|
|
5
|
-
* When executor does not satisfy expectations it will be retried this amount of times
|
|
6
|
-
*
|
|
7
|
-
* @default MAX_EXECUTION_ATTEMPTS
|
|
8
|
-
*/
|
|
9
|
-
readonly maxExecutionAttempts: number;
|
|
10
|
-
/**
|
|
11
|
-
* Settings for CSV format
|
|
12
|
-
*
|
|
13
|
-
* @default DEFAULT_CSV_SETTINGS
|
|
14
|
-
*/
|
|
15
|
-
readonly csvSettings: CsvSettings;
|
|
16
|
-
/**
|
|
17
|
-
* If you pass fully prepared pipeline, this does not matter
|
|
18
|
-
*
|
|
19
|
-
* Otherwise:
|
|
20
|
-
* If false or not set, warning is shown when pipeline is not prepared
|
|
21
|
-
* If true, warning is suppressed
|
|
22
|
-
*
|
|
23
|
-
* @default false
|
|
24
|
-
*/
|
|
25
|
-
readonly isNotPreparedWarningSupressed: boolean;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* TODO: [๐คนโโ๏ธ] More granular setting for limits of execution + better waiting for queue
|
|
29
|
-
*/
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';
|
|
2
|
-
import type { string_markdown } from '../../types/typeAliases';
|
|
3
|
-
import type { Converter } from '../_common/Converter';
|
|
4
|
-
import type { Scraper } from '../_common/Scraper';
|
|
5
|
-
import type { ScraperSourceHandler } from '../_common/Scraper';
|
|
6
|
-
import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
7
|
-
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
8
|
-
import type { ScraperAndConverterMetadata } from '../_common/register/ScraperAndConverterMetadata';
|
|
9
|
-
import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
|
|
10
|
-
/**
|
|
11
|
-
* Scraper for .docx files
|
|
12
|
-
*
|
|
13
|
-
* @see `documentationUrl` for more details
|
|
14
|
-
* @public exported from `@promptbook/website-crawler`
|
|
15
|
-
*/
|
|
16
|
-
export declare class WebsiteScraper implements Converter, Scraper {
|
|
17
|
-
private readonly tools;
|
|
18
|
-
private readonly options;
|
|
19
|
-
/**
|
|
20
|
-
* Metadata of the scraper which includes title, mime types, etc.
|
|
21
|
-
*/
|
|
22
|
-
get metadata(): ScraperAndConverterMetadata;
|
|
23
|
-
/**
|
|
24
|
-
* Markdown scraper is used internally
|
|
25
|
-
*/
|
|
26
|
-
private readonly markdownScraper;
|
|
27
|
-
constructor(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options: PrepareAndScrapeOptions);
|
|
28
|
-
/**
|
|
29
|
-
* Convert the website to `.md` file and returns intermediate source
|
|
30
|
-
*
|
|
31
|
-
* Note: `$` is used to indicate that this function is not a pure function - it leaves files on the disk and you are responsible for cleaning them by calling `destroy` method of returned object
|
|
32
|
-
*/
|
|
33
|
-
$convert(source: ScraperSourceHandler): Promise<ScraperIntermediateSource & {
|
|
34
|
-
markdown: string_markdown;
|
|
35
|
-
}>;
|
|
36
|
-
/**
|
|
37
|
-
* Scrapes the website and returns the knowledge pieces or `null` if it can't scrape it
|
|
38
|
-
*/
|
|
39
|
-
scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* TODO: !!!!!! Put into separate package
|
|
43
|
-
* TODO: [๐ฃ] Scraped website in .md can act as cache item - there is no need to run conversion each time
|
|
44
|
-
* TODO: [๐ช] Do it in parallel 11:11
|
|
45
|
-
* Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
46
|
-
* Note: [๐ข] Code in this file should never be never released in packages that could be imported into browser environment
|
|
47
|
-
*/
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
2
|
-
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
3
|
-
import { WebsiteScraper } from './WebsiteScraper';
|
|
4
|
-
/**
|
|
5
|
-
* @@@
|
|
6
|
-
*
|
|
7
|
-
* @public exported from `@promptbook/website-crawler`
|
|
8
|
-
*/
|
|
9
|
-
export declare const createWebsiteScraper: ((tools: Pick<ExecutionTools, 'llm'>, options: PrepareAndScrapeOptions) => WebsiteScraper) & import("type-fest/source/readonly-deep").ReadonlyObjectDeep<{
|
|
10
|
-
title: string;
|
|
11
|
-
packageName: string;
|
|
12
|
-
className: string;
|
|
13
|
-
mimeTypes: string[];
|
|
14
|
-
documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
15
|
-
isAvilableInBrowser: false;
|
|
16
|
-
requiredExecutables: string[];
|
|
17
|
-
}>;
|
|
18
|
-
/**
|
|
19
|
-
* TODO: [๐ถ] Naming "constructor" vs "creator" vs "factory"
|
|
20
|
-
*/
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Registration } from '../../utils/$Register';
|
|
2
|
-
/**
|
|
3
|
-
* Registration of known scraper
|
|
4
|
-
*
|
|
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
|
-
*
|
|
7
|
-
* @public exported from `@promptbook/website-crawler`
|
|
8
|
-
* @public exported from `@promptbook/cli`
|
|
9
|
-
*/
|
|
10
|
-
export declare const _WebsiteScraperRegistration: Registration;
|
|
11
|
-
/**
|
|
12
|
-
* TODO: [๐ถ] Naming "constructor" vs "creator" vs "factory"
|
|
13
|
-
*/
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Registration } from '../../utils/$Register';
|
|
2
|
-
/**
|
|
3
|
-
* Metadata of the scraper
|
|
4
|
-
*
|
|
5
|
-
* @private within the scraper directory
|
|
6
|
-
*/
|
|
7
|
-
export declare const websiteScraperMetadata: import("type-fest/source/readonly-deep").ReadonlyObjectDeep<{
|
|
8
|
-
title: string;
|
|
9
|
-
packageName: string;
|
|
10
|
-
className: string;
|
|
11
|
-
mimeTypes: string[];
|
|
12
|
-
documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
13
|
-
isAvilableInBrowser: false;
|
|
14
|
-
requiredExecutables: string[];
|
|
15
|
-
}>;
|
|
16
|
-
/**
|
|
17
|
-
* Registration of known scraper metadata
|
|
18
|
-
*
|
|
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
|
-
*
|
|
21
|
-
* @public exported from `@promptbook/core`
|
|
22
|
-
* @public exported from `@promptbook/cli`
|
|
23
|
-
*/
|
|
24
|
-
export declare const _WebsiteScraperMetadataRegistration: Registration;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Converter } from 'showdown';
|
|
2
|
-
/**
|
|
3
|
-
* A converter instance that uses showdown and highlight extensions
|
|
4
|
-
*
|
|
5
|
-
* @type {Converter}
|
|
6
|
-
* @private for markdown and html knowledge scrapers
|
|
7
|
-
*/
|
|
8
|
-
export declare const markdownConverter: Converter;
|
|
9
|
-
/**
|
|
10
|
-
* TODO: !!!!!! Figure out better name not to confuse with `Converter`
|
|
11
|
-
* TODO: !!!!!! Lazy-make converter
|
|
12
|
-
*/
|
|
File without changes
|