@promptbook/browser 0.92.0-23 → 0.92.0-25
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/esm/index.es.js +20 -14
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +0 -2
- package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -28
- package/esm/typings/src/config.d.ts +8 -4
- package/esm/typings/src/constants.d.ts +2 -2
- package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
- package/esm/typings/src/execution/CommonToolsOptions.d.ts +3 -3
- package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +10 -10
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
- package/esm/typings/src/formfactors/index.d.ts +1 -1
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +5 -5
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +5 -3
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
- package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +9 -6
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
- package/esm/typings/src/prepare/prepareTasks.d.ts +7 -4
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +2 -1
- package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
- package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
- package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
- package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
- package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
- package/esm/typings/src/types/ModelVariant.d.ts +5 -5
- package/esm/typings/src/types/typeAliases.d.ts +8 -6
- package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
- package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
- package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
- package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
- package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
- package/esm/typings/src/version.d.ts +2 -1
- package/package.json +2 -2
- package/umd/index.umd.js +20 -14
- package/umd/index.umd.js.map +1 -1
|
@@ -2,7 +2,7 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
|
2
2
|
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
3
3
|
import { MarkdownScraper } from './MarkdownScraper';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Creates a scraper for markdown content.
|
|
6
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/markdown-utils`
|
|
8
8
|
*/
|
|
@@ -13,6 +13,9 @@ export declare const createMarkdownScraper: ((tools: Pick<ExecutionTools, 'llm'>
|
|
|
13
13
|
mimeTypes: string[];
|
|
14
14
|
documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
15
15
|
isAvilableInBrowser: true;
|
|
16
|
+
/**
|
|
17
|
+
* TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
|
|
18
|
+
*/
|
|
16
19
|
requiredExecutables: never[];
|
|
17
20
|
}>;
|
|
18
21
|
/**
|
|
@@ -37,7 +37,7 @@ export declare class MarkitdownScraper implements Converter, Scraper {
|
|
|
37
37
|
*/
|
|
38
38
|
$convert(source: ScraperSourceHandler): Promise<ScraperIntermediateSource>;
|
|
39
39
|
/**
|
|
40
|
-
* Scrapes the
|
|
40
|
+
* Scrapes the source document (PDF, DOCX, etc.) and returns the knowledge pieces or `null` if it can't scrape it.
|
|
41
41
|
*/
|
|
42
42
|
scrape(source: ScraperSourceHandler): Promise<ReadonlyArray<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
|
|
43
43
|
}
|
|
@@ -2,7 +2,8 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
|
2
2
|
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
3
3
|
import { PdfScraper } from './PdfScraper';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Factory function to create an instance of PdfScraper.
|
|
6
|
+
* It bundles the scraper class with its metadata.
|
|
6
7
|
*
|
|
7
8
|
* @public exported from `@promptbook/pdf`
|
|
8
9
|
*/
|
|
@@ -2,7 +2,8 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
|
2
2
|
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
3
3
|
import { WebsiteScraper } from './WebsiteScraper';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Factory function to create an instance of WebsiteScraper.
|
|
6
|
+
* It bundles the scraper class with its metadata.
|
|
6
7
|
*
|
|
7
8
|
* @public exported from `@promptbook/website-crawler`
|
|
8
9
|
*/
|
|
@@ -12,9 +13,7 @@ export declare const createWebsiteScraper: ((tools: Pick<ExecutionTools, 'llm'>,
|
|
|
12
13
|
className: string;
|
|
13
14
|
mimeTypes: string[];
|
|
14
15
|
documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
15
|
-
isAvilableInBrowser: false;
|
|
16
|
-
* TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
|
|
17
|
-
*/
|
|
16
|
+
isAvilableInBrowser: false;
|
|
18
17
|
requiredExecutables: never[];
|
|
19
18
|
}>;
|
|
20
19
|
/**
|
|
@@ -18,7 +18,11 @@ import { trimCodeBlock } from '../../utils/trimCodeBlock';
|
|
|
18
18
|
import { trimEndOfCodeBlock } from '../../utils/trimEndOfCodeBlock';
|
|
19
19
|
import { unwrapResult } from '../../utils/unwrapResult';
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Collection of utility functions that can be used for post-processing model outputs.
|
|
22
|
+
* These functions help transform, extract, or format the raw model responses.
|
|
23
|
+
*
|
|
24
|
+
* These utilities range from simple string manipulations to markdown processing
|
|
25
|
+
* and formatting functions for specific types of output.
|
|
22
26
|
*
|
|
23
27
|
* @public exported from `@promptbook/javascript`
|
|
24
28
|
*/
|
|
@@ -2,7 +2,10 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
|
2
2
|
import type { PromptbookStorage } from '../_common/PromptbookStorage';
|
|
3
3
|
import type { FileCacheStorageOptions } from './FileCacheStorageOptions';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A storage implementation that caches data in files organized in a directory structure.
|
|
6
|
+
* Provides methods for retrieving, storing, and managing cached data on the filesystem.
|
|
7
|
+
*
|
|
8
|
+
* This class implements the PromptbookStorage interface for filesystem-based caching.
|
|
6
9
|
*
|
|
7
10
|
* @public exported from `@promptbook/node`
|
|
8
11
|
*/
|
|
@@ -11,19 +14,23 @@ export declare class FileCacheStorage<TItem> implements PromptbookStorage<TItem>
|
|
|
11
14
|
private readonly options;
|
|
12
15
|
constructor(tools: Required<Pick<ExecutionTools, 'fs'>>, options: FileCacheStorageOptions);
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
17
|
+
* Converts a storage key to a filesystem path where the data should be stored.
|
|
18
|
+
* Creates a consistent, deterministic file path based on the key string.
|
|
15
19
|
*/
|
|
16
20
|
private getFilenameForKey;
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
22
|
+
* Returns the current value associated with the given key, or null if the given key does not exist.
|
|
23
|
+
* Retrieves the cached data from the file system storage.
|
|
19
24
|
*/
|
|
20
25
|
getItem(key: string): Promise<TItem | null>;
|
|
21
26
|
/**
|
|
22
|
-
*
|
|
27
|
+
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
|
|
28
|
+
* Persists data to the file system, creating necessary directory structure if it doesn't exist.
|
|
23
29
|
*/
|
|
24
30
|
setItem(key: string, value: TItem): Promise<void>;
|
|
25
31
|
/**
|
|
26
|
-
*
|
|
32
|
+
* Removes the key/value pair with the given key from the storage, if a key/value pair with the given key exists.
|
|
33
|
+
* Deletes the corresponding file from the filesystem.
|
|
27
34
|
*/
|
|
28
35
|
removeItem(key: string): Promise<void>;
|
|
29
36
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { string_dirname } from '../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Configuration options for the FileCacheStorage implementation.
|
|
4
|
+
* Defines how and where file cache data should be stored and managed.
|
|
4
5
|
*/
|
|
5
6
|
export type FileCacheStorageOptions = {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* The absolute path to the root directory where cache files will be stored.
|
|
9
|
+
* This directory must exist and be writable by the application.
|
|
8
10
|
*/
|
|
9
11
|
rootFolderPath: string_dirname;
|
|
10
12
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { string_name } from '../../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Converts a name to a properly formatted subfolder path for cache storage.
|
|
4
|
+
* Handles normalization and path formatting to create consistent cache directory structures.
|
|
4
5
|
*
|
|
5
6
|
* @private for `FileCacheStorage`
|
|
6
7
|
*/
|
package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PromptbookStorage } from '../../_common/PromptbookStorage';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Creates a Promptbook storage interface from a web storage object.
|
|
4
|
+
* Facilitates using Web Storage (localStorage/sessionStorage) as a storage backend.
|
|
4
5
|
*
|
|
5
6
|
* @private for `getLocalStorage` and `getSessionStorage`
|
|
6
7
|
*/
|
|
@@ -2,14 +2,14 @@ import type { TupleToUnion } from 'type-fest';
|
|
|
2
2
|
/**
|
|
3
3
|
* Model variant describes the very general type of the model
|
|
4
4
|
*
|
|
5
|
-
* There are
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
5
|
+
* There are theese supported model variants:
|
|
6
|
+
* - `COMPLETION` - Model that takes prompt and writes the rest of the text
|
|
7
|
+
* - `CHAT` - Model that takes prompt and previous messages and returns response
|
|
8
|
+
* - `EMBEDDING` - Model that convert text into vector representations
|
|
8
9
|
*/
|
|
9
10
|
export type ModelVariant = TupleToUnion<typeof MODEL_VARIANTS>;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
12
|
+
* @see {@link ModelVariant}
|
|
13
13
|
* @public exported from `@promptbook/core`
|
|
14
14
|
*/
|
|
15
15
|
export declare const MODEL_VARIANTS: readonly ["COMPLETION", "CHAT", "EMBEDDING"];
|
|
@@ -149,27 +149,29 @@ export type string_persona_description = string;
|
|
|
149
149
|
*/
|
|
150
150
|
export type string_model_description = string;
|
|
151
151
|
/**
|
|
152
|
-
* Source of one knowledge
|
|
152
|
+
* Source of one knowledge piece.
|
|
153
153
|
*
|
|
154
|
-
* It can be a link, a relative path to file or direct text
|
|
154
|
+
* It can be a link, a relative path to file or direct text content.
|
|
155
155
|
*
|
|
156
156
|
* For example `"https://pavolhejny.com/"`
|
|
157
157
|
* For example `"./pavol-hejny-cv.pdf"`
|
|
158
158
|
* For example `"Pavol Hejný has web https://pavolhejny.com/"`
|
|
159
159
|
* For example `"Pavol Hejný is web developer and creator of Promptbook and Collboard"`
|
|
160
160
|
*
|
|
161
|
-
*
|
|
161
|
+
* Note: Distinguishes between `string_knowledge_source_content` and `string_knowledge_source_link`:
|
|
162
|
+
* `string_knowledge_source_content` refers to the actual content or source of knowledge
|
|
163
|
+
* `string_knowledge_source_link` refers to a reference or link to the knowledge source
|
|
162
164
|
*/
|
|
163
165
|
export type string_knowledge_source_content = string_knowledge_source_link | string_markdown;
|
|
164
166
|
/**
|
|
165
|
-
* One link to knowledge source
|
|
167
|
+
* One link to a knowledge source.
|
|
166
168
|
*
|
|
167
|
-
* It can be a
|
|
169
|
+
* It can be a URL or relative path.
|
|
168
170
|
*
|
|
169
171
|
* For example `"https://pavolhejny.com/"`
|
|
170
172
|
* For example `"./pavol-hejny-cv.pdf"`
|
|
171
173
|
*
|
|
172
|
-
*
|
|
174
|
+
* Note: string_knowledge_source_link refers to a reference or link to the knowledge source, while string_knowledge_source_content can be the link or the actual content.
|
|
173
175
|
*/
|
|
174
176
|
export type string_knowledge_source_link = string_url | string_filename;
|
|
175
177
|
/**
|
|
@@ -5,7 +5,7 @@ type AddPipelineCommandOptions = {
|
|
|
5
5
|
pipelineString: PipelineString;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Adds a new command to a pipeline string in the correct format.
|
|
9
9
|
*
|
|
10
10
|
* @public exported from `@promptbook/editable`
|
|
11
11
|
*/
|
|
@@ -14,4 +14,4 @@ export {};
|
|
|
14
14
|
/**
|
|
15
15
|
* TODO: [🧠] What is the better solution - `- xxx`, - `- xxx` or preserve (see also next TODO)
|
|
16
16
|
* TODO: When existing commands 1) as 2) number 3) list, add 4) new command as next number
|
|
17
|
-
*/
|
|
17
|
+
*/
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { PipelineString } from '../../../pipeline/PipelineString';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Converts a pipeline structure to its string representation.
|
|
4
|
+
*
|
|
5
|
+
* Transforms a flat, simple pipeline into a properly formatted pipeline string
|
|
6
|
+
* with sections for title, prompt, and return statement.
|
|
4
7
|
*
|
|
5
8
|
* @public exported from `@promptbook/editable`
|
|
6
9
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PipelineString } from '../../../pipeline/PipelineString';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Utility to determine if a pipeline string is in flat format.
|
|
4
|
+
* A flat pipeline is a simple text without proper structure (headers, blocks, etc).
|
|
4
5
|
*
|
|
5
6
|
* @public exported from `@promptbook/editable`
|
|
6
7
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { really_any } from '../organization/really_any';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
4
|
+
* regardless of the JavaScript environment in which the code is running
|
|
4
5
|
*
|
|
5
6
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
6
7
|
*
|
|
@@ -9,7 +9,7 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
9
9
|
* Note: It can not work with html syntax and comments
|
|
10
10
|
*
|
|
11
11
|
* @param markdown any valid markdown
|
|
12
|
-
* @returns
|
|
12
|
+
* @returns An array of strings, each representing an individual list item found in the markdown
|
|
13
13
|
* @public exported from `@promptbook/markdown-utils`
|
|
14
14
|
*/
|
|
15
15
|
export declare function extractAllListItemsFromMarkdown(markdown: string_markdown): string_markdown_text[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Converts a name string into a URI-compatible format.
|
|
3
3
|
*
|
|
4
|
-
* @param name
|
|
5
|
-
* @returns
|
|
6
|
-
* @example
|
|
4
|
+
* @param name The string to be converted to a URI-compatible format.
|
|
5
|
+
* @returns A URI-compatible string derived from the input name.
|
|
6
|
+
* @example 'Hello World' -> 'hello-world'
|
|
7
7
|
* @public exported from `@promptbook/utils`
|
|
8
8
|
*/
|
|
9
9
|
export declare function nameToUriPart(name: string): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Converts a given name into URI-compatible parts.
|
|
3
3
|
*
|
|
4
|
-
* @param name
|
|
5
|
-
* @returns
|
|
6
|
-
* @example
|
|
4
|
+
* @param name The name to be converted into URI parts.
|
|
5
|
+
* @returns An array of URI-compatible parts derived from the name.
|
|
6
|
+
* @example 'Example Name' -> ['example', 'name']
|
|
7
7
|
* @public exported from `@promptbook/utils`
|
|
8
8
|
*/
|
|
9
9
|
export declare function nameToUriParts(name: string): string[];
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export type string_kebab_case = string;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Converts a given text to kebab-case format.
|
|
11
11
|
*
|
|
12
|
-
* @param text
|
|
13
|
-
* @returns
|
|
12
|
+
* @param text The text to be converted.
|
|
13
|
+
* @returns The kebab-case formatted string.
|
|
14
14
|
* @example 'hello-world'
|
|
15
15
|
* @example 'i-love-promptbook'
|
|
16
16
|
* @public exported from `@promptbook/utils`
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export type string_SCREAMING_CASE = string;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
|
|
11
11
|
*
|
|
12
|
-
* @param text
|
|
13
|
-
* @returns
|
|
12
|
+
* @param text The text string to be converted to SCREAMING_CASE format.
|
|
13
|
+
* @returns The normalized text in SCREAMING_CASE format.
|
|
14
14
|
* @example 'HELLO_WORLD'
|
|
15
15
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
16
16
|
* @public exported from `@promptbook/utils`
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export type string_camelCase = string;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Normalizes a given text to camelCase format.
|
|
11
11
|
*
|
|
12
|
-
* @param text
|
|
13
|
-
* @param _isFirstLetterCapital
|
|
14
|
-
* @returns
|
|
12
|
+
* @param text The text to be normalized.
|
|
13
|
+
* @param _isFirstLetterCapital Whether the first letter should be capitalized.
|
|
14
|
+
* @returns The camelCase formatted string.
|
|
15
15
|
* @example 'helloWorld'
|
|
16
16
|
* @example 'iLovePromptbook'
|
|
17
17
|
* @public exported from `@promptbook/utils`
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type string_snake_case = string;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Normalizes a text string to snake_case format.
|
|
10
10
|
*
|
|
11
|
-
* @param text
|
|
12
|
-
* @returns
|
|
11
|
+
* @param text The text string to be converted to snake_case format.
|
|
12
|
+
* @returns The normalized text in snake_case format.
|
|
13
13
|
* @example 'hello_world'
|
|
14
14
|
* @example 'i_love_promptbook'
|
|
15
15
|
* @public exported from `@promptbook/utils`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Removes diacritic marks (accents) from characters in a string.
|
|
3
3
|
*
|
|
4
|
-
* @param input
|
|
5
|
-
* @returns
|
|
4
|
+
* @param input The string containing diacritics to be normalized.
|
|
5
|
+
* @returns The string with diacritics removed or normalized.
|
|
6
6
|
* @public exported from `@promptbook/utils`
|
|
7
7
|
*/
|
|
8
8
|
export declare function removeDiacritics(input: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Keywords } from './IKeywords';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Searches set of keywords for a specific keyword
|
|
4
4
|
*
|
|
5
5
|
* @param haystack
|
|
6
6
|
* @param needle
|
|
@@ -8,3 +8,6 @@ import type { Keywords } from './IKeywords';
|
|
|
8
8
|
* @public exported from `@promptbook/utils`
|
|
9
9
|
*/
|
|
10
10
|
export declare function searchKeywords(haystack: Keywords, needle: Keywords): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* TODO: Rename to `isKeywordInKeywords`
|
|
13
|
+
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Converts a title string into a normalized name.
|
|
3
3
|
*
|
|
4
|
-
* @param value
|
|
5
|
-
* @returns
|
|
6
|
-
* @example
|
|
4
|
+
* @param value The title string to be converted to a name.
|
|
5
|
+
* @returns A normalized name derived from the input title.
|
|
6
|
+
* @example 'Hello World!' -> 'hello-world'
|
|
7
7
|
* @public exported from `@promptbook/utils`
|
|
8
8
|
*/
|
|
9
9
|
export declare function titleToName(value: string): string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Organizational helper to better mark the place where to really use empty object `{}`
|
|
3
3
|
*
|
|
4
4
|
* Note: There are 2 similar types>
|
|
5
|
-
* - `empty_object`
|
|
6
|
-
* - `just_empty_object`
|
|
5
|
+
* - `empty_object` Type used for empty data objects allowing for potential future extensions
|
|
6
|
+
* - `just_empty_object` Type used when an object must remain permanently empty
|
|
7
7
|
*
|
|
8
8
|
* @private within the repository
|
|
9
9
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Organizational helper to better
|
|
2
|
+
* Organizational helper to better distinguish different empty object use cases.
|
|
3
3
|
*
|
|
4
|
-
* Note: There are 2 similar types
|
|
5
|
-
* - `empty_object`
|
|
6
|
-
* - `just_empty_object`
|
|
4
|
+
* Note: There are 2 similar types:
|
|
5
|
+
* - `empty_object` Type used for empty data objects with potential extensions
|
|
6
|
+
* - `just_empty_object` Type used specifically for objects that must remain empty
|
|
7
7
|
*
|
|
8
8
|
* Note: In most cases, you should use `empty_object`
|
|
9
9
|
*
|
|
@@ -14,7 +14,8 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Represents the version string of the Promptbook engine.
|
|
18
|
+
* It follows semantic versioning (e.g., `0.92.0-24`).
|
|
18
19
|
*
|
|
19
20
|
* @generated
|
|
20
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/browser",
|
|
3
|
-
"version": "0.92.0-
|
|
3
|
+
"version": "0.92.0-25",
|
|
4
4
|
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"module": "./esm/index.es.js",
|
|
52
52
|
"typings": "./esm/typings/src/_packages/browser.index.d.ts",
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@promptbook/core": "0.92.0-
|
|
54
|
+
"@promptbook/core": "0.92.0-25"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"crypto": "1.0.1",
|
package/umd/index.umd.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @generated
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-25';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -288,7 +288,8 @@
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
/**
|
|
291
|
-
*
|
|
291
|
+
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
292
|
+
* regardless of the JavaScript environment in which the code is running
|
|
292
293
|
*
|
|
293
294
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
294
295
|
*
|
|
@@ -299,10 +300,10 @@
|
|
|
299
300
|
}
|
|
300
301
|
|
|
301
302
|
/**
|
|
302
|
-
*
|
|
303
|
+
* Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
|
|
303
304
|
*
|
|
304
|
-
* @param text
|
|
305
|
-
* @returns
|
|
305
|
+
* @param text The text string to be converted to SCREAMING_CASE format.
|
|
306
|
+
* @returns The normalized text in SCREAMING_CASE format.
|
|
306
307
|
* @example 'HELLO_WORLD'
|
|
307
308
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
308
309
|
* @public exported from `@promptbook/utils`
|
|
@@ -354,10 +355,10 @@
|
|
|
354
355
|
*/
|
|
355
356
|
|
|
356
357
|
/**
|
|
357
|
-
*
|
|
358
|
+
* Normalizes a text string to snake_case format.
|
|
358
359
|
*
|
|
359
|
-
* @param text
|
|
360
|
-
* @returns
|
|
360
|
+
* @param text The text string to be converted to snake_case format.
|
|
361
|
+
* @returns The normalized text in snake_case format.
|
|
361
362
|
* @example 'hello_world'
|
|
362
363
|
* @example 'i_love_promptbook'
|
|
363
364
|
* @public exported from `@promptbook/utils`
|
|
@@ -415,10 +416,11 @@
|
|
|
415
416
|
}
|
|
416
417
|
|
|
417
418
|
/**
|
|
418
|
-
*
|
|
419
|
+
* Registry for all available scrapers in the system.
|
|
420
|
+
* Central point for registering and accessing different types of content scrapers.
|
|
419
421
|
*
|
|
420
422
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
421
|
-
* @singleton Only one instance of each register is created per build, but
|
|
423
|
+
* @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
|
|
422
424
|
* @public exported from `@promptbook/core`
|
|
423
425
|
*/
|
|
424
426
|
const $scrapersRegister = new $Register('scraper_constructors');
|
|
@@ -427,10 +429,13 @@
|
|
|
427
429
|
*/
|
|
428
430
|
|
|
429
431
|
/**
|
|
430
|
-
*
|
|
432
|
+
* Provides a collection of scrapers optimized for browser environments.
|
|
433
|
+
* Only includes scrapers that can safely run in a browser context.
|
|
431
434
|
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
435
|
+
* Note: Browser scrapers have limitations compared to Node.js scrapers.
|
|
436
|
+
*
|
|
437
|
+
* 1) `provideScrapersForNode` use as default
|
|
438
|
+
* 2) `provideScrapersForBrowser` use in limited browser environment
|
|
434
439
|
*
|
|
435
440
|
* @public exported from `@promptbook/browser`
|
|
436
441
|
*/
|
|
@@ -938,7 +943,8 @@
|
|
|
938
943
|
*/
|
|
939
944
|
|
|
940
945
|
/**
|
|
941
|
-
*
|
|
946
|
+
* Creates a Promptbook storage interface from a web storage object.
|
|
947
|
+
* Facilitates using Web Storage (localStorage/sessionStorage) as a storage backend.
|
|
942
948
|
*
|
|
943
949
|
* @private for `getLocalStorage` and `getSessionStorage`
|
|
944
950
|
*/
|