@promptbook/remote-client 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 +45 -31
- 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 +45 -31
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
20
20
|
* @generated
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
23
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-25';
|
|
24
24
|
/**
|
|
25
25
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
26
26
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -993,10 +993,10 @@ for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
|
|
|
993
993
|
*/
|
|
994
994
|
|
|
995
995
|
/**
|
|
996
|
-
*
|
|
996
|
+
* Removes diacritic marks (accents) from characters in a string.
|
|
997
997
|
*
|
|
998
|
-
* @param input
|
|
999
|
-
* @returns
|
|
998
|
+
* @param input The string containing diacritics to be normalized.
|
|
999
|
+
* @returns The string with diacritics removed or normalized.
|
|
1000
1000
|
* @public exported from `@promptbook/utils`
|
|
1001
1001
|
*/
|
|
1002
1002
|
function removeDiacritics(input) {
|
|
@@ -1010,10 +1010,10 @@ function removeDiacritics(input) {
|
|
|
1010
1010
|
*/
|
|
1011
1011
|
|
|
1012
1012
|
/**
|
|
1013
|
-
*
|
|
1013
|
+
* Converts a given text to kebab-case format.
|
|
1014
1014
|
*
|
|
1015
|
-
* @param text
|
|
1016
|
-
* @returns
|
|
1015
|
+
* @param text The text to be converted.
|
|
1016
|
+
* @returns The kebab-case formatted string.
|
|
1017
1017
|
* @example 'hello-world'
|
|
1018
1018
|
* @example 'i-love-promptbook'
|
|
1019
1019
|
* @public exported from `@promptbook/utils`
|
|
@@ -1926,6 +1926,15 @@ const CsvFormatParser = {
|
|
|
1926
1926
|
mappedData.push(mappedRow);
|
|
1927
1927
|
if (onProgress) {
|
|
1928
1928
|
// Note: Report the CSV with all rows mapped so far
|
|
1929
|
+
/*
|
|
1930
|
+
!!!!
|
|
1931
|
+
// Report progress with updated value
|
|
1932
|
+
const progressData = mappedData.map((row, i) =>
|
|
1933
|
+
i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
|
|
1934
|
+
);
|
|
1935
|
+
|
|
1936
|
+
|
|
1937
|
+
*/
|
|
1929
1938
|
await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
1930
1939
|
}
|
|
1931
1940
|
}
|
|
@@ -2135,10 +2144,10 @@ const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser,
|
|
|
2135
2144
|
*/
|
|
2136
2145
|
|
|
2137
2146
|
/**
|
|
2138
|
-
*
|
|
2147
|
+
* Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
|
|
2139
2148
|
*
|
|
2140
|
-
* @param text
|
|
2141
|
-
* @returns
|
|
2149
|
+
* @param text The text string to be converted to SCREAMING_CASE format.
|
|
2150
|
+
* @returns The normalized text in SCREAMING_CASE format.
|
|
2142
2151
|
* @example 'HELLO_WORLD'
|
|
2143
2152
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
2144
2153
|
* @public exported from `@promptbook/utils`
|
|
@@ -2475,11 +2484,11 @@ const RESERVED_PARAMETER_NAMES = exportJson({
|
|
|
2475
2484
|
*/
|
|
2476
2485
|
|
|
2477
2486
|
/**
|
|
2478
|
-
*
|
|
2487
|
+
* Normalizes a given text to camelCase format.
|
|
2479
2488
|
*
|
|
2480
|
-
* @param text
|
|
2481
|
-
* @param _isFirstLetterCapital
|
|
2482
|
-
* @returns
|
|
2489
|
+
* @param text The text to be normalized.
|
|
2490
|
+
* @param _isFirstLetterCapital Whether the first letter should be capitalized.
|
|
2491
|
+
* @returns The camelCase formatted string.
|
|
2483
2492
|
* @example 'helloWorld'
|
|
2484
2493
|
* @example 'iLovePromptbook'
|
|
2485
2494
|
* @public exported from `@promptbook/utils`
|
|
@@ -2983,7 +2992,7 @@ const GeneratorFormfactorDefinition = {
|
|
|
2983
2992
|
};
|
|
2984
2993
|
|
|
2985
2994
|
/**
|
|
2986
|
-
*
|
|
2995
|
+
* Pipeline interface which is equivalent to `any`
|
|
2987
2996
|
*
|
|
2988
2997
|
* @see https://github.com/webgptorg/promptbook/discussions/171
|
|
2989
2998
|
*
|
|
@@ -3064,14 +3073,15 @@ const MatcherFormfactorDefinition = {
|
|
|
3064
3073
|
};
|
|
3065
3074
|
|
|
3066
3075
|
/**
|
|
3067
|
-
* Sheets is form of app that
|
|
3076
|
+
* Sheets is form of app that processes tabular data in CSV format, allowing transformation
|
|
3077
|
+
* and analysis of structured data through AI-powered operations
|
|
3068
3078
|
*
|
|
3069
3079
|
* @public exported from `@promptbook/core`
|
|
3070
3080
|
*/
|
|
3071
3081
|
const SheetsFormfactorDefinition = {
|
|
3072
3082
|
name: 'SHEETS',
|
|
3073
3083
|
aliasNames: ['SHEETS', 'SHEET'],
|
|
3074
|
-
description:
|
|
3084
|
+
description: `A formfactor for processing spreadsheet-like data in CSV format, enabling AI transformations on tabular data`,
|
|
3075
3085
|
documentationUrl: `https://github.com/webgptorg/promptbook/discussions/176`,
|
|
3076
3086
|
pipelineInterface: {
|
|
3077
3087
|
inputParameters: [
|
|
@@ -3147,7 +3157,7 @@ const FORMFACTOR_DEFINITIONS = [
|
|
|
3147
3157
|
/**
|
|
3148
3158
|
* Parses the formfactor command
|
|
3149
3159
|
*
|
|
3150
|
-
* Note:
|
|
3160
|
+
* Note: This command is used as a formfactor for new commands and defines the app type format - it should NOT be used in any `.book` file
|
|
3151
3161
|
*
|
|
3152
3162
|
* @see `documentationUrl` for more details
|
|
3153
3163
|
* @public exported from `@promptbook/editable`
|
|
@@ -3169,7 +3179,7 @@ const formfactorCommandParser = {
|
|
|
3169
3179
|
/**
|
|
3170
3180
|
* Description of the FORMFACTOR command
|
|
3171
3181
|
*/
|
|
3172
|
-
description:
|
|
3182
|
+
description: `Specifies the application type and interface requirements that this promptbook should conform to`,
|
|
3173
3183
|
/**
|
|
3174
3184
|
* Link to documentation
|
|
3175
3185
|
*/
|
|
@@ -3312,8 +3322,7 @@ const jokerCommandParser = {
|
|
|
3312
3322
|
};
|
|
3313
3323
|
|
|
3314
3324
|
/**
|
|
3315
|
-
*
|
|
3316
|
-
*
|
|
3325
|
+
* @see {@link ModelVariant}
|
|
3317
3326
|
* @public exported from `@promptbook/core`
|
|
3318
3327
|
*/
|
|
3319
3328
|
const MODEL_VARIANTS = ['COMPLETION', 'CHAT', 'EMBEDDING' /* <- TODO [🏳] */ /* <- [🤖] */];
|
|
@@ -4318,7 +4327,7 @@ function parseCommandVariant(input) {
|
|
|
4318
4327
|
}
|
|
4319
4328
|
|
|
4320
4329
|
/**
|
|
4321
|
-
*
|
|
4330
|
+
* Extracts the interface (input and output parameters) from a pipeline.
|
|
4322
4331
|
*
|
|
4323
4332
|
* @deprecated https://github.com/webgptorg/promptbook/pull/186
|
|
4324
4333
|
* @see https://github.com/webgptorg/promptbook/discussions/171
|
|
@@ -4351,7 +4360,7 @@ function getPipelineInterface(pipeline) {
|
|
|
4351
4360
|
}
|
|
4352
4361
|
|
|
4353
4362
|
/**
|
|
4354
|
-
*
|
|
4363
|
+
* Checks if two pipeline interfaces are structurally identical.
|
|
4355
4364
|
*
|
|
4356
4365
|
* @deprecated https://github.com/webgptorg/promptbook/pull/186
|
|
4357
4366
|
* @see https://github.com/webgptorg/promptbook/discussions/171
|
|
@@ -4383,10 +4392,11 @@ function isPipelineInterfacesEqual(pipelineInterface1, pipelineInterface2) {
|
|
|
4383
4392
|
}
|
|
4384
4393
|
|
|
4385
4394
|
/**
|
|
4386
|
-
*
|
|
4395
|
+
* Checks if a given pipeline satisfies the requirements of a specified pipeline interface.
|
|
4387
4396
|
*
|
|
4388
4397
|
* @deprecated https://github.com/webgptorg/promptbook/pull/186
|
|
4389
4398
|
* @see https://github.com/webgptorg/promptbook/discussions/171
|
|
4399
|
+
* @returns `true` if the pipeline implements the interface, `false` otherwise.
|
|
4390
4400
|
*
|
|
4391
4401
|
* @public exported from `@promptbook/core`
|
|
4392
4402
|
*/
|
|
@@ -4616,7 +4626,8 @@ function removeMarkdownComments(content) {
|
|
|
4616
4626
|
}
|
|
4617
4627
|
|
|
4618
4628
|
/**
|
|
4619
|
-
*
|
|
4629
|
+
* Utility to determine if a pipeline string is in flat format.
|
|
4630
|
+
* A flat pipeline is a simple text without proper structure (headers, blocks, etc).
|
|
4620
4631
|
*
|
|
4621
4632
|
* @public exported from `@promptbook/editable`
|
|
4622
4633
|
*/
|
|
@@ -4637,7 +4648,10 @@ function isFlatPipeline(pipelineString) {
|
|
|
4637
4648
|
}
|
|
4638
4649
|
|
|
4639
4650
|
/**
|
|
4640
|
-
*
|
|
4651
|
+
* Converts a pipeline structure to its string representation.
|
|
4652
|
+
*
|
|
4653
|
+
* Transforms a flat, simple pipeline into a properly formatted pipeline string
|
|
4654
|
+
* with sections for title, prompt, and return statement.
|
|
4641
4655
|
*
|
|
4642
4656
|
* @public exported from `@promptbook/editable`
|
|
4643
4657
|
*/
|
|
@@ -4694,7 +4708,7 @@ function deflatePipeline(pipelineString) {
|
|
|
4694
4708
|
* Note: It can not work with html syntax and comments
|
|
4695
4709
|
*
|
|
4696
4710
|
* @param markdown any valid markdown
|
|
4697
|
-
* @returns
|
|
4711
|
+
* @returns An array of strings, each representing an individual list item found in the markdown
|
|
4698
4712
|
* @public exported from `@promptbook/markdown-utils`
|
|
4699
4713
|
*/
|
|
4700
4714
|
function extractAllListItemsFromMarkdown(markdown) {
|
|
@@ -4947,11 +4961,11 @@ function flattenMarkdown(markdown) {
|
|
|
4947
4961
|
*/
|
|
4948
4962
|
|
|
4949
4963
|
/**
|
|
4950
|
-
*
|
|
4964
|
+
* Converts a title string into a normalized name.
|
|
4951
4965
|
*
|
|
4952
|
-
* @param value
|
|
4953
|
-
* @returns
|
|
4954
|
-
* @example
|
|
4966
|
+
* @param value The title string to be converted to a name.
|
|
4967
|
+
* @returns A normalized name derived from the input title.
|
|
4968
|
+
* @example 'Hello World!' -> 'hello-world'
|
|
4955
4969
|
* @public exported from `@promptbook/utils`
|
|
4956
4970
|
*/
|
|
4957
4971
|
function titleToName(value) {
|